Windows system message Overview

Source: Internet
Author: User

[IT168 programming and development]A message is a notification sent by Windows to tell the application that something has happened. For example, if you click the mouse, change the window size, or press a key on the keyboard, Windows will send a message to the application. The message itself is passed to the application as a record, which contains the Message Type and other information. For example, for a message generated by clicking the mouse, this record contains the coordinates of the mouse. This record type is called TMsg,
  
It is declared in a Windows unit as follows:
Type
TMsg = packed record
Hwnd: HWND; // window handle
Message: UINT; // message constant identifier
WParam: WPARAM; // additional information of a 32-bit message
LParam: LPARAM; // additional information of a 32-bit message
Time: DWORD; // the time when the message was created.
Pt: TPoint; // The cursor position when the message is created
End;
  
  What are messages?

Do you think the information in a message record is the same as that in Greek? If so, let's take a look at the following explanation:
Hwnd 32-bit window handle. Windows can be any type of screen objects, because Win32 can maintain the handles of most visual objects (Windows, dialog boxes, buttons, edit boxes, etc ).
Message is used to distinguish the constant values of other messages. These constants can be pre-defined constants in Windows units or custom constants.
WParam is a message-related constant value, or a handle to a window or control.
LParam is usually a pointer to data in the memory. Because w p a r a m, l P a r a m, and P o I n t e r are both 3 and 2 bits,
Therefore, they can be converted to each other.
WM_NULL =$ 0000;
WM_CREATE =$ 0001;
Application creation window
WM_DESTROY =$ 0002;
A window is destroyed.
WM_MOVE =$ 0003;
Move a window
WM_SIZE =$ 0005;
Change the size of a window
WM_ACTIVATE =$ 0006;
A window is activated or inactive;
WM_SETFOCUS =$ 0007;
After getting focus
WM_KILLFOCUS = $0008;
No focus
WM_ENABLE = $ 000A;
Enable status change
WM_SETREDRAW = $ 000B;
Set whether the window can be re-painted
WM_SETTEXT = $ 000C;
The application sends this message to set the text of a window.
WM_GETTEXT = $ 000D;
The application sends this message to copy the text of the corresponding window to the buffer zone.
WM_GETTEXTLENGTH = $ 000E;
Get the length of text related to a window (excluding empty characters)
WM_PAINT = $ 000F;
Require a window to redraw itself
WM_CLOSE = $0010;
Send a signal when a window or application is closed
WM_QUERYENDSESSION = $0011;
When the user selects the end dialog box or the program calls the ExitWindows Function
WM_QUIT =$ 0012;
Used to end the program running or when the program calls the postquitmessage Function
WM_QUERYOPEN =$ 0013;
Send the message to an icon when the user window restores the previous size position.
WM_ERASEBKGND =$ 0014;
When the window background must be erased (for example, when the window size changes)
WM_SYSCOLORCHANGE = $0015;
When the system color changes, send this message to all top-level windows.
WM_ENDSESSION =$ 0016;
After the system process sends the WM_QUERYENDSESSION message, the message is sent to the application,
Indicates whether the conversation ends.
WM_SYSTEMERROR = $0017;
WM_SHOWWINDOW =$ 0018;

