WIN32 Program Structure

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.