Is it possible to load a bitmap or icon onto a button?

[b][red]This message was edited by Giant at 2002-9-18 3:36:33[/red][/b][hr]

I am writing a GUI and am creating a toolbar. I am referenceing Petzold, Windows Programming, Fifth Edition, and cant find what I am looking for. I want the toolbar to have pictures on the buttons, like all GUI's but I can only find how to put text on the button, and a tiny bit on how to draw on the button, but it looks crap.

The command I use to create a button is

for ( i = 0 ; i < NUM ; i++)
hwndButton[i] = CreateWindow ("button", button[i].text,
WS_CHILD | WS_VISIBLE | button[i].style,
0, 0, 30, 30, hwnd, (HMENU) 5, hInst, NULL) ;

where button[] is

long style ;
char *text ;
button[] =

#define NUM (sizeof button / sizeof button[0])

Any help would be greatly appreciated.



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion