The main program function, WinMain, performs several tasks. Specifically, it:
1.Registers the application's window class
2.Creates and displays the application's main window
3.Checks for messages from Windows
Any code you want to execute prior to checking for Windows messages needs to be placed between the generated code that performs Steps 2 and 3.
The comment INSERT YOUR CODE HERE in the following example indicates where you would insert such code (the other comments were generated by QuickCase:W).
.
.
.
ShowWindow(hWndMain, nCmdShow); /* display main window */
/* ---------- INSERT YOUR CODE HERE --------- */
while(GetMessage(&msg, NULL, 0, 0)) /* Until WM_QUIT message */
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
.
.
.
This section of the program always appears near the top of the .C file. If you can't find it easily, use the environment's Search menu to find the ShowWindow function.