This is probably an easy one but i can't find an answer.

I am trying to make a custom controll, round button that has a couple of different states depending on if the mouse is over, clicked etc.

To do this i am using bitmaps and changing the bitmaps for these states. Currently though i have to load the bitmaps in the main window and then send the handles returned to the controll in order to get them to appear.

I would like to be able to use loadbitmap from within the controls code but i am having alot of problems. I think my problem is with getting the instance handle for the child window.

If i use invoke GetModuleHandle, NULL nothing seems to happen and if i useinvoke GetWindowLong, hWnd, GWL_HINSTANCE i get GPF.

I'm really confused. Any help would be much appreciated :(
Posted on 2002-07-15 03:50:30 by Crunchi
NaN is a "custom controll freak" ;)

he post theas threads
Custom Control Tutorial
New Control
Final Revison...
More on Custom Controls...

i think that should help :grin:
:alright:
Posted on 2002-07-15 07:40:16 by NEMO
Maybe the source I attached in this thread helps you:

http://www.asmcommunity.net/board/index.php?topic=6586
Posted on 2002-07-15 07:43:59 by bazik
Thanks for your help guys.

I myself am a NaN FaN, I've read his whole tutorial b4 and My button has benefitted from alot of what NaN said.

The problem is that the code for my cust controll lies in a seperate ASM file, similar to NANs, all of the code i can find involves only one ASM file. As NaN did, the cust controlls source is made into an inc file, so its different from any code i've seen or been given.

if I use GetModuleHandle or createstruct.hinstance i get the same result as far as data goes but when i call loadbitmap with this value for hinstance it returns NULL?

i dunno?

thanks for you help so far, hope to hear some more:)
Posted on 2002-07-15 18:53:42 by Crunchi