forked from ClemensLode/Wars
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinfo.cpp
89 lines (76 loc) · 2.35 KB
/
info.cpp
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "engine.h"
BOOL Engine_Info::DoWindowStuffFullscreen(HINSTANCE hInstance,WNDPROC WindowProc,int nCmdShow)
{
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
this->hInstance = hInstance;
wc.hIcon = LoadIcon( hInstance, IDI_APPLICATION );
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = NULL;
wc.lpszMenuName = AppName;
wc.lpszClassName = AppName;
RegisterClass( &wc );
hwnd = CreateWindowEx(
WS_EX_TOPMOST,
AppName,
WindowTitle,
WS_POPUP,
0, 0,
GetSystemMetrics( SM_CXSCREEN ),
GetSystemMetrics( SM_CYSCREEN ),
NULL,
NULL,
hInstance,
NULL );
if ( !hwnd )
{
return FALSE;
}
ShowWindow( hwnd, nCmdShow );
UpdateWindow( hwnd );
return TRUE;
}
BOOL Engine_Info::DoWindowStuff(HINSTANCE hInstance,WNDPROC WindowProc,int nCmdShow,LPCSTR Menu)
{
WNDCLASSEX wndclass ;
wndclass.cbSize = sizeof (wndclass) ;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WindowProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
this->hInstance = hInstance;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = Menu;
wndclass.lpszClassName = AppName ;
wndclass.hIconSm = LoadIcon (NULL, IDI_APPLICATION) ;
RegisterClassEx (&wndclass) ;
hwnd = CreateWindow (AppName,
WindowTitle,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL) ;
if ( !hwnd )
{
return FALSE;
}
ShowWindow (hwnd, nCmdShow) ;
UpdateWindow (hwnd) ;
return TRUE;
}
void Engine_Info::EndApp()
{
DestroyWindow(this->hwnd);
}