| |
Introduction Learning and familiarizing with the Win32 API will help programmers better understand MFC and how windows programming work much more easily. Although there is definitely a learning curve, the time you spend in learning Win32 API will pay off when you're learning MFC and other window's related programming topics.
Requirements In order for this tutorial to be helpful, you must understand C/C++ well. Also, knowing binary, hex, and numeral conversions would help you understand Windows Programming a lot faster. For those of you who went to UCI, here's where ICS 51 is gunna pay off. haha.
Before, going on, please read a little supplement on Win32's primitive types and basic concepts
Windows Programming Basic Concept First, I'm gunna dwell into some basic concepts of window's programming. Windows use the event-driven programming model, in which applications respond to events by processing messages sent by the OS. An event could range anything from a keystroke to a mouse click. The entry point into the program is the function WinMain. And the accompanying function called the Window Procedure takes care most of the action. Kinda like how a pimp ( WinMain ) takes in the clients ( messages ) and his girls ( window procedure ) take care of all the...well, you get the idea. WinMain creates the window and then enters a message loop, alternately retrieving messages an dispatching them to the window procedure. The message loop ends when a WM_QUIT meesage is retrieved from the message queue. The message was sent because the user selects Exit from the File Menu or that little X on the top right corner. After that, the message loop ends, and WinMain returns and the application terminates.
Take a look at the Window Programming Model Download the tutorial Be sure to scroll down to the Win32 section and click on the Basic Window link.
|
|