Original Post
I'm sorry to be such a newbie, but frankly I am. I'm in school right now hopefully to be a game dev. Fist thing I wanted to do was create a simple and cheesy launcher. I got it all running but I cant seem to texture my buttons. I've spent the last 5 hours scouring the web (googling for examples), read the books I have (PEtzold's Programming Windows) and generally banging my head on my desk. I know the right syntax, but some how the buttons show up with no texture (bitmap). So I figured I'd paste an snippet of my source and hopefully you guys can tell me what I'm doing wrong.
Code: (In WinProc)
...
HBITMAP hBmPlay;
HWND hBtnPlay;
...
case WM_CREATE:
{
hBtnPlay = CreateWindowEx(NULL, TEXT ("button"), TEXT (""), WS_CHILD | WS_VISIBLE | BS_OWNERDRAW | BS_BITMAP, 100, 250, 80, 30, hwnd, NULL, hInstance_app,
NULL);
hBmPlay = LoadBitmap(hInstance_app, TEXT("play")); // play in resource file line: play BITMAP DISCARDABLE "play.bmp"
SendMessage(hBtnPlay, BM_SETIMAGE, (WPARAM) IMAGE_BITMAP, (LPARAM) hBmPlay);
return 0;
}
...
So what's wrong? Every exampleon the web has shown me todo it this way. I'm sending the message to the handle for the child window, and giving it the handle to the bitmap. The button should be created right because I can see it in the program and the program compiles with no errors...
Anyone shed some light?
-J
[edited by - EccoDomi on March 11, 2004 1:45:09 PM]