I am trying to put a bitmap onto a button, its not working here is my code with the declairations used:
class WinObj
{public:
int ID;
HWND hwndButton;
};
WinObj CreateWindowsObject( int ID , const char *Caption , int xcor , int ycor , int xszi , int yszi , const char *Type , DWORD Flags )
{
WinObj Ret;
Ret.hwndButton = CreateWindow(Type,
Caption,WS_CHILD | WS_VISIBLE | Flags,
xcor,ycor ,xszi,yszi,hwnd, (HMENU)ID, (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE), NULL);
Ret.ID = ID;
return Ret;
}
// Code:
WinObj W;
CreateWindowsObject(0,"",0,0,100,100,"button",BS_B ITMAP);
SendMessage(
(HWND) W.hwndButton, // handle to destination window
BM_SETIMAGE, // message to send
(WPARAM) IMAGE_BITMAP, // image type
(LPARAM) LoadBitmap(hInstance,"IDB_BITMAP1") // handle to the image (HANDLE)
);
Please help, ive tried MSDN and stuff it just doesnt seem to work!
SPH