Created
August 8, 2016 10:53
-
-
Save astrcomp/8ebd426a3d01c51b38fee40a65ed968a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
LONG WINAPI WndProc(HWND, UINT, WPARAM, LPARAM); | |
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) | |
{ | |
WNDCLASS w = { CS_HREDRAW | CS_VREDRAW ,WndProc ,0,0,hInstance,NULL,NULL,(HBRUSH)GetStockObject(WHITE_BRUSH),NULL,L"Window Class" }; | |
RegisterClass(&w); | |
HWND hwnd = CreateWindow(L"Window Class", L"Заголовок", WS_OVERLAPPEDWINDOW, 300, 200, 200, 180, NULL, NULL, hInstance, NULL); | |
ShowWindow(hwnd, nCmdShow); | |
UpdateWindow(hwnd); | |
MSG msg; | |
while (GetMessage(&msg, NULL, 0, 0)) | |
{ | |
TranslateMessage(&msg); | |
DispatchMessage(&msg); | |
} | |
return msg.wParam; | |
} | |
LONG WINAPI WndProc(HWND hwnd, UINT Message, WPARAM wparam, LPARAM lparam) | |
{ | |
switch (Message) { | |
case WM_DESTROY: | |
PostQuitMessage(0); | |
break; | |
default: | |
return DefWindowProc(hwnd, Message, wparam, lparam); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment