Chapter 3 window and message

Source: Internet
Author: User

This chapter describes the framework structure of Windows applications:

 

The wndclas class is actually used to describe the information of the window to be created, including the name of the window category and the message processing function corresponding to the window.

 

Then, use registerclass (& wndclass) to register the window. Actually, tell the operating system that you want to create a window ~

 

Next, createwindow (...) Is to create a real window and display the window in showwindow () through the returned handle.

 

 

Updatewindow () and new window. Next, enter the message loop:

1. getmessage () obtains messages from the operating system,

2. Analyze the message through translatemessage (), and then

3. Use the dispatchmessage () function to send messages to message processing functions in different windows.

 

1 ~ 3. This process is infinite until the program exits.

 

 

Next chapterThe output text uses how to output text in a window as an example to explain the entire process above. This process is a general program design process. Figuring out this process is the basis for learning to write programs.

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.