![]() |
|
Bitmaps on buttons using Win32/Dev-C++ |
23yrold3yrold
Member #1,134
March 2001
![]() |
uuuhhhhh ... how? -- |
Pike
Member #249
April 2000
![]() |
Create the button with the BS_BITMAP style, then send a BM_SETIMAGE message to it with the bitmap. hButton=CreateWindow("BUTTON","Button",WS_CHILD|WS_VISIBLE|BS_BITMAP,120,10,100,40,hWnd,(HMENU)504,hInstance,NULL); SendMessage(hButton,BM_SETIMAGE,IMAGE_BITMAP,(long)LoadBitmap(hInstance,(LPSTR)IDB_BITMAP1)); I'm not sure about clicked/not clicked bitmaps, I've never tried that. |
23yrold3yrold
Member #1,134
March 2001
![]() |
Thanks; I'll try it -- |
spellcaster
Member #1,493
September 2001
![]() |
If you're using vc, you can simply click the "Bitmap" check box in the button prroperties. But you'll still need to send the BM_SETIMAGE message. If yiu're going to use it for a floating tool window or something, it might be better to use a toolbar instead. Oh, DevC++.. hm... You can create toolbars using:
Check msdn.microsoft.com if you need more infos. -- |
23yrold3yrold
Member #1,134
March 2001
![]() |
I've only recently discovered toolbars (Petzold skips them) but haven't tried yet. I've looked at MSDN; is there an offline version? Hell to navigate. I'll look at your code later; toolbars are beginning to sound like what I needed in the first place How come the docs for CreateToolbarEx() say [New - Windows NT]? I got a lot of "undeclared" errors when compiling a code snippet I found, and most of the unknown stuff seems to be Windows NT only, including CreateToolbarEx(). Sucky - poo ...... -- |
|