S
S
StarCatSTT2020-08-21 14:56:39
Python
StarCatSTT, 2020-08-21 14:56:39

Changing the icon on the taskbar does not work?

I wanted to make the icon displayed not only in the corner of the window, but also on the taskbar.
Found this solution:

import ctypes
import pygame as pg
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(u"my.app.id.01")

window=pg.display.set_mode((1200,400))
pg.display.set_caption('Test')
icon = pg.image.load('icon.png')
pg.display.set_icon(icon)
screen=pg.Surface((1200,400))

#code, code, code...

But it works once. Sometimes everything is fine, sometimes the pythonw icon pops up, sometimes the standard pygame.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question