The message means a notification issued by Windows to tell the application a matter. For example, click the mouse, change the window size, press a key on the keyboard to send Windows to your application. The message itself is passed to the application as a record, and this record contains the type of message and other information. For example, for messages generated by clicking on the mouse, this record contains the coordinates when clicking the mouse. This record type is called TMSG, (I reposted)
It is this declared in the Windows unit: typeTMSG = Packed RecordhWnd: hwnd; / / window handle Message: uint; / / message constant identifier WPARAM: WPARAM; // 32-bit message Specific additional information LParam: lparam; // 32-bit message Specific additional information Time: DWORD; / / message creation time PT: tpoint; / / message is created in the mouse position END;
What is there in the news? Do you feel that the information in a message record is like Greek? If this is the case, then take a look at the explanation below: HWND 32-bit window handle. The window can be any type of screen object because Win32 is able to maintain the handle of most visual objects (windows, dialogs, buttons, edit boxes, etc.). Message is used to distinguish constant values for other messages, which may be predefined in the Windows unit, or they can be custom constants. WPARAM is usually a constant value related to messages or a handle of a window or control. LPARAM is usually a pointer to data in memory. Since W p A r a m, L P A R A M and P O i N t E r are 3 2 bits, so they can be converted between them.
The use of the message in the MFC. The message corresponding to the message is declared. For custom messages, you can do the #define WM_USER_MESSAGE WM_USER 100CLASER_MESSAGE WM_USER 100CLASS response message The response message set by the response message AFX_MSG Void ONLBUTTONDOWN (uint bflags, CPOIT POINT); / / Respond to custom message AFX_MSG LRESULT ONUSERMESSAGE (WPARAM WPARAM, LPARAM LPARAM); DECLARE_MESSAGE_MAP ()} ;. CPP This declares Begin_Message_Map (the class class, this class base class) // system has defined OnLButtonDown response message corresponding to the function ON_WM_LBUTTON () // create a custom message and custom functions corresponding ON_MESSAGE (WM_USER_MESSAGE, OnUserMessage) END_MESSAGE_MAP () implemented afx_msg void response message classes :: OnLButtonDown (UINT bFlags, CPoit point) {} // response defined message afx_msg LRESULT response message classes :: OnUserMessage (WPARAM wParam, LPARAM lParam) {} WM_NULL = $ 0000; WM_CREATE = $ 0001; application creates a window WM_DESTROY = $ 0002; a window is destroyed WM_MOVE = $ 0,003; moving a window WM_SIZE = $ 0005; change a window size WM_ACTIVATE = $ 0006; a window is activated or lose an active state; WM_SETFOCUS = $ 0007; after obtaining the focus WM_KILLFOCUS = $ 0008; loses focus WM_ENABLE = $ 000A; change enable state WM_SETREDRAW = $ 000B; Settings the window to redraw WM_SETTEXT = $ 000c; the application sends this message to set the text WM_GETTEXT = $ 000D for a window; the application sends this message to copy the text to the buffer wm_gettextLength = $ 000E; get The length of text related to a window (not including empty characters) wm_paint = $ 000f; ask a window to call yourself WM_Close = 0010; when a window Or when the application is to close, send a signal wm_queryndSession = $ 0011; when the user selects the end dialog or the program you call the exitwindows function wm_quit = $ 0012; used to end the program run or when the program calls postquitMessage function WM_QUERYOPEN = $ 0013; when the user window recovered When the size is positioned, send this message to an icon WM_ERASEBKGND = $ 0014; when the window background must be erased (the window changes the size) WM_SYSCOLORCHANGE = $ 0015; When the system color changes, this message is sent to all top window WM_ENDSession = $ 0016; After the system process issues a WM_QueryEndSession message, this message is sent to the application, notifying it to end if the conversation ends WM_SYSTEMERROR = $ 0017; WM_SHOWINDOW = $ 0018; when the hidden or display window is sent to this message to this message to this message WM_ACTIVATEAPP = $ 001c; send this Message Which window gives the application which window is activated, which is unmatched; wm_fontchange = $ 001d; send this message when the system's font resource library changes, this message is sent to all top windows WM_TIMECHANGE = $ 001E; send this message when the system changes All top windows wm_cancelmode = $ 001f;
Send this message to cancel some of the ongoing touch state (operation) WM_SETCURSOR = $ 0020; if the mouse causes the cursor to move in a window and when the mouse input is not captured, send a message to a window WM_MouseActivate = $ 0021; when the cursor is in the cursor In a non-active window, the user is in pressing a key in the mouse to send this message to the current window wm_childactivate = 0022; send this message to the MDI child window When the user clicks on this window, or when the window is activated, move , Change the size of WM_QUEESYNC = $ 0023; This message is sent by the computer-based training program, separating the user input message WM_GETMAXINFO = $ 0024 via the WH_Journalpalyback hook program; this message is sent to the window When it will change the size or position; WM_PaintICON = $ 0026; send it to Minimize window When it is an icon, it will be edited by WM_ICONERaseBKGND = $ 0027; this message is sent to a minimization window, only when it is drawing the icon, its background must be saved WM_NEXTDLGCTL = $ 0028; send this message to a dialog program Go to change the focus position WM_SPOOLERSTATUS = $ 002A; Whenever the print management column is added or decreases this message WM_DRAWITEM = $ 002B; when Button, ComboBox, Listbox, Menu's visual appearance changes to these empty parts Owner WM_MEASUREITEM = $ 002c; When the button, Combo Box, List Box, List View Control, or Menu Item is created, send this message to the owner wm_deleteItem = $ 002d; when the list box or Combo Box is destroyed or some items are deleted by LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT news WM_VKEYTOITEM = $ 002E; this message is sent to a LBS_WANTKEYBOARDINPUT style of its owner in response to WM_KEYDOWN message WM_CHARTOITEM = $ 002F; this message consists of a list of style LBS_WANTKEYBOARDINPUT The box sent to his owner to respond to WM_CHAR messages WM_SETFONT = $ 0030; when drawing text, the program sends this elimination Receive the color wm_getfont = $ 0031; the application sends this message to get the current control to draw the text. Fonts WM_SETHOTKEY = $ 0032; the application sends this message so that one window is related to a hotkey WM_GETHOTKEY = $ 0033; application sends this message To determine if the hotkey is associated with the associated wm_querydragicon = $ 0037; this message is sent to the minimization window, when this window will be dragged and dropped, the application can return an icon or cursor handle, When the user drags and drop icons, the system displays this icon or cursor wm_compareItem = $ 0039; send this message to determine the relative position of ComboBox or ListBox added items wm_getObject = $ 003d; wm_compacting = $ 0041; Show memory has rare WM_WINDOWPOSCHANGING = $ 0046; Send this message to the size and location of the window will be changed to call the SETWINDOWPOS function or other window management function wm_windowposchanged = 0047; send this message to the SetWindowPos function or other window when the size and location of the window have been changed. Manage function wm_power = $ 0048;
Windows suitable for 16-bit "When the system will send this message when the system will send this message WM_COPYDATA = $ 004A; send this message when an application is delivered to another application WM_CANCELJournall = $ 004B; when a user cancels log activation Status, submit this message to the program WM_NOTIFY = $ 004E; send this message to its parent window WM_INPUTLANGCHANGEREQUEST = $ 0050 when a control has occurred or this control needs to get some information; when the user selects some input language , Or the hotkey of the language changes WM_INPUTLANGCHANGE = $ 0051; when the platform has been changed to send this message to the affected top window WM_TCARD = $ 0052; send this message when the program has initialized the Windows Help routine to send this message to the application WM_HELP = $ 0053; This message shows that the user presses F1. If a menu is activated, send this message and this message is associated with the menu, otherwise send a window with focus, if there is no focus, you will send this message Give the currently activated window WM_UserChanged = $ 0054; send this message to all the windows when the user has logged in or exits, when the user logs in or exits, the system updates the user's specific setup information, the system immediately sends this message when the user update setting; WM_NotifyFormat = 0055; Public control, custom control, and their parent window to determine that the control is using ansi or the Unicode structure in the WM_NOTIFY message, using this control to communicate with its parent controls WM_CONTEXTMENU = $ 007B; When you click on the right button in a window, send this message to this message to send this message to the window WM_StylechangeD = $ 007D when the calling setWindowlong function will change the style of one or more windows. When the SETWINDOWLONG function is called after the style of one or more windows, this message is sent to that window WM_DISPLAYCHANGE = $ 007E; send this message to all windows when the resolution change changes to all windows; this message is sent to a window Returns a handle of a large icon or a small icon for a window; wm_seticon = 0080; program sends this message to let a new big icon or small icon associate with a window; WM_NCCREATE = $ 0081; when a window is first This message is in WM_CREAT when creating E message send before sending; WM_NCDESTROY = $ 0082; This message notifies a window, the non-client area is destroying WM_NCCALCSIZE = $ 0083; send this message when a window must be accounted to send this message WM_NCHITTEST = $ 0084; // Move the mouse, press When you live or release your mouse, a WM_NCPAINT = $ 0085; the program sends this message to a window When it (window) must be drawn; wm_ncactivate = $ 0086; This message is sent to a window only when its non-customer area needs to be Change to display is activated or inactive; WM_GETDLGCODE = 0087; send this message to a control associated with the dialog program, widdows control orientation key, and Tab keys make input into this control by responding to WM_GETDLGCODE messages, the application can put him When it is a special input control and can handle it WM_ncmouseMove = $ 00A0; send this message when the cursor is in the non-client area of a window to this message to this window // Non-client is: the title bar of the form and the side frame of the window WM_NCLBUTTONDOWN = $ 00A1;
When the cursor is pressed when the cursor is in the non-customer area of one window, this message is submitted to this message WM_nclButtonUp = $ 00A2; when the user releases the left mouse button, the spectrum is sent to the non-client zone ten; wm_nclbuttondblclk = $ 00A3; Users double-click the left mouse button while the cursor is sent this message in the non-client zone 10. WM_NCRBUTTONDOWN = $ 00A4; when the user presses the mouse button, the cursor is sent to the non-client area of the window, WM_NCRBUTTONUP = $ 00A5; when the user releases The right mouse button also sends this message when the cursor is in the non-client district of the window. WM_NCRBUTTONDBLCLK = $ 00A6; when the user doubles the mouse button, the cursor is sent to the non-client zone 10 Send this message wm_ncmbuttondown = $ 00A7; At the same time, the cursor is sent to this message when the cursor is in the non-client district of the window. WM_NCMBUTTONUP = $ 00A8; when the user releases the mouse button, the cursor is sent this message when the cursor is in the non-client district of the window, the message is sent to the window WM_NCMBUTTONDBLCLK = $ 00A9; when the user doubles the mouse button simultaneously This message is sent again when the window is non-customer district
WM_KEYFIRST = $ 0100; WM_KEYDOWN = $ 0100; // press a key WM_KEYUP = $ 0101; // releasing a key WM_CHAR = $ 0102; // a key is pressed, and has issued WM_KEYDOWN, WM_KEYUP message WM_DEADCHAR = $ 0103; a translator with translatemessage function When the WM_Keyup message, this message is sent to the window WM_SYSKEYDOWN = $ 0104; when the user presses the Alt button, submit this message to the window with the focus; wm_syskeyup = $ 0105; When the user releases a button while the Alt button is also pressed submit a message to the window WM_SYSCHAR has focus = $ 0106; submitted message to the window WM_SYSDEADCHAR has focus = $ 0107 when WM_SYSKEYDOWN message after being TRANSLATEMESSAGE function translated; sends the message to the window that has the focus when WM_SYSKEYDOWN message after being TRANSLATEMESSAGE function translation WM_KEYLAST = $ 0108; WM_INITDIALOG = $ 0110; send this message before a dialog program is displayed to it, usually use this message to initialize the control and perform other tasks WM_COMMAND = $ 0111; when the user selects a menu command item or when a control sends a control The message gives it a parent window, a shortcut is translated wm_sysCommand = $ 012; when the user selects a command to the window menu or when the user selects maximizes or minimizes the message, the message will receive this message WM_TIMER = $ 0113; // Time Event WM_HSCROLL = $ 0114; When a window standard horizontal scroll bar generates a scrolling event to send this message to that window, also sent to the control WM_VSCROLL = $ 0115 with it; when a window standard vertical scroll bar generates a scroll event to send this The message is also sent to the window, which is sent to the control WM_INITMENU = $ 0116; when a menu will be activated, it will send this message in the user menu bar or press a menu button, which allows the program to display Before changing menu WM_INITMENUPOPUP = $ 0117; when a drop-down menu or submenu will be activated, it will send this message, which allows the program to change the menu before it, do not change all WM_Menuseelect = $ 011f; send this when the user selects a menu item The owner of the message to the menu (usually window) WM_MenuChar = $ 0120; When the menu has been activated by the user (different from the acceleration key), send this message to the owner of the menu; WM_EnterIdle = $ 0121; send this message when a modal dialog or menu enters an empty state Owner, a modal dialog or menu enters the no-load status is to wait for a queue after the previous or few previous messages waiting for WM_MenurButtonup = $ 0122; wm_menudrag = $ 0123; wm_merougetObject = $ 0124; wm_uninitmenupopup = $ 0125; WM_MENUCOMMAND = $ 0126; WM_CHANGEUISTATE = $ 0127; WM_UPDATEUISTATE = $ 0128; WM_QUERYUISTATE = $ 0129; WM_CTLCOLORMSGBOX = $ 0132; this message is sent before the windows drawn message box to the owner window message frame, in response to this message, the owner window by using a The handle of the relevant display device to set the text and background color wm_ctlcoloredit = $ 0133; when an edit control will be drawn, this message is sent to its parent window;
By responding to this message, the owner window can set the text and background color WM_CTLCOLORLISTBOX = $ 0134 by using the given related display device; when a list box control will be drawn to the parent window to send this message By responding to this message, the owner window can set the text and background color WM_CTLCOLORBTN = $ 0135 by using the given related display device; when a button control will be drawn, send this message to the parent window. By responding to this message, the owner window can set the message and background color wm_ctlcolordlg = $ 0136 by using a given related display device; when a dialog control is to be drawn, send this message to its father Window; by responding to this message, the owner window can set the text background color wm_ctlcolorscrollbar = $ 0137 by using a given related display device; when a scroll bar control will be drawn, send this message to its father Window; By responding to this message, the owner window can set the background color WM_CTLCOLORSTATIC = $ 0138 of the scroll bar by using the handle of the given related display device; when a static control will be drawn, send this message to its parent window; By responding to this message, the owner window can set the text and background color wm_mousefirst = $ 0200; wm_mousemove = $ 0200; WM_MOUSEMOVE = $ 0200;
// Move mouse wm_lbuttondown = $ 0201; // Press the left mouse button wm_lbuttonup = $ 0202; // Release the left mouse button WM_LButtondblclk = $ 0203; // Double click the left mouse button WM_RBUTTONDOWN = $ 0204; // Press the right mouse button WM_RBUTTONUP = $ 0205; / / release the right mouse button WM_RBUTTONDBLCLK = $ 0206; // double right mouse button WM_MBUTTONDOWN = $ 0207; // middle mouse button WM_MBUTTONUP = $ 0208; // release the mouse button WM_MBUTTONDBLCLK = $ 0209; // double-click the mouse button WM_MOUSEWHEEL = $ 020A; when When the mouse wheel rotates, the currently focused control WM_MouseLast = $ 020A; WM_ParentNotify = $ 0210; when the MDI sub-window is created or destroyed, or the user presses the mouse button and the cursor will send this message when the cursor is on the sub-window. Its parent window WM_ENTERMENULOOP = $ 0211; Send this message to notify the application's main window That has entered the menu loop mode WM_EXITMENULOOP = $ 0212; send this message to notify the application's main window That has exited menu loop mode WM_NEXTMENU = $ 0213; wm_sizing = 532; When the user is adjusting the window size to the window; you can monitor the window size and position can also modify their wm_capturechanged = 533; send this message to the window when it lost the captured mouse; WM_MOVING = 534 When the user sends this message while the mobile window, you can monitor the window size and location or modify them; WM_PowerBroadcast = 536; this message is sent to the application to notify it about power management events; WM_DEviceChange = 537; transmitting hardware device configuration change message to the application or device driver WM_IME_STARTCOMPOSITION = $ 010D; WM_IME_ENDCOMPOSITION = $ 010E; WM_IME_COMPOSITION = $ 010F; WM_IME_KEYLAST = $ 010F; WM_IME_SETCONTEXT = $ 0281; WM_IME_NOTIFY = $ 0282; WM_IME_CONTROL = $ 028 3; WM_IME_COMPOSITIONFULL = $ 0284; WM_IME_SELECT = $ 0285; WM_IME_CHAR = $ 0286; WM_IME_REQUEST = $ 0288; WM_IME_KEYDOWN = $ 0290; WM_IME_KEYUP = $ 0291; WM_MDICREATE = $ 0220; application sends this message to the client window multiple document to create an MDI child window WM_MDIDESTROY = $ 0221 The application sends this message to the multi-document client window to close a MDI sub-window WM_MDIACTIAACTIAACTIAFATE = $ 0222; the application sends this message to the multi-document client window to inform the customer window to activate another MDI sub-window, when the customer window receives this message After it issues a WM_MDIACTIVE message to the MDI sub-window (not activated) to activate it; WM_MDIRESTORE = 0223; Program Send this message to the MDI Customer window to restore the sub-window to the original size WM_MDINEXT = $ 0224; program Send this message to MDI Customer window activates the next or the previous window WM_MDIMAXIMIZE = $ 0225; the program sends this message to MDI customer window to maximize an MDI sub-window;
WM_MDITILE = $ 0226; Program Send this message to rearrange all MDI sub-window WM_MDICASCADE = $ 0227 to the MDI client window; program sends this message to the MDI client window to rearrange all MDI sub-window WM_MDIICONARRANGE = $ 0228; program sends this The message rearranges all the minimized MDI sub-window WM_MDiGetActive = $ 0229; the program sends this message to the MDI customer window to find the handle of the activated sub-window WM_MDisetMenu = $ 0230; the program sends this message to the MDI customer window with the MDI menu instead menu WM_ENTERSIZEMOVE subwindow = $ 0231; WM_EXITSIZEMOVE = $ 0232; WM_DROPFILES = $ 0233; WM_MDIREFRESHMENU = $ 0234; WM_MOUSEHOVER = $ 02A1; WM_MOUSELEAVE = $ 02A3; WM_CUT = $ 0300; program sends the message to an edit box or combobox to remove the currently selected text WM_copy = $ 0301; Program Send this message to a edit box or ComboBox to copy the currently selected text to the clipboard WM_PASTE = $ 0302; the program sends this message to get the data wm_clear = $ 0303 in the clipboard; program Send this message EditControl or ComboBox clears the currently selected content; WM_UNDO = $ 0304; program sends this message to editcontrol or ComboBox to undo the last operation WM_RenderFormat = $ 0305;
WM_RENDERALLFORMATS = $ 0306; WM_DESTROYCLIPBOARD = $ 0307; When the EnPtyClipboard function is called to send this message to the owner of the clipboard WM_DRAWCLIPBOARD = $ 0308; send this message to the first window of the clipboard to observe the chain when the content changes of the clipboard; it allows Clipboard Watch window to display new content of the clipboard; WM_PaintClipboard = $ 0309; when the clipboard contains data in the CF_OWNERDIPLAY format and the clipboard observation window needs to be heavy; WM_VSCROLLLPBOARD = $ 030A; WM_SIZECLIPBOARD = 030b; when the clipboard contains CF_OWNERDIPLAY format data and the size of the client area of the clipboard observation window has changed that this message is sent to the owner of the clipboard via the clipboard watch window; WM_ASKCBFORMATNAME = $ 030c; send this message to the clipboard through the clipboard watch window Let's request a clipboard of a CF_OWNERDISPLAY format WM_CHANGECBCHAIN = $ 030D; send this message to the first window of the clipboard observe the chain when the window is removed from the clipboard observation chain; WM_HScrollClipboard = $ 030E; this message passes A clipboard observation window sent to the owner of the clipboard; it occurs when the clipboard contains data in the CFOWNERDispaly format and has an event on the horizontal scroll bar of the clipboard viewing window; the owner should scroll the clipboard image and update scrolling The value of the bar; WM_QUERYNEWPALETTE = $ 030f; This message is sent to the window to receive the focus, this message can make the window when you receive the focus, have the opportunity to achieve his logical palette WM_PALETTEISCHANGINGING = $ 0310; when an application is When you implement its logical palette, you send this message to all applications WM_Palettechanged = $ 0311; this message is sent to all top-level and overlapping windows after implementing its logical palette after a window with focus. Change the system palette WM_HOTKEY = $ 0312; submit this message when the user is pressed by the hotkey registered by the RegisterhotKey function; the application sends this message only as part of the request request request request request request requirements ; Wm_printclient = 792; wm_handheldfirst = 856; wm_handheldlast = 863; WM_PENWINFIRST = $ 0380; WM_PENWINLAST = $ 038F; WM_COALESCE_FIRST = $ 0390; WM_COALESCE_LAST = $ 039F; WM_DDE_FIRST = $ 03E0; WM_DDE_INITIATE = WM_DDE_FIRST 0; a DDE client to submit this message to start a session with the server program to respond to that specified Program and theme name; WM_DDE_TERMINATE = WM_DDE_First 1; a DDE application (whether a customer or 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 The request server updates its WM_DDE_UNADVISE = WM_DDE_FIRST 3 whenever the data item changes; a DDE client notifies a DDE service from updating the specified item or a special clipboard format Item WM_DDE_ACK = WM_DDE_First 4; this message Notify a DDE (dynamic data exchange)
Program has been received and is being processed WM_DDE_POKE, WM_DDE_EXECUTE, WM_DDE_DATA, WM_DDE_ADVISE, WM_DDE_UNADVISE, or WM_DDE_INITIAT news WM_DDE_DATA = WM_DDE_FIRST 5; submit a DDE message to the DDE client service program to pass a number of data items to a customer or a customer's notice Available data item WM_DDE_REQUEST = WM_DDE_FIRST 6; a DDE client submits this message to a DDE service program to request a value of a data item; WM_DDE_POKE = WM_DDE_First 7; a DDE client submits this message to a DDE service program, customer use This message requests the server to receive an unadcoming data item; the server passes whether the WM_DDE_ACK message prompts whether it receives this data item; WM_DDE_EXECUTE = WM_DDE_FIRST 8; a DDE client submits this message to a DDE service program to send a string Give the server to let it be in the serial command, the server responds by submitting the WM_DDE_ACK message; WM_DDE_LAST = WM_DDE_First 8; WM_APP = $ 8000; WM_USER = $ 0400; this message can help the application custom private message; Composite box CBN_Closeup combination The list box of the box is turned off, the CBN_DBLCLK user doubles a string CBN_DROPDOWN combination box list box is pulled out of the CBN_EDitchange user modified the text in the edit box in the text of the text in the editing box is about to update the CBN_ERRSPAC E Combination box. CBN_KILLFOCUS combination box lost Input Focus CBN_SELCHANGE Select a CBN_SELENDCANCELCHANGE selection in the combo box Should be canceled by the CBN_SELEndok user is a legal CBN_SETFOCUS combo box Get the input focus edit box en_change edit box text EN_ERRSPACE edit box memory instead EN_HSCROLL user clicked Horizontal Scroll EN_KILLFOCUS Edit box is losing input focus en_maxtext Inserted Content Truncated EN_SETFOCUS Edit box Get the input focus en_updat E Edit box text will update en_vscroll users Click the vertical scroll bar message Meaning list box LBN_DBLCLK users Double-click an LBN_ERRSPAC E List box memory is not enough LBN_KILLFOCUS list box is losing input focus LBN_SELCANCANCEL Select Cancel LBN_SELCHGE to select another LBN_SETFOCUS list box to get input focus