Question

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?

Was it helpful?

Solution

Don't forget to set the BS_BITMAP flag!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top