forked from jps1973/Internet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButtonWindow.cpp
More file actions
68 lines (48 loc) · 1.63 KB
/
ButtonWindow.cpp
File metadata and controls
68 lines (48 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// ButtonWindow.cpp
#include "ButtonWindow.h"
// Global variables
static HWND g_hWndButton;
BOOL IsButtonWindow( HWND hWnd )
{
// See if supplied window is button window
return( hWnd == g_hWndButton );
} // End of function IsButtonWindow
BOOL ButtonWindowCreate( HWND hWndParent, HINSTANCE hInstance )
{
BOOL bResult = FALSE;
// Create button window
g_hWndButton = CreateWindowEx( BUTTON_WINDOW_EXTENDED_STYLE, BUTTON_WINDOW_CLASS_NAME, BUTTON_WINDOW_TEXT, BUTTON_WINDOW_STYLE, 0, 0, 0, 0, hWndParent, ( HMENU )BUTTON_WINDOW_ID, hInstance, NULL );
// Ensure that button window was created
if( g_hWndButton )
{
// Successfully created button window
// Update return value
bResult = TRUE;
} // End of successfully created button window
return bResult;
} // End of function ButtonWindowCreate
BOOL ButtonWindowEnable( BOOL bState )
{
// Enable button window
return EnableWindow( g_hWndButton, bState );
} // End of function ButtonWindowEnable
BOOL ButtonWindowGetRect( LPRECT lpRect )
{
// Get button window rect
return GetWindowRect( g_hWndButton, lpRect );
} // End of function ButtonWindowGetRect
BOOL ButtonWindowMove( int nX, int nY, int nWidth, int nHeight, BOOL bRepaint )
{
// Move button window
return MoveWindow( g_hWndButton, nX, nY, nWidth, nHeight, bRepaint );
} // End of function ButtonWindowMove
HWND ButtonWindowSetFocus()
{
// Focus on button window
return SetFocus( g_hWndButton );
} // End of function ButtonWindowSetFocus
void ButtonWindowSetFont( HFONT hFont )
{
// Set button window font
SendMessage( g_hWndButton, WM_SETFONT, ( WPARAM )hFont, ( LPARAM )TRUE );
} // End of function ButtonWindowSetFont