11 BOOL InitApplication(HINSTANCE hInstance)
15 /* Load the application name and description strings */
17 LoadString(hInstance, IDS_APPNAME, szAppName, sizeof(szAppName));
18 LoadString(hInstance, IDS_DESCRIPTION, szTitle, sizeof(szTitle));
20 /* Fill in window class structure with parameters that describe the
23 wc.cbSize = sizeof(WNDCLASSEX);
25 /* Load small icon image */
26 wc.hIconSm = LoadImage(hInstance,
27 MAKEINTRESOURCEA(IDI_APPICON),
32 wc.style = CS_HREDRAW | CS_VREDRAW; /* Class style(s) */
33 wc.lpfnWndProc = (WNDPROC)WndProc; /* Window Procedure */
34 wc.cbClsExtra = 0; /* No per-class extra data */
35 wc.cbWndExtra = 0; /* No per-window extra data */
36 wc.hInstance = hInstance; /* Owner of this class */
37 wc.hIcon = LoadIcon(hInstance, szAppName); /* Icon name from .rc */
38 wc.hCursor = LoadCursor(NULL, IDC_ARROW); /* Cursor */
39 wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); /* Default color */
40 wc.lpszMenuName = szAppName; /* Menu name from .rc */
41 wc.lpszClassName = szAppName; /* Name to register as */
43 /* Register the window class and return FALSE if unsuccesful */
45 if (!RegisterClassEx(&wc))
47 if (!RegisterClass((LPWNDCLASS)&wc.style))
51 /* Call module specific initialization functions here */
56 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
60 /* Save the instance handle in a global variable for later use */
63 /* Create main window */
64 hwnd = CreateWindow(szAppName, /* See RegisterClass() call */
65 szTitle, /* window title */
66 WS_OVERLAPPEDWINDOW, /* Window style */
67 CW_USEDEFAULT, 0, /* positioning */
68 CW_USEDEFAULT, 0, /* size */
69 NULL, /* Overlapped has no parent */
70 NULL, /* Use the window class menu */
77 /* Call module specific instance initialization functions here */
79 /* show the window, and paint it for the first time */
80 ShowWindow(hwnd, nCmdShow);