source: Daodan/src/guitest.c@ 1032

Last change on this file since 1032 was 992, checked in by alloc, 11 years ago

Daodan: Removed unused MSVC tree, build folders; reorganized source layout; removed Flatline from current Daodan

File size: 1.0 KB
Line 
1#include <windows.h>
2
3LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
4
5void guitest(HMODULE hInstance, int nCmdShow)
6{
7 MSG msg;
8 HWND hwnd;
9 WNDCLASSW wc;
10
11 wc.style = CS_HREDRAW | CS_VREDRAW;
12 wc.cbClsExtra = 0;
13 wc.cbWndExtra = 0;
14 wc.lpszClassName = L"Window";
15 wc.hInstance = hInstance;
16 wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
17 wc.lpszMenuName = NULL;
18 wc.lpfnWndProc = WndProc;
19 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
20 wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
21
22 RegisterClassW(&wc);
23 hwnd = CreateWindowW( wc.lpszClassName, L"Window",
24 WS_OVERLAPPEDWINDOW | WS_VISIBLE,
25 100, 100, 350, 250, NULL, NULL, hInstance, NULL);
26
27 ShowWindow(hwnd, nCmdShow);
28 UpdateWindow(hwnd);
29
30 while( GetMessage(&msg, NULL, 0, 0)) {
31 DispatchMessage(&msg);
32 }
33}
34
35LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
36{
37 switch(msg)
38 {
39 case WM_DESTROY:
40 PostQuitMessage(0);
41 return 0;
42 }
43
44 return DefWindowProcW(hwnd, msg, wParam, lParam);
45}
Note: See TracBrowser for help on using the repository browser.