[python-win32] adding icon in an exe

Mark Hammond mhammond at skippinet.com.au
Wed May 3 00:54:35 CEST 2006


> Does anyone know of a way to add an icon to an existing .exe file on
> win32 platform using win32all package?

With some pain :(  You need to put together the .ico structure yourself and
use the BeginUpdateResource() etc win32 functions.  The only working code I
know (off the top of my head) is in py2exe - and sadly that implements it in
C.  However, if you understand C it should be possible to port to pure
pywin32.

The win32verstamp module may also help - it updates the 'version info'
rather than the icon resources - but the principle is the same...

Mark.



More information about the Python-win32 mailing list