Windows message Daquan

xiaoxiao2021-03-06  58

Windows message Daquan

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, which is declared in the Windows unit:

Type

TMSG = Packed Record

HWND: 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 time

PT: tpoint; // Message Mouse position

END;

What is there in the news?

Do you feel that the information in a message record is like Greek? If so, 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. Because WPARAM, LPARAM and POIIters are 32-bit, they can be converted between them.

WM_NULL = 0000;

WM_CREATE = $ 0001;

Application creates a window

WM_DESTROY = $ 0002;

One 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 lost to activate;

WM_SETFOCUS = $ 0007;

After getting the focus, WM_KILLFOCUS = $ 0008; lost focus WM_ENABLE = $ 000A; change the enable status WM_SETREDRAW = $ 000B; set whether the window will overhave the wm_settext = $ 000c; the application sends this message to set the text WM_GETTEXT = $ 000D; application The program 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 (not including the empty character) WM_Paint = $ 000f; ask a window to call yourself WM_CLOSE = $ 0010; when one When the window or application is to close, send a signal WM_QueryEndSession = $ 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_quitMessage function wm_QueryOpen = $ 0013; before the user window When the size is positioned, send this message to an icon WM_ERASEBKGND = $ 0014; when the window background must be erased (case change the size of the window) WM_SYSCOLORCHANGE = 0015; When the system color changes, this message is sent to all top windows. WM_ENDSESSION = $ 0016; After the system process issues a WM_QueryEndSession message, this message is sent to the application, notifying it to end WM_SYSTEMERROR = $ 0017; wm_showwindow = 0018; when hidden or display window is sent to this message to this message to this window WM_ACTIVATEAPP = $ 001c; send Which window is activated to the application, 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 Give 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 the mouse input is not captured, send a message to a message Window WM_MouseActivate = $ 0021; When the cursor is in a non-active window and 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 sub-window When the user clicks on this window, or when the window is activated, move, change the size WM_QUEESYNC = $ 0023; this message is sent by the computer-based training program, separated by WH_Journalpalyback User Enter Message WM_GETMINMAXINFO = $ 0024; This message is sent to the window When it will change the size or position; WM_PaintICON = $ 0026; Send to Minimize Window When it is the icon to be edited WM_ICONERASEBKGND = $ 0027; this message is sent to a minimize window Only when it is drawing the icon, its background must be saved WM_NEXTDLGCTL = $ 0028; send this message to a dialog program to change the focus position wm_spoolerstatus = $ 002a; Whenever the print management column increases or decreases this message WM_DRAWITEM = $ 002B; When the video, ComboBox, ListBox, Menu can send this message to the owner of these empty parts WM_MeasureItem = $ 002c;

When Button, Combo Box, List Box, List View Control, or Menu Items are created, send this message to the control owner wm_deleteItem = $ 002d; when the list box or Combo Box is destroyed or when some item is removed by lb_deleteString , LB_RESETCONTENT, CB_DELETESTRING, OR CB_RESETCONTENT message

