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
|
#include <Windows.h>
WNDCLASSEXW cl;
int main()
{
HINSTANCE hmod = GetModuleHandleW(NULL);
cl.cbSize = sizeof(cl);
cl.style = CS_HREDRAW | CS_VREDRAW;
cl.lpfnWndProc = DefWindowProc;
cl.cbClsExtra = 0;
cl.cbWndExtra = 0;
cl.hInstance = hmod;
cl.hIcon = NULL;
cl.hCursor = LoadCursorW(NULL, IDC_ARROW);
cl.hbrBackground = GetSysColorBrush(COLOR_BTNFACE + 3);
cl.lpszMenuName = NULL;
cl.lpszClassName = L"myclass";
cl.hIconSm = NULL;
RegisterClassExW(&cl);
HWND hwnd = CreateWindowExW(
WS_EX_CLIENTEDGE,
L"myclass",
L"Hello",
WS_CAPTION,
200,
200,
300,
400,
NULL,
NULL,
NULL,
NULL
);
ShowWindow(hwnd, SW_SHOW);
MSG msg;
while (GetMessageW(&msg, NULL, 0, 0) != 0) {
TranslateMessage(&msg);
DispatchMessageW(&msg);
}
}
|