1. Window process for each and every window will possess a callback function called window procedure (WndProc), it includes 4 parameters,
Cheap Office 2007, namely: the window deal with (Window Handle), the message ID (Message ID), and two message parameter (wParam, lParam), receive a message when the window method will get in touch with the window process to method the message. (So called callback functions)
2 message type
one) system-defined message (System-Defined Messages)
Inside the SDK in the message pre-defined, non-user-defined, and its array [0x0000, 0x03ff], between may be divided in to the adhering to three classes:
; a> window messages (Windows Message)
together with the window's internal operations, such as producing windows, drawing window, destroying windows. Might be a normal window, it could be Dialog, control and so on.
such as: WM_CREATE, WM_PAINT, WM_MOUSEMOVE, WM_CTLCOLOR, WM_HSCROLL ...
2> command message (Command Message)
and processing user requests associated, which include clicking a menu item or toolbar or manage, will possess a command message.
WM_COMMAND, LOWORD (wParam) that menu item, toolbar button or the manage ID. If it really is manage, HIWORD (wParam), stated control message sort
3> control notification (Notify Message)
control notification message, This will be the most flexible message format, the Message, wParam, lParam were: WM_NOTIFY, manage ID, level NMHDR pointer. NMHDR is made up of controls for content,
Office Pro Plus 2007, can be arbitrarily prolonged.
2) method definition info (Application-Defined Messages)
user-defined message, for its scope the following provisions: WM_USER: 0x0400-0x7FFF (ex. WM_USER +10) WM_APP (winver> 4.0): 0x8000-0xBFFF (ex.WM_APP +4)
RegisterWindowMessage: 0xC000 -0xFFFF
three Message Queue (Message Queues)
Windows, one can find two types of message queue
one) Method Message Queue (System Message Queue)
the only method which is actually a Queue, gadget drivers (mouse, keyboard) will enter operation in to the program message queue exists, then the method will place this message where the target window's message queue thread (thread-specific message queue) inside the pending
2) thread Message Queuing (Thread-specific Message Queue)
GUI thread each and every thread will maintain a message queue. (This queue is only GDI operate calls in the thread might be produced, not developed by default.) Then the thread message queue in the message is going to be sent towards the suitable window process (WndProc) therapy. Be aware: the thread message queue in WM_PAINT,
Office 2010 Sale, WM_TIMER only in the Queue when no other messages are going to be processed, WM_PAINT messages is going to be mixed to strengthen performance. All other messages first in very first out (FIFO) way to be processed.
4 queue message (Queued Messages) and non-queue messages (Non-Queued Messages)
one) queue the message (Queued Messages )
message will probably be saved inside the message queue, the message loop will consider the message from your queue and distributed to the window therapy like a mouse, keyboard messages.
2) non-queue the message (NonQueued Messages)
message will bypass the method message queue and thread message queue is sent straight for the window process is dealt with
for instance: WM_ACTIVATE, WM_SETFOCUS, WM_SETCURSOR, WM_WINDOWPOSCHANGED Be aware: postMessage message queue message is sent, it is going to queue the message Post to the message; SendMessage to send the message proper and incorrect queue message is sent straight for the window procedure
5 PostMessage (PostThreadMessage), SendMessage PostMessage: the message in to the specified window in which the message queue immediately right after the thread returns. PostThreadMessage: the news release