Message Details in Windows

Source: Internet
Author: User
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, which 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. Since wparam, lparam, and pointer are both three or two bits, they can be converted to each other.

Wm_null =$ 0000;
Wm_create = $0001; create a window for the Application
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 obtaining the focus
Wm_killfocus = $0008; lost focus
Wm_enable = $ 000a; changed the Enable status
Wm_setredraw = $ 000b; specifies whether the window can be repainted.
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.
Wm_gettextlength = $ 000e; get the length of the text related to a window (excluding empty characters)
Wm_paint = $ 000f; requires a window to redraw itself
Wm_close = $0010; send a signal when a window or application is to close
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 this message to an icon when the user window restores its 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; when the system process sends the wm_queryendsession message, the message is sent to the application to notify it of the end of the conversation.
Wm_systemerror = $0017;
Wm_showwindow = $0018; when the hidden or displayed window is sent to this window
Wm_activateapp = $ 001c; the window in which the message is sent to the application is activated and the window in which the message is not activated;
Wm_fontchange = $ 001d; send this message to all top-level windows when the font resource pool 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 and is separated by the wh_journalpalyback hook program.
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 the minimization 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 repainted 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; this message is sent to the owner of these empty parts when the visual appearance of Button, ComboBox, ListBox, and menu changes.
Wm_measureitem = $ 002c; send this message to the control owner when button, combo box, list box, List View control, or menu item is created.
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; the 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 program log activation status, 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; when the platform site has been changed, send this message to the affected top-level window
Wm_tcard = $0052; send this message to the application when the program has initialized the Windows Help routine
Wm_help = $0053; the message indicates that the user presses F1. If a menu is activated, the user sends the message to the menu associated with the window; otherwise, the message is sent to the window with focus, if no focus exists, send the message to the active window.
Wm_userchanged = $0054; when the user has logged on or exited, this message is sent to all windows. When the user logs on or exits, the system updates the user's specific settings, the system sends this message immediately when the user updates the settings;
Wm_policyformat = $0055; the custom control and its parent window 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; when you right-click a window, the message is sent to the window.
Wm_stylechanging = $ 007c; send this message to the window when you call the setwindowlong function to change the style of one or more windows
Wm_stylechanged = $ 007d; send this message to the window when one or more windows 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 icon or small icon with a window;
Wm_nccreate = $0081; When a window is created for the first time, this message is sent before the wm_create message is sent;
Wm_ncdestroy = $0082; this message notifies a window in which non-customer zones are 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 the frame of the 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 the message is activated or not;
Wm_getdlgcode = $0087; send this message to a control associated with the dialog box program. The Widdows control orientation key and Tab key enable the input to enter this control by responding to the wm_getdlgcode message, an application can treat it as a special input control and process it.
Wm_ncmousemove = $00a0; when the cursor moves in a non-customer area of a window, this message is sent to the window. The non-customer area is the title bar of the form and the border body of the window.
Wm_nclbuttondown = $00a1; this message is submitted when the cursor is in the non-customer area of a window and the left mouse button is pressed at the same time.
Wm_nclbuttonup = $00a2; when the user releases the left mouse button, and the cursor sends the message in a window outside the customer Zone 10;
Wm_nclbuttondblclk = $00a3; when you double-click the left mouse button, and the cursor in a window in non-customer Zone 10, send this message
Wm_ncrbuttondown = $00a4; this message is sent when you right-click the user and the cursor is in a non-customer area of the window.
Wm_ncrbuttonup = $00a5; this message is sent when the user releases the right mouse and the cursor is in a non-customer area of the window.
Wm_ncrbuttondblclk = $00a6; when you double-click and right-click the user, and the cursor in a window in non-customer Zone 10 sends this message
Wm_ncmbuttondown = $00a7; this message is sent when you press the middle mouse button and the cursor is in a non-customer area of the window.
Wm_ncmbuttonup = $00a8; this message is sent when the user releases the middle mouse button and the cursor is in a non-customer area of the window.
Wm_ncmbuttondblclk = $00a9; this message is sent when you double-click the middle mouse button and the cursor is in a non-customer area of the window.
Wm_keyfirst =$ 0100;
Wm_keydown = $0100; press the next key
Wm_keyup = $0101; release a key
Wm_char = $0102; press a key and the message wm_keydown and wm_keyup has been sent.
Wm_deadchar = $0103; send this message to the window with focus when you use the translatemessage function to translate the wm_keyup message
Wm_syskeydown = $0104; when you press the Alt key and other keys, submit the message to the window with focus;
Wm_syskeyup = $0105; when you release a key and press the Alt key, submit the message to the window with focus
Wm_syschar = $0106; when the wm_syskeydown message is translated by the translatemessage function, submit the message to the window with focus
Wm_sysdeadchar = $0107; when the wm_syskeydown message is translated by the translatemessage function, this message is sent to the window with focus
Wm_keylast =$ 0108;
Wm_initdialog = $0110; send this message to a dialog box program before it is displayed. This message is usually used to initialize the control and execute other tasks.
Wm_command = $0111; when you select a menu command item or when a control sends a message to its parent window, a shortcut key is translated
Wm_syscommand = $0112; this message is received when the user selects a command in the window menu or when the user selects maximization or minimization.
Wm_timer = $0113; a timer event occurs.
Wm_hscroll = $0114; when a standard horizontal scroll bar of a window generates a rolling event, this message is sent to that window and the control that owns it.
Wm_vscroll = $0115; when a standard vertical scroll bar of a window generates a rolling event, this message is sent to that window and the control that owns it.
Wm_initmenu = $0116; this message is sent when a menu is to be activated. It occurs in one of the user menu bar or presses a menu key, which allows the program to change the menu before display.
Wm_initmenupopup = $0117; send this message when a drop-down menu or sub-menu is to be activated. It allows the program to change the menu before it is displayed, instead of changing all
Wm_menuselect = $ 011f; send this message to the menu owner when a menu item is selected (usually a window)
Wm_menuchar = $0120; When a menu already activated user presses a key (different from the acceleration Key), this message is sent to the menu owner;
Wm_enteridle = $0121; When a modal dialog box or menu enters the idle state, this message is sent to its owner, when a modal dialog box or menu enters the no-load status, it waits for no messages in the queue after processing one or more previous messages.
Wm_menurbuttonup =$ 0122;
Wm_menudrag =$ 0123;
Wm_menugetobject =$ 0124;
Wm_uninitmenupopup =$ 0125;
Wm_menucommand =$ 0126;
Wm_changeuistate = $0127;
Wm_updateuistate =$ 0128;
Wm_queryuistate = $0129;
Wm_ctlcolormsgbox = $0132; send the message to the owner window of the message box before drawing the message box in windows, in the owner window, you can set the text and background color of the message box by using the given handle of the display device.
Wm_ctlcoloredit = $0133; send this message to its parent window when an edit control is to be drawn; by responding to this message, in the owner window, you can set the text and background color of the edit box by using the given handle of the display device.
Wm_ctlcolorlistbox = $0134; When a list box control is to be drawn, send this message to its parent window; by responding to this message, in the owner window, you can set the text and background colors of the list box by using the given handle of the display device.
Wm_ctlcolorbtn = $0135; send this message to its parent window when a button control is to be drawn; by responding to this message, in the owner window, you can set the text and background color of the button by using the handle of the specified display device.
Wm_ctlcolordlg = $0136; When a dialog box control is to be drawn, send this message to its parent window; by responding to this message, in the owner window, you can set the text background color of the dialog box by using the corresponding display device handle.
Wm_ctlcolorscrollbar = $0137; send this message to its parent window when a scroll bar control is to be drawn; by responding to this message, in the owner window, you can set the background color of the scroll bar by using the corresponding display device handle.
Wm_ctlcolorstatic = $0138; send this message to its parent window when a static control is to be drawn; by responding to this message, in the owner window, you can set the text and background color of the static control by using the given handle of the display device.
Wm_mousefirst =$ 0200;
Wm_mousemove = $0200; move the 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; Right-click the mouse
Wm_rbuttonup = $0205; right-click to release
Wm_rbuttondblclk = $0206; right-click
Wm_mbuttondown = $0207; right-click
Wm_mbuttonup = $0208; release the middle mouse button
Wm_mbuttondblclk = $0209; double-click the key
Wm_mousewheel = $ 020a; this message is sent when the mouse wheel is turned with the current focus control
Wm_mouselast = $ 020a;
Wm_parentnotify = $0210; the message is sent to the parent window when the child window of MDI is created or destroyed, or the user presses the mouse key and the cursor sends the message to the Child Window.
Wm_entermenuloop = $0211; the main window of the notification application that has entered the menu loop mode
Wm_exitmenuloop = $0212; the main window of the notification application that has exited the menu loop mode
Wm_nextmenu = $0213;
Wm_sizing = 532; when the user is adjusting the window size, send this message to 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 a user sends a message in a mobile window, the message application can monitor the window size and position 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 = $ 010d;
Wm_ime_endcomposition = $ 010e;
Wm_ime_composition = $ 010f;
Wm_ime_keylast = $ 010f;
Wm_ime_setcontext = $0281;
Wm_ime_policy = $0282;
Wm_ime_control = $0283;
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; the application sends this message to the customer window of multiple documents to create an MDI subwindow
Wm_mdidestroy = $0221; the application sends this message to the customer window of multiple documents to close an MDI subwindow.
Wm_mdiactivate = $0222; the application sends this message to the customer window of multiple documents to notify the customer window to activate another MDI subwindow. When the customer window receives this message, it sends a wm_mdiactive message to the MDI subwindow (not activated) to activate it;
Wm_mdirestore = $0223; the program sends this message to the MDI customer window so that the subwindow is restored from the maximum to the original size
Wm_mdinext = $0224; the program sends this message to the MDI customer window to activate the next or previous window.
Wm_mdimaximize = $0225; the program sends this message to the MDI customer window to maximize an MDI subwindow;
Wm_mditile = $0226; the program sends this message to the MDI customer window to rearrange all MDI child windows in Tiled Mode
Wm_mdicascade = $0227; the program sends this message to the MDI customer window and rearranges all MDI child windows in a stacked manner.
Wm_mdiiconarrange = $0228; the program sends this message to the MDI customer window to rearrange all the minimized MDI child windows.
Wm_mdigetactive = $0229; the program sends this message to the MDI customer window to locate the handle of the activated subwindow.
Wm_mdisetmenu = $0230; the program sends this message to the MDI customer window, replacing the sub-Window Menu With the MDI menu
Wm_entersizemove = $0231;
Wm_exitsizemove =$ 0232;
Wm_dropfiles =$ 0233;
Wm_mdirefreshmenu =0234;
Wm_mousehover = $02a1;
Wm_mouseleave = $02a3;
Wm_cut = $0300; the program sends this message to an edit box or ComboBox to delete the selected text
Wm_copy = $0301; the program sends this message to an edit box or ComboBox to copy the selected text to the clipboard.
Wm_paste = $0302; the program sends this message to editcontrol or ComboBox to obtain data from the clipboard.
Wm_clear = $0303; the program sends this message to editcontrol or ComboBox to clear the selected content;
Wm_undo = $0304; the program sends this message to editcontrol or ComboBox to cancel the last operation.
Wm_renderformat = $0305;
Wm_renderallformats = $0306;
Wm_destroyclipboard = $0307; this message is sent to the clipboard owner when the enptyclipboard function is called.
Wm_drawclipboard = $0308; this message is sent to the first window of the clipboard observation chain when the content of the clipboard changes; it allows the clipboard observation window to display the new content of the clipboard;
Wm_paintclipboard = $0309; when the Clipboard contains data in the cf_ownerdiplay format and the client area of the clipboard observation window needs to be re-painted;
Wm_vscrollclipboard = $ 030a;
Wm_sizeclipboard = $ 030b; when the Clipboard contains data in the cf_ownerdiplay format and the size of the client area in the clipboard observation window has changed, the message is sent to the clipboard owner through the clipboard observation window;
Wm_askcbformatname = $ 030c; send this message to the clipboard owner through the clipboard observation window to request the name of the clipboard in cf_ownerdisplay format.
Wm_changecbchain = $ 030d; send this message to the first window of the clipboard observation chain when a window is moved from the clipboard observation chain;
Wm_hscrollclipboard = $ 030e; this message is sent to the clipboard owner through a clipboard observation window; it occurs when the Clipboard contains data in the cfownerdispaly format and an event is on the horizontal scroll bar of the clipboard observation window; the owner should scroll the clipboard image and update the value of the scroll bar;
Wm_querynewpalette = $ 030f; this message is sent to the window that will receive the focus, which gives the window the opportunity to implement its logical palette when receiving the focus.
Wm_paletteischanging = $0310; this message notifies all applications when an application is about to implement its logical palette
Wm_palettechanged = $0311; this message is sent to all top-level and overlapping windows after implementing its logical palette in a window with focus, to change the system palette
Wm_hotkey = $0312; this message is submitted when you press the hotkey registered by the registerhotkey Function
Wm_print = 791; the application sends this message only when Windows or other applications send a request requesting to draw a part of an application;
Wm_prints client = 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 program submits this message and starts a session with the server program to respond to the specified program and topic name;
Wm_dde_terminate = wm_dde_first + 1; a dde application (whether the client or server) submits this message to terminate a session;
Wm_dde_advise = wm_dde_first + 2; a dde client program 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 not to update the specified item or an item in a special clipboard format.
Wm_dde_ack = wm_dde_first + 4; this message notifies a DDE (Dynamic Data Exchange) program that it has received and is processing wm_dde_poke, wm_dde_execute, wm_dde_data, Token, expires, or wm_dde_initiat message
Wm_dde_data = wm_dde_first + 5; a dde Service Program submits this message to the DDE client program to transmit a data item to the customer or notify the customer of an available data item.
Wm_dde_request = wm_dde_first + 6; a dde client program 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 program submits the message to a DDE Service Program. The client uses the message to request the server to receive an unapproved data item; the server replies to the wm_dde_ack message and prompts whether the server receives the data item;
Wm_dde_execute = wm_dde_first + 8; a dde client program submits this message to a DDE Service Program to send a string to the server for processing like a 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 helps the application customize private messages;

