Windows window program run process

Source: Internet
Author: User

Now, a brief introduction to the general operation of Windows applications, so that the first contact with Windows Development or MFC development students have a rough understanding.
1. Create a window first register a window class, initialize each field in the Wndclass, and set the window procedure function.

2. Call Rigisterclass to register this window class.

3. Create a window. CreateWindow

4. display window. ShowWindow

5. Refresh the window. UpdateWindow

5. Message loops.
The message loop is mainly explained here.
Loops in a message loop are in the program

while(GetMessage(&msg,NULL,0,0)){    TracslateMessage(&msg);    DispatchMessage(&msg);}

This structure works.
In general, clicking on the Windows window will put the event into a message queue owned by the program.
The MSG message is then removed from the loop code above and dropped to the system.
The system calls the window function of the window class that the program belongs to, and passes the message to the function, and at last determines what information is in the function and performs the corresponding feedback according to the information.

The above is the general window response process.
Let's remember these key functions. It is these functions that push the whole program to run.

Windows window program run process

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.