In wxPython 3.0 I could extract the icon from a .exe and create a bitmap by calling wx.BitmapFromIcon:
resourceIcons = win32gui.ExtractIconEx( path, 0 )
hIcon = resourceIcons[1][0] if smallIcon else resourceIcons[0][0]
iconInfo = win32gui.GetIconInfo( hIcon )
bitmapInfo = win32gui.GetObject( iconInfo[4] )
ico = wx.Icon( path, wx.BITMAP_TYPE_ICO, bitmapInfo.bmWidth, bitmapInfo.bmHeight )
ico.SetHandle( hIcon )
bitmap = wx.BitmapFromIcon( ico )
for i in resourceIcons:
for h in i:
win32gui.DestroyIcon( h )
return bitmap
I've been unable to get this to work since upgrading to Phoenix.
The "Classic vs Phoenix" document says the equivalent of BitmapFromIcon is the wx.Bitmap constructor but I've been unable to get that to work. The wx.Bitmap documentation implies that you could pass the filename to its constructor but I've been unable to get that to work.