A notification message refers to a message in which a child control in a window has something to notify the parent window. The notification message is only applicable to standard window controls such as buttons, list boxes, Combo boxes, and edit boxes, as well as Windows 95 public controls such as tree views and list views. For example, clicking or double-clicking a control, selecting some text in the control, and the scroll bar of the operation control will generate a notification message.

Button
The bn_clicked user clicked the button.
Bn_disable button disabled
Bn_doubleclicked double-click the button
Bn_hilite user highlighted button
Bn_paint button should be repainted
Bn_unhilite should be removed

ComboBox
The list box of the cbn_closeup combo box is closed.
The cbn_dblclk user double-clicked a string.
The list box of the cbn_dropdown combo box is pulled out.
The cbn_editchange user modified the text in the editing box.
The text in the cbn_editupdate edit box is about to be updated.
The cbn_errspace combo box has insufficient memory.
The cbn_killfocus combo box loses the input focus.
Cbn_selchange
Cbn_selendcancel user selection should be canceled
Cbn_selendok users' selection is legal
Cbn_setfocus combo box to get the input focus

Edit
The text in the en_change edit box has been updated.
The en_errspace editing box has insufficient memory.
The en_hscroll user clicked the horizontal scroll bar.
The en_killfocus edit box is missing the input focus.
The content inserted by en_maxtext is truncated.
En_setfocus edit box to get the input focus
The text in the en_update edit box will be updated.
The en_vscroll user clicks the vertical scroll bar message meaning

ListBox
Lbn_dblclk
Lbn_errspace: insufficient memory in the list box
The lbn_killfocus list box is missing the input focus.
Lbn_selcancel selected to be canceled
Lbn_selchange selects another item
Lbn_setfocus list box to get the input focus

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.