putting a button on a window
ok i have been learning the code for making a window in openGL and i finally got it down. so for the past like 30 minutes ive been looking for a tut on how to include a button into the window so when it is clicked, it can either be a link or open something.. does ne one know where i can get a tut of this or maybe post some code here to explain it 4 me.. thx
1 Attachment(s)
Re: putting a button on a window
Code:
switch (uMsg)
// Check For Windows Messages
{
case WM_CREATE :
hdc = GetDC (hWnd) ;
SelectObject (hdc, GetStockObject
(SYSTEM_FIXED_FONT)) ;
GetTextMetrics (hdc, &tm) ;
cxChar = tm.tmAveCharWidth ;
cyChar = tm.tmHeight + tm.tmExternalLeading ;
ReleaseDC (hWnd, hdc) ;
// create button
hwndButton = CreateWindow ("button", "PUSHBUTTON",
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
cxChar, cyChar ,
20 * cxChar, 7 * cyChar / 4,
hWnd, (HMENU) 0,
((LPCREATESTRUCT) lParam) -> hInstance, NULL) ;
return 0 ;
case WM_COMMAND :
// Action
break;
Picture in attach
It what is necessary?
Re: putting a button on a window
This is good but is a eye-killer, draw a button with PaintShop and use that texture as button, it's better.
Re: putting a button on a window
Quote:
but is a eye-killer
О.. yes.:)
But it is very simple.:).