// WinInit --- Make window class and create window |
static BOOL WinInit( HANDLE hInstance, int nCmdShow ) |
{ |
WNDCLASS wc; |
BOOL rc; |
// Save instance handle for later use |
hinst = hInstance; |
wc.style = CS_DBLCLKS; |
wc.lpfnWndProc = WindowProc; |
wc.cbClsExtra = 0; |
wc.cbWndExtra = 0; |
wc.hInstance = hInstance; |
wc.hIcon = NULL; |
wc.hCursor = LoadCursor( NULL, IDC_ARROW ); |
wc.hbrBackground = GetStockObject(BLACK_BRUSH); |
wc.lpszMenuName = NULL; |
wc.lpszClassName = "HelloWorldClass"; |
rc = RegisterClass( &wc ); |
if( !rc ) |
return FALSE; |
// Create window |
hwndApp = CreateWindowEx( |
WS_EX_APPWINDOW, |
"HelloWorldClass", |
"Hello World", |
WS_POPUP | WS_VISIBLE, |
0, |
0, |
640, |
480, |
NULL, |
NULL, |
hInstance, |
NULL ); |
if( hwndApp == NULL ) |
return FALSE; |
UpdateWindow( hwndApp ); |
return TRUE; |
} |
WinInit() |
Initializes and sets up the |
windows part of our application |