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