Add a bitmap to a button
I have compiled the sample code "EmptyPanel" of the sdk, then made my own version with a control bar and some buttons.
I would like to add bitmaps to the buttons, adding the BS_BITMAP style to the native windows buttons then sending
hInst = (HINSTANCE)GetWindowLongPtr((HWND)ctrlBarPlatformWindow, GWLP_HINSTANCE);
hBmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP1));
hBmp hInst are global to the plugin class. hBmp returns 0;
then
SendMessage((HWND)hwndButtonPrevious, (UINT)BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBmp);
The function is called in the CtrlBarWindowProc between two Push/Pop AppContext otherwise not working.
Buttons are responding normally to command and make the job.
But I never had any image on it!
I tried many variations, but nothing happen.
I guess something wrong with hInst, hBmp, or the place where I Send the BM_SETIMAGE message
Any idea?
Pierre
