1 | // WinInit --- Make window class and create window |
2 | static BOOL WinInit( HANDLE hInstance, int nCmdShow ) |
3 | { |
4 | WNDCLASS wc; |
5 | BOOL rc; |
6 | // Save instance handle for later use |
7 | hinst = hInstance; |
8 | wc.style = CS_DBLCLKS; |
9 | wc.lpfnWndProc = WindowProc; |
10 | wc.cbClsExtra = 0; |
11 | wc.cbWndExtra = 0; |
12 | wc.hInstance = hInstance; |
13 | wc.hIcon = NULL; |
14 | wc.hCursor = LoadCursor( NULL, IDC_ARROW ); |
15 | wc.hbrBackground = GetStockObject(BLACK_BRUSH); |
16 | wc.lpszMenuName = NULL; |
17 | wc.lpszClassName = "HelloWorldClass"; |
18 | rc = RegisterClass( &wc ); |
19 | if( !rc ) |
20 | return FALSE; |
21 | // Create window |
22 | hwndApp = CreateWindowEx( |
23 | WS_EX_APPWINDOW, |
24 | "HelloWorldClass", |
25 | "Hello World", |
26 | WS_POPUP | WS_VISIBLE, |
27 | 0, |
28 | 0, |
29 | 640, |
30 | 480, |
31 | NULL, |
32 | NULL, |
33 | hInstance, |
34 | NULL ); |
35 | if( hwndApp == NULL ) |
36 | return FALSE; |
37 | UpdateWindow( hwndApp ); |
38 | return TRUE; |
39 | } |
40 | WinInit() |
41 | Initializes and sets up the |
42 | windows part of our application |