How to set a windows icon? Windows 10, PyInstaller, just the basic CEFPython (no QT/WX/...)

203 views
Skip to first unread message

Alexander Abdulov

unread,
May 31, 2021, 2:02:52 PM5/31/21
to CEF Python

I am using just basic CEFPython library:
cef.Initialize()
browser = cef.CreateBrowserSync()
cef.MessageLoop()

I am building it using PyInstaller, and I have set icon parameter to the EXE function

However, I get the following result:
Безымянный.png

The icon is set correctly in Windows Explorer and in the taskbar, however in the top-left corner of the window itself the icon is not set.

Is it possible to solver the issue? Or is it necessary to use additional libraries such as PyQT?

Thank you

Czarek Tomczak.

unread,
May 31, 2021, 3:35:24 PM5/31/21
to CEF Python
On Windows you can use ctypes and call Win32 API. See https://stackoverflow.com/questions/54578853/how-to-set-a-cef-window-icon-in-python
Set both  ICON_BIG and ICON_SMALL.

Alexander Abdulov

unread,
Jun 1, 2021, 5:34:01 AM6/1/21
to CEF Python
Thank you a lot, it works
Reply all
Reply to author
Forward
0 new messages