Windows programs are based on a message-driven system, and all of the user's behavior and events are turned into messages by Windows.
Processing of messages inside Windows:
Message life cycle:
1. Message generation: Windows monitors all specific input event hardware devices. When the system receives a device input event. Windows turns the corresponding event into a message.
2. Message delivery: Each message has a target form to receive, and the target form has a message queue. When Windows generates a message, it is delivered directly to its message queue. This enables the delivery of Windows Messaging to the application.
3. Message processing: The application itself is constantly getting message conversions from Message Queuing and distributing messages to Windows callback application's message handler functions. Each message is processed.
650) this.width=650; "Style=" background-image:none;border-right-width:0px;border-top-width:0px; border-bottom-width:0px;border-left-width:0px;padding-left:0px;padding-right:0px;padding-top:0px; "Title=" image "alt=" image "Src=" http://images.cnblogs.com/cnblogs_com/ztercel/201107/201107202118449455.png "border=" 0 "height= "471" width= "652"/>
Basic steps to create a WIN32 program:
1.RegisterWndClass registers a form class, and Windows requires that the class name be registered before all forms are instantiated. The purpose of registration is to set the form procedure function. Let the system know who will handle the message.
2.createwnd– This step creates a form based on the class registered in the first step
3.ShowWnd-Displays the form created in the second step
4.RunMessageLoop-message loop, part of the message lifecycle that monitors, gets, transforms, distributes messages its mission is to orchestrate the life of the application
This article is from the "None" blog, please be sure to keep this source http://evely.blog.51cto.com/1089422/1637970
WIN32 Program Structure