WM_VKEYTOITEM = $ 002E; This message is sent to a style LBS_WANTKEYBOARDINPUT its owner in response to WM_KEYDOWN message WM_CHARTOITEM = $ 002F; LBS_WANTKEYBOARDINPUT This message is sent by a list box style to respond to his owner WM_CHAR message WM_SETFONT = $ 0030; When the program is drawn, the program sends this message to get the color wm_getfont = $ 0031 you want to use; the application sends this message to get the current control to draw the text of the text WM_SETHOTKEY = $ 0032; the application sends this message to let a window related to a hot key related to WM_GETHOTKEY = $ 0033; Application Send 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 be returned in its class. A handle of an icon or cursor, 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 I rarely 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 size and location of the window has been changed, To call the SETWINDOWPOS function or other window management function wm_power = $ 0048; (for 16-bit Windows) When the system will send this message WM_COPYDATA = $ 004A when the system will enter the pause state; send this when an application passes the data to another application Message WM_CANCELJOURNAL = $ 004b; When a user cancels the program log activation status, submit this message to the program WM_NOTIFY = $ 004E; send this message to it when a control has or if this control needs to get some information Parent window WM_INPUTLANGCHANGEREQUEST = $ 0050; When the user selects some kind of input language, or the hotkey of the input language changes WM_INPUTLANGCHANGE = $ 0051; The platform has been changed to send this message to the affected top window WM_TCARD = $ 0052; when the program has initialized the Windows Help routine, send this message to the application WM_HELP = 0053; this message shows that the user presses F1, if some The menu is activated, send this message, this message is associated with the menu, otherwise send it to the focus window. If there is no focus, you will send this message to the current activation window WM_UserChanged = $ 0054; when the user has logged in Or after exiting, send this message to all the windows, when the user logins or exits, the system updates the user's specific setup information, the system immediately sends this message when the user update settings; WM_NOTIFORMAT = $ 0055; public control, custom control, and their father The window is used to determine whether the control is using ansi or a Unicode structure in the WM_NOTIFY message, using this control to communicate with its parent controls WM_CONTEXTMENU = 007b; when the user is in a window, click on the right click Just send this message to this window WM_StyleChanging = $ 007c; send this message when the calling setWindowlong function will change the style of one or more windows to that message to the window WM_Stylechanged = $ 007d;

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 When it is created, this message is sent before the WM_CREATE message; WM_NCDESTROY = $ 0082; This message notifies a window, the non-client area is destroying WM_NCCALCSIZE = $ 0083; this message will be sent when a customer area must be verified. WM_NCHITTEST = $ 0084 ; // Move the mouse, hold down or release the mouse when it occurs when the program sends this message to a window When it (window) must be drawn; wm_ncactivate = 0086; this message is sent to a window is only Its non-customer area needs to be changed 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 Message, the application can treat him as a special input control and can handle it WM_NCMOUSEMOVE = $ 00A0; send this message when the cursor is moving in a window's non-client mobile to this message to this window // Non-customer area: Form The edge frame of the title bar and the window WM_NCLBUTTONDOWN = $ 00A1; when the cursor is pressed at the non-client area of ​​a window, submit this message wm_nclbuttonup = $ 00a2; when the user releases the left mouse button, the point of the cursor is in a window in non-customer District 10 sends this message; WM_NCLBUTTONDBLCLK = $ 00A3; When the user doubles the left mouse button, the cursor is sent in the non-client zone 10. WM_NCRBUTTONDOWN = $ 00A4; When the user presses the mouse button, the cursor is in the non-customer area of ​​the window When you send this message, WM_NCRBUTTONUP = $ 00A5; when the user releases the mouse button while the cursor is in the non-client district of the window, the message is sent this message WM_ncrButtondblClk = $ 00A6; when the user doubles the mouse button, the cursor is sent in the NPP 10 to send this message W M_ncmbuttondown = $ 00A7; When the user presses the mouse button while the cursor is sent to the window WM_ncmbuttonUp = $ 00A8; when the user releases the mouse button, the cursor is sent to the window of the window WM_NCMBUTTONDBLCLK = $ 00A9; When the user double-click the mouse button while the cursor is sent to this message when the cursor is in the non-client district of the window; wm_keydown = $ 0100; Press a key WM_KEYUP = $ 0101; release a key WM_CHAR = $ 0102; press a key And I have issued WM_KEYDOWN, WM_KEYUP message, WM_DEADCHAR = $ 0103; send this message to the window WM_SYSKEYDOWN = $ 0104 when using the TranslateMessage function to translate the WM_KEYUP message; when the user holds down the Alt button, submit this message to the ownership Window; wm_syskeyup = $ 0105; When the user releases a button while the Alt key is pressed, submit this message to the window WM_SYSCHAR = $ 0106; when the WM_SYSKEYDOWN message is translated by the translateMessage function, submit this message to the window WM_SYSDEADCHAR = $ 0107 ;

When the WM_SYSKEYDOWN message is translated by the translateMessage function to send this message to the window 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 chooses a menu command item or when a control sends a message to the parent window, a shortcut is translated WM_SYSCOMMAND = $ 012; when the user selects a command to select the window menu or when the user chooses maximizes or minimizes That window will receive this message wm_timer = $ 0113; // The timer 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; When a window standard vertical scroll bar generates a scroll incident, send this message to that window, and send it to the control with it.

