wxpython icon for task bar

前端 未结 4 1999
抹茶落季
抹茶落季 2021-01-03 03:08

I am trying to set an icon in my wxpython program. So far, after reading many pages and examples, I was able to set an icon at the window, which also works when using alt+ta

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-03 03:33

    I have found a fix to the problem described in my second answer in another SO question/answer which is PyQt related. Add this code to your application before the GUI is created:

    import ctypes
    myappid = 'mycompany.myproduct.subproduct.version' # arbitrary string
    ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
    

    The icon will be set correctly with either taskbar buttons settings.

    Explanation can be found here: https://stackoverflow.com/a/1552105/674475

提交回复
热议问题