Any body got a snippet of code showing how and where to send the BM_SETIMAGE message to the window to set a bitmap resource to a button.


Any help appreciated.
:alright:
Posted on 2001-08-30 13:03:31 by titan
OK, I admit I haven't figured out how to use this MB yet. But
here is how to put a bitmap on a button. :grin:


hWin = handle of window containing the button
also I have the bitmap included in my resource file

invoke CreateWindowEx,NULL,addr szButtonClass,NULL,WS_VISIBLE or WS_CHILD or\
BS_PUSHBUTTON or BS_BITMAP,612,104,25,25,hWin,ID_BITBTN,hInstance,NULL
mov hBitBtn,eax
invoke LoadBitmap,hInstance,ID_BITMAP
mov hBitBtnBmp,eax
invoke SendMessage,hBitBtn,BM_SETIMAGE,IMAGE_BITMAP,hBitBtnBmp

BTW, the way I do this is in the WM_CREATE part of the message loop.
Posted on 2001-08-30 15:11:32 by anon
Thanx

I'm sure it will work.
Posted on 2001-08-30 16:50:08 by titan