How do you create a windows button? I have seen diferent methods but none of them work.
Never be afraid to try something new.
Remember, amateurs built the ark.
Professionals built the Titanic.
🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
How do you create a windows button?
Well, a little more information is needed. Where do you want to create the button (in a standard window or a dialog)? Also, are you using the Win32 SDK or MFC?
In the window procedure you use WM_CREATE
put in somethiung like
hButton = CreateWindow("button", "E&xit", WS_CHILD / BS_PUSHBUTTON, 600, 400, 100, 50, hWnd, MAKEINTRESOURCE(201), Instance, NULL);
ShowWindow(hButton, SW_SHOW);
hButton = HWND
after MAKEINTRESOURCE you put a number, like...hmmm.....before you #define the number with a BUTTON thing like
#define EXIT_BUTTON 201
and to check which button has been pressed use the WM_COMMAND and us ea switchstatement for the wParam......just check which number it is that has been ''pressed''....
Dance with me......
put in somethiung like
hButton = CreateWindow("button", "E&xit", WS_CHILD / BS_PUSHBUTTON, 600, 400, 100, 50, hWnd, MAKEINTRESOURCE(201), Instance, NULL);
ShowWindow(hButton, SW_SHOW);
hButton = HWND
after MAKEINTRESOURCE you put a number, like...hmmm.....before you #define the number with a BUTTON thing like
#define EXIT_BUTTON 201
and to check which button has been pressed use the WM_COMMAND and us ea switchstatement for the wParam......just check which number it is that has been ''pressed''....
Dance with me......
http://members.xoom.com/CJdeVos/index.htm
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement