Home  |  FAQ  |  About  |  Contact  |  View Source   
 
SEARCH:
 
BROWSE:
    My Hood
Edit My Info
View Events
Read Tutorials
Training Modules
View Presentations
Download Tools
Scan News
Get Jobs
Message Forums
School Forums
Member Directory
   
CONTRIBUTE:
    Sign me up!
Post an Event
Submit Tutorials
Upload Tools
Link News
Post Jobs
   
   
Home >  Tutorials >  General Coding >  Coding a Basic Window from Win32 API
Add to MyHood
   Coding a Basic Window from Win32 API   [ printer friendly ]
Stats
  Rating: 4.5 out of 5 by 6 users
  Submitted: 01/19/03
Ricky Tsao ()

 
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.

Return to Browsing Tutorials

Email this Tutorial to a Friend

Rate this Content:  
low quality  1 2 3 4 5  high quality

Reader's Comments Post a Comment
 
If its anything other than a 5, please post comments on how I can make future tutorials better. Thanks!
-- Ricky Tsao, January 23, 2003
 
In the future i'd put as much stuff as possible on the tutorial page itself. You could have put the code on here with the formatting tags and explained it on the page itself. But even so the content (that's not on the page) is good. 5 *'s!
-- Lee B, January 28, 2003
 
This is a great starting point for new MFC programmers. Thanks for the tutorial!
-- Sami Ahmed, February 02, 2003
 
the link to the tutorial appears to be a broken link at least from here.
-- Kyle Holmes, November 02, 2003
 
Copyright © 2001 DevHood® All Rights Reserved