The C Source Code File

The second file in Figure 1-5 is HELLOWIN.C, the C source code file. It may take awhile before you recognize that this program is indeed written in C!

Let's first take a global look at HELLOWIN.C before getting into details. The file contains only two functions: WinMain and WndProc. WinMain is the entry point to the program. It is the equivalent of the standard C main function. Every Windows program has a WinMain function.

WndProc is the window procedure for HELLOWIN's window. This function processes messages to the window. No code in HELLOWIN.C calls WndProc directly: WndProc is called only from Windows. However, there is a reference to WndProc in WinMain, which is why the function is declared near the top of the program before WinMain.