THE WINDOWS PROGRAMMING HURDLES

Even with my explanation of HELLOWIN, the structure and workings of the program are probably still somewhat mysterious. In a short C program written for a conventional environment, the entire program may be contained in the main function. In HELLOWIN, WinMain contains only program overhead necessary to register the window class, create the window, and retrieve and dispatch messages from the message queue.

All the real action of the program occurs in the window procedure. In HELLOWIN, this action is not much—it simply displays a text string in its window. But in later chapters you'll find that almost everything a Windows program does it does in response to a message to a window procedure. This is one of the major conceptual hurdles that you must leap to begin writing Windows programs.