This message is sent to the hidden or displayed window.
WM_ACTIVATEAPP = $ 001C;
Which window of the application is activated and which is not activated;
WM_FONTCHANGE = $ 001D;
This message is sent to all top-level windows when the font resource library of the system changes
WM_TIMECHANGE = $ 001E;
Send this message to all top-level windows when the system time changes
WM_CANCELMODE = $ 001F;
Send this message to cancel an ongoing touch (Operation)
WM_SETCURSOR =$ 0020;
If the mouse causes the cursor to move in a window and the mouse input is not captured, a message is sent to a window.
WM_MOUSEACTIVATE =$ 0021;
When the cursor is in an inactive window and the user is pressing a key of the mouse to send this message to the current window
WM_CHILDACTIVATE = $0022;
Send this message to the MDI subwindow. When the user clicks the title bar of this window, or the window is activated, move and change the size.
WM_QUEUESYNC =$ 0023;
This message is sent by a computer-based training program through the WH_JOURNALPALYBACK hook Program
Separates user input messages
WM_GETMINMAXINFO =$ 0024;
This message is sent to the window when it is about to change the size or position;
WM_PAINTICON = $0026;
Send to minimize window when its icon is to be repainted
WM_ICONERASEBKGND = $0027;
This message is sent to a minimal window, only when its background must be re-painted before the icon is painted.
WM_NEXTDLGCTL = $0028;
Send this message to a dialog box program to change the focus position
WM_SPOOLERSTATUS = $ 002A;
This message is sent whenever a job is added or removed in the print management queue.
WM_DRAWITEM = $ 002B;
Send a message when the visual appearance of button, combobox, listbox, and menu changes
This message is sent to the owner of these empty parts.
WM_MEASUREITEM = $ 002C;
When a button, combo box, list box, list view control, or menu item is created
Send this message to the control owner
WM_DELETEITEM = $ 002D;
When the list box or combo box is destroyed or some items are deleted, messages are sent through LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT.
WM_VKEYTOITEM = $ 002E;
This message has an LBS_WANTKEYBOARDINPUT style sent to its owner to respond to the WM_KEYDOWN message.
WM_CHARTOITEM = $ 002F;
This message is sent to its owner by a list box in the LBS_WANTKEYBOARDINPUT style to respond to the WM_CHAR message.
WM_SETFONT =$ 0030;
When drawing text, the program sends this message to obtain the color used by the control.
WM_GETFONT =$ 0031;
The application sends this message to obtain the font of the text drawn by the current control.
WM_SETHOTKEY =$ 0032;
The application sends this message to connect a window to a hotkey.
WM_GETHOTKEY =$ 0033;
The application sends this message to determine whether the hotkey is associated with a window.
WM_QUERYDRAGICON =$ 0037;
This message is sent to the minimal window. When the window is to be dragged and its class does not have a defined icon, the application can return an icon or a cursor handle, this icon or cursor is displayed when you drag and drop an icon.
Wm_compareitem =$ 0039;
Send this message to determine the relative position of the newly added items in ComboBox or ListBox
Wm_getobject = $ 003d;
Wm_compacting =$ 0041;
The Display memory is very small.
Wm_windowposchanging = $0046;
When the size and position of the window to which the message is sent are about to be changed, call the setwindowpos function or other window management functions.
Wm_windowposchanged = $0047;
When the size and position of the window to which the message is sent have been changed, call the setwindowpos function or other window management functions.
Wm_power = $0048; (applicable to 16-bit Windows)
This message is sent when the system is about to suspend
Wm_copydata = $ 004a;
This message is sent when an application transmits data to another application.
Wm_canceljournal = $ 004b;
When a user cancels the activation status of the program log, submit the message to the program
Wm_notify = $ 004e;
When an event of a control has occurred or the control needs to obtain some information, send the message to its parent window.
Wm_inputlangchangerequest = $0050;
When the user selects an input language or the hotkey of the input language changes
Wm_inputlangchange = $0051;
Send this message to the affected top-level window when the platform site has been changed
Wm_tcard =$ 0052;
This message is sent to the application when the program has initialized the Windows Help routine.
Wm_help = $0053;
This message indicates that the user presses F1. If a menu is activated, the user sends the message to the menu associated with this window. Otherwise
Send to a window with focus. If there is no focus at present, send the message to the current active window.
Wm_userchanged =$ 0054;
After a user has logged on or exited, the system sends this message to all windows. When the user logs on or exits, the system updates the user's details.
Setting information. The system sends the message immediately when the user updates the setting;
Wm_policyformat = $0055;
Public controls, custom controls, and their parent Windows use this message to determine whether the control uses the ANSI or Unicode Structure
In the wm_notify message, this control enables communication between a control and its parent control.
Wm_contextmenu = $ 007b;
Right-click a user in a window and send the message to this window.
Wm_stylechanging = $ 007c;
This message is sent to the window when the setwindowlong function is called to change the style of one or more windows.
Wm_stylechanged = $ 007d;
This message is sent to the window when one or more window styles of the setwindowlong function are called.
Wm_displaychange = $ 007e;
Send this message to all windows when the resolution of the monitor changes
WM_GETICON = $ 007F;
This message is sent to a window to return the handle of the large icon or small icon associated with a window;
WM_SETICON =$ 0080;
The program sends this message to associate a new large or small icon with a window;
WM_NCCREATE = $0081;
When a window is created for the first time, the message is sent before the WM_CREATE message is sent;
WM_NCDESTROY = $0082;
This message notifies a window that the non-customer zone is being destroyed.
WM_NCCALCSIZE = $0083;
Send this message when the customer region of a window must be calculated
WM_NCHITTEST = $0084; // occurs when you move the mouse, hold down or release the mouse.
WM_NCPAINT =$ 0085;
The program sends this message to a window when its frame (window) must be drawn;
WM_NCACTIVATE =$ 0086;
This message is sent to a window only when its non-customer zone needs to be changed to show whether it is active or not;
WM_GETDLGCODE = $0087;
Send this message to a widget associated with the dialog box program, widdows Control

Http://publish.it168.com/2005/1201/20051201005002.shtml? CChanNel = no & cPositionCode = 50_0

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.