Summary of VC message mechanism

Source: Internet
Author: User

Knowledge about message mechanism, GDI, timer, callback mechanism, multithreading, dynamic link library, COM, sound, and MFC. In fact, these things have been familiar with a little bit before, but they cannot be refined.
Yes, because after reading the V book, I have a better understanding of these things. Let's talk about the message mechanism first. The 16-bit host has only one message queue, so every message in the system must wait for its elimination before it.
After processing the information, you can get control. Well, the book says that this kind of operating system is called a collaborative multi-task system. After entering the 32-bit Windows 98 system Program You have a message queue of your own.
In this way, each process can customize its own message processing function. Therefore, on Windows 98 and later operating systems, we can run multiple programs at the same time. Well, the book says this kind of operating system
A preemptible multi-task system.

The difference between getmessage and peekmessage is also known. Unless there is a message in the queue, getmessage does not return control to the program.
Peekmessage is different. It peek into the message queue at intervals. If a message exists, true is returned. If no message exists, false is returned. Here are two tips for the game.
Some games are rendered after receiving the wm_paint message, while others are rendered when the queue is idle (that is, when the peekmessage returns false), but I still
I am not quite sure what the difference between the two painttime options is.
You don't need to talk about it much. It seems that it is just some functions. You just need to know how to create and use it. Well, HDC seems to run through all operations of GDI.
The main achievement is to understand the role of the timer. The main function of the timer was to send the wm_timer message. The settimer function is used to set the timer, and the killtimer function is used to stop the timer. You can also send the wm_timer message to your defined message processing function.
The callback mechanism is not mentioned. Multithreading is not much to talk about. It is mainly about how to implement synchronization and mutex. No more DLL. Com is too complicated, so I won't talk about it anymore.
There are two main types of sound-related APIs in Windows: top-level APIs with the prefix of wavein and waveout, and low-level APIs with the prefix of midiin and midiout. There are also some interfaces prefixed with MCI (MCI, media control interface ).
The book says that MFC can also develop games, but it is intended for small games. Developing Large Games requires a lot of windows APIs. The encapsulation of APIS by MFC makes it not suitable for compiling some underlying software. Start with winmain.

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.