WM_INITMENU = $ 0116; when a menu will be sent to send this message, it happens to one item in the user menu bar or pressing a menu button, which allows the program to change the menu WM_InitMenupupupup = $ 0117 before display; The submenu will be activated to send this message, which allows the program to change the menu before it is displayed, not to change all WM_MENUSELECT = $ 011f; send this message to the menu when the user selects a menu item (generally window) WM_Menuchar = $ 0120; When the menu has been activated by the user (different from the acceleration button), send this message to the owner of the menu; WM_EnterIdle = $ 0121; send this when a modal dialog or menu enters an empty state The message gives it the owner, a modal dialog or menu into the no-load state is to wait for a series after a previous message, there is no message to wait for 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; this message is sent before the windows drawn message box to the owner window message frame, in response to this message, the owner of the window Set the text and background color wm_ctlcoloredit = $ 0133 by using a given related display device; send this message to its parent window when an editing control will be drawn; by responding to this message, the owner window You can set the edit box for text and background color wm_ctlcolorlistbox = $ 0134 by using a given related display device; when a list box control will be drawn before you send this message to the parent window; by responding to this message, owner The window can set the list box for text and background color wm_ctlcolorbtn = $ 0135 by using a given relevant display device; when a button control will be drawn, send this message to its parent window; by responding to this message, owner The window can set the text and background color wm_ctlcolordlg = $ 0136 by using a given related display device; when a dialog control is to be drawn, this message is sent. Its parent window; by responding to this message, the owner window can set the text background color wm_ctlcolorscrollbar = $ 0137 using the given related display device; send this message when a scroll bar control will be drawn Its parent window; by responding to this message, the owner window can set the background color wm_ctlcolorstatic = $ 0138 of the scroll bar by using a given relevant display device; send this message to it when a static control will be drawn The parent window; by responding to this message, the owner window can set the text and background color wm_mousefirst = $ 0200; wm_mousemove = $ 0200; mobile mouse wm_lbuttondown = $ 0201; Press the left key 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-click the right mouse button WM_MBUTTONDOWN =

$ 0207; mouse button is pressed WM_MBUTTONUP = $ 0208; release the mouse button WM_MBUTTONDBLCLK = $ 0209; This message is sent a current control WM_MOUSELAST has the focus when the mouse wheel is rotated = $ 020A;; double-click the mouse button WM_MOUSEWHEEL = $ 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 on the sub-window WM_ENTERMENULOOP = $ 0211; send this message to notify the application's main window That has entered 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, send this message to the window; through this message application Monitor window size and location 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 when the window, this message can be monitored by this message application and The location can also be modified; WM_PowerBroadcast = 536; This message is sent to the application to inform it to notify the power management event; WM_DeviceChange = 537; send this message when the device's hardware configuration changes 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 = $ 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; application sends this message to multi-document customer window Built a MDI sub-window WM_MDIDESTROY = $ 0221; the application sends this message to the multi-document customer window to close a MDI sub-window WM_MDIACTIVATE = $ 0222; application sends this message to the multi-document client window to inform the customer window to activate another MDI child window After the customer window receives this message, it issues a WM_MDIACTIVE message to activate it to the MDI sub-window (not activated); WM_MDIRESTORE = $ 0223; Program Send this message to the MDI customer window allows sub-windings from the maximum minimum size WM_MDINEXT = $ 0224; Program Send this message to the MDI Customer window to activate the next or the previous window WM_MDIMAXIMIZE = $ 0225; the program sends this message to maximize a MDI sub-window; wm_mditile = $ 0226; program sends this message to the MDI customer window Tiles rearrange all MDI sub-window WM_MDICASCADE = $ 0227; program sends this message to the MDI customer window to rearrange all MDI sub-window WM_MDIICONARRANGE = $ 0228; program sends this message to the MDI customer window Replace all minimized MDI Window WM_MDiGetActive = $ 0229;

Sends the message to the MDI client window to find the active sub-window handle WM_MDISETMENU = $ 0230; sends this message to the MDI client window instead of the menu WM_ENTERSIZEMOVE child window by MDI menu = $ 0231; WM_EXITSIZEMOVE = $ 0232; WM_DROPFILES = $ 0233; WM_MDIREFRESHMENU = $ 0234; wm_mousehover = $ 02A1; WM_MouseLeave = $ 02A3; WM_CUT = $ 0300; Program Send this message to an edit box or ComboBox to delete the currently selected text WM_Copy = $ 0301;

The program sends this message to a edit box or ComboBox to copy the currently selected text to the clipboard

WM_PASTE = $ 0302; Program Send this message to EditControl or ComboBox gets data from the clipboard

WM_CLEAR = $ 0303;

The program sends this message to EDITCONTROL or COMBOBOX to clear the currently selected content;

WM_UNDO = $ 0304;

Program Send this message to EditControl or ComboBox to undo the last operation

WM_RENDERFORMAT = $ 0305;

WM_RENDERLFORMATS = $ 0306;

WM_DESTROYCLIPBOARD = $ 0307;

Send this message to the owner of the clipboard when calling an EnPtyClipboard function

WM_DRAWCLIPBOARD = $ 0308;

