Don't forget to set the BS_BITMAP flag!
Win32: Unable to set Bitmap to Button
Frage
I have this code:
case WM_CREATE:
{
HWND button = CreateWindowEx(NULL,
"BUTTON",
"Do!",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
580,
520,
100,
24,
hwnd,
(HMENU)IDC_MAIN_BUTTON,
GetModuleHandle(NULL),
NULL);
HBITMAP b = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(1));
SendMessage(button, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)b);
I see the button normally, but not the bitmap I assigned.
What's wrong?
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow