Message ing implementation

Source: Internet
Author: User

 

WindowsMessageOverview

WindowsApplication inputWindowsThe window in which the system sends messages to the application. These windows receive and process messages through the window process, and then return the controlWindows.

Message category

Queue messages and non-queue messages

There are two ways to send messages: queue messages and non-queue messages. The queue message is sent to the system message queue and then to the thread message queue. Non-queue messages are directly sent to the destination window.

The message queue is described as follows:

WindowsMaintain a system Message Queue (System message queue), EachGUIThe thread has a thread Message Queue (Thread message queue).

The mouse and keyboard events are converted from the mouse or keyboard driver into input messages and placed into the system message queue. For exampleWM_MOUSEMOVE,WM_LBUTTONUP,WM_KEYDOWN,WM_CHARAnd so on.WindowsEach time a message is removed from the system message queue, the system determines the window to which it is sent and the thread that created the window, and then puts it into the thread message queue of the window creation thread. The thread Message Queue receives messages sent to the window created by the thread. The thread extracts the message from the message queue and usesWindowsSend it to an appropriate window for processing.

In addition to keyboard and mouse messages, queue messages also haveWM_PAINT,WM_TIMERAndWM_QUIT.

Most messages other than these queue messages are non-queue messages.

System messages and application messages

The message sources can be divided into system-defined messages and application-defined messages.

System messageIDThe range is from0ToWM_USER-1, OrZero X 80000To0 XBFFFF; Application message fromWM_USER(Zero X 0400)0X7FFF, Or0XC000To0 XFFFF;WM_USERTo0X7FFFThe range of messages is used by the application itself;0XC000To0 XFFFF

Related Article

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.