|
@@ -0,0 +1,50 @@ |
|
|
|
|
|
#include <windows.h> |
|
|
|
|
|
|
|
|
|
|
|
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); |
|
|
|
|
|
|
|
|
|
|
|
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, |
|
|
|
|
|
PWSTR pCmdLine, int nCmdShow) { |
|
|
|
|
|
|
|
|
|
|
|
MSG msg; |
|
|
|
|
|
HWND hwnd; |
|
|
|
|
|
WNDCLASSW wc = { |
|
|
|
|
|
.style = CS_HREDRAW | CS_VREDRAW, |
|
|
|
|
|
.cbClsExtra = 0, |
|
|
|
|
|
.cbWndExtra = 0, |
|
|
|
|
|
.lpszClassName = L"Window", |
|
|
|
|
|
.hInstance = hInstance, |
|
|
|
|
|
.hbrBackground = GetSysColorBrush(COLOR_3DFACE), |
|
|
|
|
|
.lpszMenuName = NULL, |
|
|
|
|
|
.lpfnWndProc = WndProc, |
|
|
|
|
|
.hCursor = LoadCursor(NULL, IDC_ARROW), |
|
|
|
|
|
.hIcon = LoadIcon(NULL, IDI_APPLICATION), |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
RegisterClassW(&wc); |
|
|
|
|
|
hwnd = CreateWindowW(wc.lpszClassName, L"Window", |
|
|
|
|
|
WS_OVERLAPPEDWINDOW | WS_VISIBLE, |
|
|
|
|
|
100, 100, 350, 250, NULL, NULL, hInstance, NULL); |
|
|
|
|
|
|
|
|
|
|
|
ShowWindow(hwnd, nCmdShow); |
|
|
|
|
|
UpdateWindow(hwnd); |
|
|
|
|
|
|
|
|
|
|
|
while (GetMessage(&msg, NULL, 0, 0)) { |
|
|
|
|
|
DispatchMessage(&msg); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return (int) msg.wParam; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, |
|
|
|
|
|
WPARAM wParam, LPARAM lParam) { |
|
|
|
|
|
|
|
|
|
|
|
switch(msg) { |
|
|
|
|
|
|
|
|
|
|
|
case WM_DESTROY: |
|
|
|
|
|
|
|
|
|
|
|
PostQuitMessage(0); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return DefWindowProcW(hwnd, msg, wParam, lParam); |
|
|
|
|
|
} |