Python COM and bitmap Resource ID's

Mark Hammond mhammond at
Mon Jan 13 00:14:02 CET 2003

I think you will be pushing poo uphill here.  You pass the resource ID 
to the app, but how do you pass the DLL handle or filename?  Would it be 
possible to create a DLL with nothing but resources?

Note that win32ui.pyd does have bitmap resource in it, so if you can 
work out how it works out what DLL it uses, you could first experiment 
with this.


Markus Wankus wrote:
> Hmmm....looking through the win32ui documentation, I thought maybe 
> something like:
> win32ui.SetResource(win32ui.LoadLibrary('some_dummy_dll_with_bitmap_resources.dll') 
> )
> ...might do the trik.  It doesn't appear to work.  Does anyone know if I 
> am tryiing to do something that is not possible?
> Thanks,
> Mark.
> On Sat, 11 Jan 2003 18:38:22 -0500, Markus Wankus 
> <markus_wankus at> wrote:
>> Hi everyone,
>> I am playing with Python and COM (win32all).  I have gotten farthan 
>> than I would have thought myself capable of getting.  My ultimate goal 
>> is to use my Python COM server to create a custom toolbar, which will 
>> lauch pure Python scripts inside the app I am customizing.
>> Well, the app I am working with provides this functionality through 
>> the following API funtion:
>> AddToolbar ( Cookie, Title, SmallBitmapResourceID, 
>> LargeBitmapResourceID, MenuPositionForToolbar, DocumentType )
>> Where you must specify the resource ID's of the large and small 
>> bitmap.  Normally these are within the .dll calling the AddToolbar 
>> function, but I don't have a .dll - I have Python!  Is there any way 
>> to fool this into grabbing a bitmap from somewhere? i.e. - Can you 
>> create a resource out of a bitmap on the fly with the win32all 
>> extensions or something?

More information about the Python-list mailing list