LOADSTRING]; // the main window class name
13
14 HRGN gRegion = 0;
15 BOOL gChangeSizeCalled = FALSE;
16 RECT gWindowSize = {0,0,0,0};
17
18 // Forward declarations of functions included in this code module:
19 ATOM MyRegisterClass(HINSTANCE hInstance);
20 BOOL InitInstance(HINSTANCE, int);
21 LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
22 INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
23
24 void PaintNC(HWND, HDC);
25
26
27 int APIENTRY _tWinMain(HINSTANCE hInstance,
28 HINSTANCE hPrevInstance,
29 LPTSTR lpCmdLine,
30 int nCmdShow)
31 {
32 UNREFERENCED_PARAMETER(hPrevInstance);
33 UNREFERENCED_PARAMETER(lpCmdLine);
34
35 // TODO: Place code here.
36 MSG msg;
37 HACCEL hAccelTable;
38
39 // Initialize global strings
40 LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
41 LoadString(hInstance,
IDC_SKIN, szWindowClass, MAX_LOADSTRING);
42 MyRegisterClass(hInstance);
43
44 // Perform application initialization:
45 if (!InitInstance (hInstance, nCmdShow))
46 {
47 return FALSE;
48 }
49
50 hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SKIN));
51
52 // Main message loop:
53 while (GetMessage(&msg, NULL, 0, 0))
54 {
55 if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
56 {
57 TranslateMessage(&msg);
58 DispatchMessage(&msg);
59 }
60 }
61
62 return (int) msg.wParam;
63 }
64
65
66
67 //
68 // FUNCTION: MyRegisterClass()
69 //
70 // PURPOSE: Registers the window class.
71 //
72 // COMMENTS:
73 //
74 // This function and its usage are only necessary if you want this code
75 // to be compatible with Win32 systems prior to the 'RegisterClassEx'
76 // function that was added to Windows 95. It is important to call this function
77 // so that the application will get 'well formed' small icons associated
78 // with it.
79 //
80 ATOM MyRegisterClass(HINSTANCE hInstance)
81 {
82 WNDCLASSEX wcex;
83
84 wcex.cbSize = sizeof(WNDCLASSEX);
85
86 wcex.style = CS_HREDRAW | CS_VREDRAW;
87 wcex.lpfnWndProc = WndProc;
88 wcex.cbClsExtra = 0;
89 wcex.cbWndExtra = 0;
90 wcex.hInstance = hInstance;
91 wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SKIN));
92 wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
93 wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
94 wcex.lpszMenuName = MAKEINTRESOURCE(IDC_SKIN);
95 wcex.lpszClassName = szWindowClass;
96 wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
97
98 return RegisterClassEx(&wcex);
99 }
100
101 //
102 // FUNCTION: InitInstance(HINSTANCE, int)
103 //
104 // PURPOSE: Saves instance handle and creates main window
105 //
106 // COMMENTS:
107 //
108 // In this function, we save the instance handle in a global variable and
109 // create and display the main program window.
110 //
111 BOOL InitInstance(HINSTANCE hInstance, int n