This message is sent to the first window of the clipboard to observe the chain of the clipboard when the content changes of the clipboard; it allows the window to display the new content of the clipboard with the clipboard;

WM_PaintClipboard = $ 0309;

When the clipboard contains data in the CF_OWNERDIPLAY format and the clipboard observed the window of the window needs to be heavy;

WM_VSCROLLLPBOARD = $ 030A;

WM_SIZECLIPBOARD = $ 030B;

When the clipboard contains the data of the CF_OWNERDIPLAY format and the size of the clipboard observation window has changed this message, the message is sent to the owner of the clipboard via the clipboard watch window.

WM_ASKCBFORMATNAME = $ 030c;

Send this message to the owner of the clipboard to request a clipboard name of the clipboard with the owner of the clipboard through the clipboard observation window.

WM_CHANGECBCHAIN ​​= $ 030D;

This message is sent to the first window of the clipboard when the window is removed from the clipboard observation chain.

WM_HSCROLLLPBOARD = $ 030E;

This message sends the owner of the clipboard through a clipboard observation window; it occurs in the clipboard contains data in the CFOWNERDISPALY format and has an event on the horizontal scroll bar of the clipboard viewing window; owner should scroll the clipboard image And update the value of the scroll bar;

WM_QUERYNEWPALETTE = $ 030F;

This message is sent to a window that will receive a focus. This message enables the window to have the opportunity to achieve his logical palette while receiving the focus.

WM_PALETTEISCHANGINGINGINGING = $ 0310;

When an application is to implement its logical palette, this message notifies all applications

WM_PALETTECHANGED = $ 0311;

This message is sent to all top-level and overlapping windows after implementing its logical palette on a focus window. To change the system palette.

WM_HOTKEY = $ 0312;

This message is submitted when the user presses the hotkey registered by the RegisterhotKey function.

WM_PRINT = 791;

Application Send This message is only part of the application only when Windows or other applications issues a request request;

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 submits this message to start a session with the server to respond to the 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 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 that does not update the specified item or a special clipboard format.

WM_DDE_ACK = WM_DDE_FIRST 4;

This message notifies a DDE (Dynamic Data Exchange) program has received and is processed WM_DDE_POKE, WM_DDE_EXECUTE, WM_DDE_DATA, WM_DDE_ADVISE, WM_DDE_UNADVISE, or WM_DDE_INITIAT message

WM_DDE_DATA = WM_DDE_FIRST 5;

A DDE service program submits this message to the DDE client to deliver a data item to the customer or notify the customer.

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, the customer uses this message to request 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 to the server as the serial command is processed as the serial command, and 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 application custom private messages;

- ================================================================================================================================================================== ================================= -

Notification Message refers to such a message. There are some things in a window, and you need to notify the parent window. The notification message is only available for standard window controls such as buttons, list boxes, combo boxs, edit boxes, and Windows 95 public controls such as tree views, list views, etc. For example, click or double-click a control, select some text in the control, and the scroll bar of the operating control will generate a notification message. Twisting Bn_Clicked Users Click the button

BN_DISABLE button is disabled

Bn_doubleclicked user double-click the button

BN_HILITE users highlight the button

BN_PAINT button should be redrawn

BN_UNHILITE brighten should be removed

Combination box CBN_Closeup combination box list box is turned off

CBN_DBLCLK users double-click a string

The list box of the CBN_DropDown combo box is pulled out

CBN_EDITChange users modified the text in the edit box

The text in the CBN_EDITUPDATE edit box is about to be updated

CBN_ERRSPACE combination box is insufficient

CBN_KILLFOCUS Combination Box Lost Input Focus

CBN_SELCHANGE selection one in the combo box

CBN_SELENDCANCEL users should be canceled

The choice of CBN_SELENDOK users is legal

CBN_SETFOCUS Combination Box Getting Input Focus

Edit box EN_CHANGE Edit box text

EN_ERRSPACE edit box is insufficient

EN_HSCROLL users Click horizontal scroll bar

En_killfocus edit box is losing input focus

EN_MAXTEXT insertion is truncated

En_setfocus Edit box Getting the input focus

The text in the en_update edit box will be updated

EN_VSCROLL users click on vertical scroll bar messages

List box lbn_dblclk users double click on one

LBN_ERRSPACE list box is not enough

LBN_KILLFOCUS list box is losing input focus

LBN_SELCANCEL selection is canceled

LBN_SELCHANGE selection another

LBN_SETFOCUS list box get input focus

转载请注明原文地址:https://www.9cbs.com/read-118711.html

New Post(0)