SoFunction
Updated on 2025-04-13

Easy Language Windows Message Collection

WM_NULL = 0;
WM_CREATE = 1;
The application creates a window
WM_DESTROY = 2;
A window was destroyed
WM_MOVE = 3;
Move a window
WM_SIZE = 5;
Change the size of a window
WM_ACTIVATE = 6;
A window is activated or lost its activation state;
WM_SETFOCUS = 7;
After gaining focus
WM_KILLFOCUS = 8;
Losing focus
WM_ENABLE = 10;
Change the enable state
WM_SETREDRAW = 11;
Set whether the window can be re-drawn
WM_SETTEXT = 12;
The application sends this message to set the text of a window
WM_GETTEXT = 13;
The application sends this message to copy the text of the corresponding window to the buffer
WM_GETTEXTLENGTH = 14;
Get the length of text related to a window (excluding empty characters)
WM_PAINT = 15;
Ask a window to repaint yourself
WM_CLOSE = 16;
Send a signal when a window or application is to be closed
WM_QUERYENDSESSION = 17;
When the user selects the End dialog box or the program calls the ExitWindows function itself
WM_QUIT = 18;
Used to end the program running or call the postquitmessage function when the program calls the postquitmessage function
WM_QUERYOPEN = 19;
When the user window restores its previous size position, send this message to an icon
WM_ERASEBKGND = 20;
When the window background must be erased (for example, when the window changes size)
WM_SYSCOLORCHANGE = 21;
Send this message to all top-level windows when the system color changes
WM_ENDSESSION = 22;
When the system process issues a WM_QUERYENDSESSION message, the message is sent to the application.
Notify it whether the conversation ends
WM_SYSTEMERROR = 23;
WM_SHOWWINDOW = 24;
When the hidden or display window is sent this message to this window
WM_ACTIVATEAPP = 28;
Send this message to the application which window is activated and which is non-activated;
WM_FONTCHANGE = 29;
Send this message to all top-level windows when the system's font library changes
WM_TIMECHANGE = 30;
Send this message to all top-level windows when the system's time changes
WM_CANCELMODE = 31;
Send this message to cancel some ongoing touch (operation)
WM_SETCURSOR = 32;
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 = 33;
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 = 34;
Send this message to the MDI child window when the user clicks the title bar of this window, or when the window is activated, moves, and changes the size
WM_QUEUESYNC = 35;
This message is sent by a computer-based training program through the hook program of WH_JOURNALPALYBACK
Separate user input messages
WM_GETMINMAXINFO = 36;
This message is sent to the window when it is about to change the size or position;
WM_PAINTICON = 38;
Send to the minimization window when its icon will be repainted
WM_ICONERASEBKGND = 39;
This message is sent to a minimization window only if it has its background to be repainted before drawing the icon
WM_NEXTDLGCTL = 40;
Send this message to a dialog program to change the focus position
WM_SPOOLERSTATUS = 42;
This message is emitted whenever a print management queue increases or decreases one job
WM_DRAWITEM = 43;
Send when the visual appearance of button, combobox, listbox, menu changes
This message is given to the owner of these empty files
WM_MEASUREITEM = 44;
When button, combo box, list box, list view control, or menu item is created
Send this message to the owner of the control
WM_DELETEITEM = 45;
When the list box or combo box is destroyed or when some items are deleted through LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT messages
WM_VKEYTOITEM = 46;
This message has an LBS_WANTKEYBOARDINPUT style issuing to its owner in response to the WM_KEYDOWN message
WM_CHARTOITEM = 47;
This message is sent to his owner by an LBS_WANTKEYBOARDINPUT style list box in response to the WM_CHAR message
WM_SETFONT = 48;
When drawing text, the program sends this message to get the color to use for the control
WM_GETFONT = 49;
The application sends this message to get the font of the current control drawing text
WM_SETHOTKEY = 50;
The application sends this message to connect a window to a hotkey
WM_GETHOTKEY = 51;
The application sends this message to determine whether the hotkey is associated with a window
WM_QUERYDRAGICON = 55;
This message is sent to the minimization window. When this window is to be dragged and dropped without an icon in its class, the application can return an icon or cursor handle. When the user drags and drops the icon, the system displays the icon or cursor.
WM_COMPAREITEM = 57;
Send this message to determine the relative position of newly added items to combobox or listbox
WM_GETOBJECT = 61;
WM_COMPACTING = 65;
There is very little display memory
WM_WINDOWPOSCHANGING = 70;
When the size and position of the window are to be changed, call the setwindowpos function or other window management function.
WM_WINDOWPOSCHANGED = 71;
Send this message to the window size and position that has changed, call the setwindowpos function or other window management function.
WM_POWER = 72; (Applicable to 16-bit windows)
Send this message when the system is about to enter a pause state
WM_COPYDATA = 74;
Send this message when one application passes data to another application
WM_CANCELJOURNAL = 75;
When a user cancels the program log activation status, submit this message to the program
WM_NOTIFY = 78;
When an event of a control has occurred or the control needs to get some information, send this message to its parent window
WM_INPUTLANGCHANGEREQUEST = 80;
When the user selects a certain input language, or the hotkey of the input language changes
WM_INPUTLANGCHANGE = 81;
Send this message to the affected top window when the platform site has been changed
WM_TCARD = 82;
Send this message to the application when the program has initialized the windows help routine
WM_HELP = 83;
This message shows that the user pressed F1. If a menu is activated, send this message to the menu associated with this window, otherwise
Send to a window with focus. If there is no focus at present, send this message to the currently activated window.
WM_USERCHANGED = 84;
Send this message to all windows when the user has logged in or logged out. When the user logs in or logs out, the system updates the user's specific details
Setting information, the system sends this message immediately when the user updates the settings;
WM_NOTIFYFORMAT = 85;
Public controls, custom controls and their parent windows use this message to determine whether the control uses ANSI or UNICODE structure.
In the WM_NOTIFY message, using this control enables a control to communicate with its parent control.
WM_CONTEXTMENU = 123;
When the user clicks a right click in a window, the message will be sent to this window
WM_STYLECHANGING = 124;
Send this message to the window when the SETWINDOWLONG function is called to change the style of one or more windows
WM_STYLECHANGED = 125;
Send this message to the window after calling the SETWINDOWLONG function
WM_DISPLAYCHANGE = 126;
Send this message to all windows after the resolution of the display changes
WM_GETICON = 127;
This message is sent to a window to return a handle to a large or small icon associated with a window;
WM_SETICON = 128;
The program sends this message to associate a new large or small icon with a window;
WM_NCCREATE = 129;
When a window is created for the first time, this message is sent before the WM_CREATE message is sent;
WM_NCDESTROY = 130;
This message notifies a window that the non-client area is being destroyed
WM_NCCALCSIZE = 131;
Send this message when the client area of ​​a certain window must be accounted for
WM_NCHITTEST = 132;//Occurs when moving the mouse, holding or releasing the mouse
WM_NCPAINT = 133;
The program sends this message to a window when its (window) frame must be drawn;
WM_NCACTIVATE = 134;
This message is sent to a window only if its non-client area needs to be changed to show whether it is activated or inactive;
WM_GETDLGCODE = 135;
Send this message to a control associated with the dialog program, the Widdows control azimuth key and the TAB key make the input enter this control
By responding to the WM_GETDLGCODE message, the application can treat it as a special input control and can handle it
WM_NCMOUSEMOVE = 160;
Send this message to this window when the cursor moves in a non-client area of ​​a window //The non-client area is: the title bar and window of the form
The border body
WM_NCLBUTTONDOWN = 161;
Submit this message when the cursor presses the left mouse button simultaneously in a non-client area of ​​a window
WM_NCLBUTTONUP = 162;
When the user releases the left mouse button, the cursor is used to send this message in the non-client area ten;
WM_NCLBUTTONDBLCLK = 163;
When the user double-clicks the left mouse button, he cursors a window and sends this message in non-customer area ten
WM_NCRBUTTONDOWN = 164;
Send this message when the user presses the right mouse button and the cursor is in the non-client area of ​​the window.
WM_NCRBUTTONUP = 165;
Send this message when the user releases the right mouse button and the cursor is in the non-client area of ​​the window.
WM_NCRBUTTONDBLCLK = 166;
When the user double-clicks the mouse and right-clicks, he cursors a window and sends this message in non-customer area ten.
WM_NCMBUTTONDOWN = 167;
Send this message when the user presses the middle mouse button and the cursor is in the non-client area of ​​the window.
WM_NCMBUTTONUP = 168;
Send this message when the user releases the middle mouse button and the cursor is in the non-client area of ​​the window.
WM_NCMBUTTONDBLCLK = 169;
Send this message when the user double-clicks the middle mouse button and the cursor is in the non-client area of ​​the window.
WM_KEYFIRST = 256;
WM_KEYDOWN = 256;
//Press a key
WM_KEYUP = 257;
//Release a key
WM_CHAR = 258;
//Press a key and the WM_KEYDOWN, WM_KEYUP message has been sent
WM_DEADCHAR = 259;
Send this message to the window with focus when translating the WM_KEYUP message using the translatemessage function
WM_SYSKEYDOWN = 260;
Submit this message to the window with focus when the user presses the ALT key while pressing other keys;
WM_SYSKEYUP = 261;
Submit this message to the window with focus when the user releases a key while the ALT key is still pressed
WM_SYSCHAR = 262;
When the WM_SYSKEYDOWN message is translated by the TRANSLATEMESSAGE function, the message is submitted to the window with focus.
WM_SYSDEADCHAR = 263;
When the WM_SYSKEYDOWN message is translated by the TRANSLATEMESSAGE function, the message is sent to the window with focus.
WM_KEYLAST = 264;
WM_INITDIALOG = 272;
Send this message to a dialog program before it is displayed, usually using this message to initialize the control and perform other tasks.
WM_COMMAND = 273;
When the user selects a menu command item or when a control sends a message to its parent window, a shortcut key is translated
WM_SYSCOMMAND = 274;
This message will be received when the user selects a command from the window menu or when the user selects Maximize or Minimize that window will receive this message when the user selects Maximize or Minimize
WM_TIMER = 275; // A timer event occurred
WM_HSCROLL = 276;
When a window's standard horizontal scroll bar generates a scroll event, this message is sent to that window, and also to the control that owns it
WM_VSCROLL = 277;
Send this message to the window when a window's standard vertical scroll bar generates a scroll event, and sends this message to the window, and sends it to the control that owns it WM_INITMENU = 278;
This message is sent when a menu is about to be activated, it occurs in an item in the user menu bar or presses a menu key, which allows the program to change the menu before it is displayed
WM_INITMENUPOPUP = 279;
This message is sent when a drop-down menu or submenu is about to be activated, it allows the program to change the menu before it appears, without changing all
WM_MENUSELECT = 287;
Send this message to the owner of the menu when the user selects a menu item (usually a window)
WM_MENUCHAR = 288;
When the menu has been activated, the user presses a key (different from the acceleration key), send this message to the owner of the menu;
WM_ENTERIDLE = 289;
When a modal dialog or menu enters an empty state, sending this message to its owner. A modal dialog or menu enters an empty state means waiting in the queue without a message after processing one or several previous messages.
WM_MENURBUTTONUP = 290;
WM_MENUDRAG = 291;
WM_MENUGETOBJECT = 292;
WM_UNINITMENUPOPUP = 293;
WM_MENUCOMMAND = 294;
WM_CHANGEUISTATE = 295;
WM_UPDATEUISTATE = 296;
WM_QUERYUISTATE = 297;
WM_CTLCOLORMSGBOX = 306;
Send this message to the owner window of the message box before drawing the message box. By responding to this message, the owner window can set the text and background color of the message box by using the handle of the given related display device.
WM_CTLCOLOREDIT = 307;
When an edit control is about to be drawn, this message is sent to its parent window; in response to this message, the owner window can set the text and background color of the edit box by using the handle of the given related display device.
WM_CTLCOLORLISTBOX = 308;
When a list box control is about to be drawn, send this message to its parent window; in response to this message, the owner window can set the text and background color of the list box by using the handle of the given related display device.
WM_CTLCOLORBTN = 309;
When a button control is about to be drawn, this message is sent to its parent window; in response to this message, the owner window can set the text and background color of the button by using the handle of the given related display device.
WM_CTLCOLORDLG = 310;
When a dialog control is about to be drawn, send this message to its parent window; in response to this message, the owner window can set the text background color of the dialog box by using the handle of the given related display device.
WM_CTLCOLORSCROLLBAR= 311;
When a scrollbar control is about to be drawn, this message is sent to its parent window; in response to this message, the owner window can set the background color of the scrollbar by using the handle of the given related display device.
WM_CTLCOLORSTATIC = 312;
When a static control is about to be drawn, this message is sent to its parent window; in response to this message, the owner window can set the text and background color of the static control by using the handle of the given related display device.
WM_MOUSEFIRST = 512;
WM_MOUSEMOVE = 512;
// Move the mouse
WM_LBUTTONDOWN = 513;
//Press the left mouse button
WM_LBUTTONUP = 514;
//Release the left mouse button
WM_LBUTTONDBLCLK = 515;
//Double-click the left mouse button
WM_RBUTTONDOWN = 516;
//Press the right mouse button
WM_RBUTTONUP = 517;
//Release the right mouse button
WM_RBUTTONDBLCLK = 518;
//Double-click the right mouse button
WM_MBUTTONDOWN = 519;
//Press the middle mouse button
WM_MBUTTONUP = 520;
//Release the middle mouse button
WM_MBUTTONDBLCLK = 521;
//Double-click the middle mouse button
WM_MOUSEWHEEL = 522;
Send this message when the mouse wheel rotates. The currently focused control
WM_MOUSELAST = 522;
WM_PARENTNOTIFY = 528;
Send this message to its parent window when the MDI child window is created or destroyed, or the user presses the mouse button and the cursor is on the child window
WM_ENTERMENULOOP = 529;
Send this message to notify the application's main window that has entered menu loop mode
WM_EXITMENULOOP = 530;
Send this message to notify the application's main window that has exited menu loop mode
WM_NEXTMENU = 531;
WM_SIZING = 532;
Send this message to the window when the user is resizing the window; through this message application, you can monitor the window size and position and modify them
WM_CAPTURECHANGED = 533;
Send this message to the window when it loses the captured mouse;
WM_MOVING = 534;
When users send this message when moving a window, through this message application, they can monitor the window size and location and modify them;
WM_POWERBROADCAST = 536;
This message is sent to the application to notify it of power management events;
WM_DEVICECHANGE = 537;
Send this message to the application or device driver when the device's hardware configuration changes
WM_IME_STARTCOMPOSITION = 269;
WM_IME_ENDCOMPOSITION = 270;
WM_IME_COMPOSITION = 271;
WM_IME_KEYLAST = 271;
WM_IME_SETCONTEXT = 641;
WM_IME_NOTIFY = 642;
WM_IME_CONTROL = 643;
WM_IME_COMPOSITIONFULL = 644;
WM_IME_SELECT = 645;
WM_IME_CHAR = 646;
WM_IME_REQUEST = 648;
WM_IME_KEYDOWN = 656;
WM_IME_KEYUP = 657;
WM_MDICREATE = 544;
The application sends this message to the multi-document client window to create an MDI child window
WM_MDIDESTROY = 545;
The application sends this message to a multi-document client window to close an MDI child window
WM_MDIACTIVATE = 546;
The application sends this message to the multi-documented client window notifies the client window to activate another MDI subwindow. When the client window receives this message, it sends a WM_MDIACTIVE message to the MDI subwindow (not activated) to activate it;
WM_MDIRESTORE = 547;
Program Send this message to the MDI client window to restore the child window from maximum to original size
WM_MDINEXT = 548;
Program Send this message to the MDI client window to activate the next or previous window
WM_MDIMAXIMIZE = 549;
The program sends this message to the MDI client window to maximize a MDI subwindow;
WM_MDITILE = 550;
Program Send this message to the MDI client window to rearrange all MDI subwindows in a tile manner
WM_MDICASCADE = 551;
Program Send this message to the MDI client window rearrange all MDI subwindows in a cascaded manner
WM_MDIICONARRANGE = 552;
Program Send this message to the MDI client window Rearrange all minimized MDI subwindows
WM_MDIGETACTIVE = 553;
Program Send this message to the MDI client window to find the handle of the activated child window
WM_MDISETMENU = 560;
Program Send this message to the MDI client window Use the MDI menu instead of the subwindow menu
WM_ENTERSIZEMOVE = 561;
WM_EXITSIZEMOVE = 562;
WM_DROPFILES = 563;
WM_MDIREFRESHMENU = 564;
WM_MOUSEHOVER = 673;
WM_MOUSELEAVE = 675;
WM_CUT = 768;
The program sends this message to an edit box or combobox to delete the currently selected text
WM_COPY = 769;
The program sends this message to an edit box or combobox to copy the currently selected text to the clipboard
WM_PASTE = 770;
The program sends this message to editcontrol or combobox to get data from the clipboard
WM_CLEAR = 771;
The program sends this message to editcontrol or combobox to clear the currently selected content;
WM_UNDO = 772;
The program sends this message to editcontrol or combobox to undo the last operation
WM_RENDERFORMAT = 773;
WM_DESTROYCLIPBOARD = 775;
When the ENPTYCLIPBOARD function is called, this message is sent to the owner of the clipboard
WM_DRAWCLIPBOARD = 776;
Send this message to the first window of the clipboard observation chain when the content of the clipboard changes; it allows the clipboard observation window to be used to
Show new content on the clipboard;
WM_PAINTCLIPBOARD = 777;
When the clipboard contains data in CF_OWNERDIPLAY format and the client area of ​​the clipboard observation window needs to be repainted;
WM_VSCROLLCLIPBOARD = 778;
WM_SIZECLIPBOARD = 779;
When the clipboard contains data in CF_OWNERDIPLAY format and the size of the client area of ​​the clipboard observation window has changed, this message is sent to the owner of the clipboard through the clipboard observation window;
WM_ASKCBFORMATNAME = 780;
Send this message to the owner of the clipboard through the clipboard viewing window to request the name of a clipboard in CF_OWNERDISPLAY format
WM_CHANGECBCHAIN = 781;
Send this message to the first window of the clipboard observation chain when a window is removed from the clipboard observation chain;
WM_HSCROLLCLIPBOARD = 782;
This message is sent to the owner of the clipboard through a clipboard observation window; it occurs when the clipboard contains data in CFOWNERDISPALY format and there is an event on the horizontal scrollbar of the clipboard observation window; the owner should scroll the clipboard image and update the scrollbar value;
WM_QUERYNEWPALETTE = 783;
This message is sent to the window that will receive the focus, which gives the window the opportunity to implement its logical palette when it receives the focus.
WM_PALETTEISCHANGING= 784;
Send this message to notify all applications when an application is about to implement its logical palette
WM_PALETTECHANGED = 785;
This message changes the system palette after implementing its logical palette with focus.
WM_HOTKEY = 786;
Submit this message when the user presses a hotkey registered by the REGISTERHOTKEY function
WM_PRINT = 791;
The application sends this message only if WINDOWS or other application issues a request to draw a portion of an application;
WM_PRINTCLIENT = 792;
WM_HANDHELDFIRST = 856;
WM_HANDHELDLAST = 863;
WM_PENWINFIRST = 896;
WM_PENWINLAST = 911;
WM_COALESCE_FIRST = 912;
WM_COALESCE_LAST = 927;
WM_DDE_FIRST = 992;
WM_DDE_INITIATE = WM_DDE_FIRST + 0;
A DDE client submits this message to start a session with the server program in response to the specified program and topic name;
WM_DDE_TERMINATE = WM_DDE_FIRST + 1;
A DDE application (whether it is a client or a server) submits this message to terminate a session;
WM_DDE_ADVISE = WM_DDE_FIRST + 2;
A DDE client submits this message to a DDE service program to request the server to update it whenever the data item changes.
WM_DDE_UNADVISE = WM_DDE_FIRST + 3;
A DDE client notifies a DDE service program that does not update the specified item or a special clipboard format item through this message.
WM_DDE_ACK = WM_DDE_FIRST + 4;
This message informs a DDE (Dynamic Data Exchange) program that has received and is processing WM_DDE_POKE, WM_DDE_EXECUTE, WM_DDE_DATA, WM_DDE_ADVISE, WM_DDE_UNADVISE, or WM_DDE_INITIAT messages
WM_DDE_DATA = WM_DDE_FIRST + 5;
A DDE service program submits this message to the DDE client program to pass a data item to or to a available data item to the client.
WM_DDE_REQUEST = WM_DDE_FIRST + 6;
A DDE client submits this message to a DDE service program to request the value of a data item;
WM_DDE_POKE = WM_DDE_FIRST + 7;
A DDE client submits this message to a DDE service program, and the client uses this message to request the server to receive an unconsensual data item; the server prompts whether it receives this data item by replying to the WM_DDE_ACK message;
WM_DDE_EXECUTE = WM_DDE_FIRST + 8;
A DDE client submits this message to a DDE service program to send a string to the server to make it processed like a serial command, and the server responds by submitting a WM_DDE_ACK message;
WM_DDE_LAST = WM_DDE_FIRST + 8;
WM_APP = 32768;
WM_USER = 1024;
This message helps the application customize private messages;