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]
Hi

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

[code]
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) ;
[/code]

where button[] is

[code]
struct
{
long style ;
char *text ;
}
button[] =
{
BS_PUSHBUTTON, "PUSHBUTTON"
};

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

Any help would be greatly appreciated.

Thanks
Ciaran

Comments

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!

Categories

In this Discussion