[python-win32] Re: win32gui_menu doesn't work correctly

Roger Upole rwupole at msn.com
Wed Jul 16 04:23:49 CEST 2008


> Bugger - that doesn't appear to be working for me either at the moment.  I
> can't recall me knowing a reason for that but I don't have time at this
> instant to dig deeper.
> 
> Cheers,
> 
> Mark

This one appears to be my fault.  I changed bitmap handles
to be self-closing like PyHANDLE's.  (DeleteObject is called
when the object's refcount goes to 0)
Adding a .Detach at line 168 lets the icon show up again:

        item, extras = PackMENUITEMINFO(text="Menu with icon",
                                        hbmpItem=hbm.Detach(),
                                        wID=1011)


         Roger



More information about the python-win32 mailing list