wm messages

31
WM_ACTIVATE 0x6 The WM_ACTIVATE message is sent when a window is being activated or deactivated. This message is sent first to the window procedure of the top-level window being deactivated; it is then sent to the window procedure of the top-level window being activated. WM_ACTIVATEAPP 0x1C The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated. WM_AFXFIRST 0x360 The WM_AFXFIRST specifies the first afx message. WM_AFXLAST 0x37F The WM_AFXFIRST specifies the last afx message. WM_APP 0x8000 The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value. WM_ASKCBFORMATNAME 0x30C The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format. WM_CANCELJOURNAL 0x4B The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle. WM_CANCELMODE 0x1F The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window. WM_CAPTURECHANGED 0x215 The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture. WM_CHANGECBCHAIN 0x30D The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain. WM_CHANGEUISTATE 0x127 An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed. WM_CHAR 0x102 The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. WM_CHARTOITEM 0x2F Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message. WM_CHILDACTIVATE 0x22 The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the

Upload: sarthakganguly

Post on 02-Apr-2015

413 views

Category:

Documents


10 download

TRANSCRIPT

Page 1: WM Messages

WM_ACTIVATE 0x6

The WM_ACTIVATE message is sent when a window is being activated or deactivated. This message is sent first to the window procedure of the top-level window being deactivated; it is then sent to the window procedure of the top-level window being activated.

WM_ACTIVATEAPP 0x1C

The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.

WM_AFXFIRST 0x360 The WM_AFXFIRST specifies the first afx message.

WM_AFXLAST 0x37F The WM_AFXFIRST specifies the last afx message.

WM_APP 0x8000The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value.

WM_ASKCBFORMATNAME 0x30CThe WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.

WM_CANCELJOURNAL 0x4B

The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle.

WM_CANCELMODE 0x1F

The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.

WM_CAPTURECHANGED 0x215The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.

WM_CHANGECBCHAIN 0x30DThe WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain.

WM_CHANGEUISTATE 0x127An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.

WM_CHAR 0x102

The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed.

WM_CHARTOITEM 0x2FSent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message.

WM_CHILDACTIVATE 0x22 The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the

Page 2: WM Messages

window is activated, moved, or sized.

WM_CLEAR 0x303An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control.

WM_CLOSE 0x10The WM_CLOSE message is sent as a signal that a window or an application should terminate.

WM_COMMAND 0x111

The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.

WM_COMPACTING 0x41

The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.

WM_COMPAREITEM 0x39

The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style.

WM_CONTEXTMENU 0x7BThe WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.

WM_COPY 0x301An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format.

WM_COPYDATA 0x4AAn application sends the WM_COPYDATA message to pass data to another application.

WM_CREATE 0x1

The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.

WM_CTLCOLORBTN 0x135

The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message.

WM_CTLCOLORDLG 0x136

The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle.

WM_CTLCOLOREDIT 0x133 An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device

Page 3: WM Messages

context handle to set the text and background colors of the edit control.

WM_CTLCOLORLISTBOX 0x134

Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle.

WM_CTLCOLORMSGBOX 0x132

The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle.

WM_CTLCOLORSCROLLBAR 0x137

The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control.

WM_CTLCOLORSTATIC 0x138

A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control.

WM_CUT 0x300

An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format.

WM_DEADCHAR 0x103

The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key.

WM_DELETEITEM 0x2D

Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.

WM_DESTROY 0x2 The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window

Page 4: WM Messages

being destroyed after the window is removed from the screen. This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.

WM_DESTROYCLIPBOARD 0x307The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard.

WM_DEVICECHANGE 0x219Notifies an application of a change to the hardware configuration of a device or the computer.

WM_DEVMODECHANGE 0x1BThe WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings.

WM_DISPLAYCHANGE 0x7EThe WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.

WM_DRAWCLIPBOARD 0x308

The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.

WM_DRAWITEM 0x2B

The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.

WM_DROPFILES 0x233Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.

WM_ENABLE 0xA

The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed.

WM_ENDSESSION 0x16

The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.

WM_ENTERIDLE 0x121

The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages.

WM_ENTERMENULOOP 0x211The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered.

WM_ENTERSIZEMOVE 0x231 The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when

Page 5: WM Messages

the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.

WM_ERASEBKGND 0x14

The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting.

WM_EXITMENULOOP 0x212The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited.

WM_EXITSIZEMOVE 0x232

The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.

WM_FONTCHANGE 0x1DAn application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources.

WM_GETDLGCODE 0x87

The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.

WM_GETFONT 0x31An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text.

WM_GETHOTKEY 0x33An application sends a WM_GETHOTKEY message to determine the hot key associated with a window.

WM_GETICON 0x7F

The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption.

WM_GETMINMAXINFO 0x24

The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.

WM_GETOBJECT 0x3D Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application. Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint,

Page 6: WM Messages

AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message.

WM_GETTEXT 0xDAn application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller.

WM_GETTEXTLENGTH 0xEAn application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window.

WM_HANDHELDFIRST 0x358 Definition Needed

WM_HANDHELDLAST 0x35F Definition Needed

WM_HELP 0x53

Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window.

WM_HOTKEY 0x312

The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key.

WM_HSCROLL 0x114

This message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control.

WM_HSCROLLCLIPBOARD 0x30E

The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values.

WM_ICONERASEBKGND 0x27

Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.

WM_IME_CHAR 0x286Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function.

WM_IME_COMPOSITION 0x10FSent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function.

WM_IME_COMPOSITIONFULL 0x284Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function.

Page 7: WM Messages

WM_IME_CONTROL 0x283

Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.

WM_IME_ENDCOMPOSITION 0x10ESent to an application when the IME ends composition. A window receives this message through its WindowProc function.

WM_IME_KEYDOWN 0x290Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function.

WM_IME_KEYLAST 0x10F Definition Needed

WM_IME_KEYUP 0x291Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function.

WM_IME_NOTIFY 0x282Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function.

WM_IME_REQUEST 0x288Sent to an application to provide commands and request information. A window receives this message through its WindowProc function.

WM_IME_SELECT 0x285Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function.

WM_IME_SETCONTEXT 0x281Sent to an application when a window is activated. A window receives this message through its WindowProc function.

WM_IME_STARTCOMPOSITION 0x10DSent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function.

WM_INITDIALOG 0x110

The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box.

WM_INITMENU 0x116

The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed.

WM_INITMENUPOPUP 0x117

The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu.

WM_INPUTLANGCHANGE 0x51 The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the

Page 8: WM Messages

DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on.

WM_INPUTLANGCHANGEREQUEST 0x50

The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately.

WM_KEYDOWN 0x100

The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.

WM_KEYFIRST 0x100 This message filters for keyboard messages.

WM_KEYLAST 0x108 This message filters for keyboard messages.

WM_KEYUP 0x101

The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.

WM_KILLFOCUS 0x8The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus.

WM_LBUTTONDBLCLK 0x203

The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_LBUTTONDOWN 0x201

The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_LBUTTONUP 0x202

The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_MBUTTONDBLCLK 0x209 The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that

Page 9: WM Messages

has captured the mouse.

WM_MBUTTONDOWN 0x207

The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_MBUTTONUP 0x208

The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_MDIACTIVATE 0x222An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window.

WM_MDICASCADE 0x227An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format.

WM_MDICREATE 0x220An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window.

WM_MDIDESTROY 0x221An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window.

WM_MDIGETACTIVE 0x229An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window.

WM_MDIICONARRANGE 0x228

An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized.

WM_MDIMAXIMIZE 0x225

An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window.

WM_MDINEXT 0x224An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window.

WM_MDIREFRESHMENU 0x234An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window.

WM_MDIRESTORE 0x223 An application sends the WM_MDIRESTORE message to a

Page 10: WM Messages

multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size.

WM_MDISETMENU 0x230

An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both.

WM_MDITILE 0x226An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format.

WM_MEASUREITEM 0x2CThe WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.

WM_MENUCHAR 0x120

The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu.

WM_MENUCOMMAND 0x126The WM_MENUCOMMAND message is sent when the user makes a selection from a menu.

WM_MENUDRAG 0x123The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item.

WM_MENUGETOBJECT 0x124

The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item.

WM_MENURBUTTONUP 0x122The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item.

WM_MENUSELECT 0x11FThe WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item.

WM_MOUSEACTIVATE 0x21

The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.

WM_MOUSEFIRST 0x200Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.

WM_MOUSEHOVER 0x2A1

The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.

WM_MOUSELAST 0x20D Definition Needed

WM_MOUSELEAVE 0x2A3The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.

WM_MOUSEMOVE 0x200 The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has

Page 11: WM Messages

captured the mouse.

WM_MOUSEWHEEL 0x20A

The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.

WM_MOUSEHWHEEL 0x20E

The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.

WM_MOVE 0x3The WM_MOVE message is sent after a window has been moved.

WM_MOVING 0x216

The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.

WM_NCACTIVATE 0x86 Non Client Area Activated Caption(Title) of the Form

WM_NCCALCSIZE 0x83

The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.

WM_NCCREATE 0x81The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.

WM_NCDESTROY 0x82

The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window.

WM_NCHITTEST 0x84

The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.

WM_NCLBUTTONDBLCLK 0xA3

The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

WM_NCLBUTTONDOWN 0xA1 The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has

Page 12: WM Messages

captured the mouse, this message is not posted.

WM_NCLBUTTONUP 0xA2

The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

WM_NCMBUTTONDBLCLK 0xA9

The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

WM_NCMBUTTONDOWN 0xA7

The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

WM_NCMBUTTONUP 0xA8

The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

WM_NCMOUSEMOVE 0xA0

The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

WM_NCPAINT 0x85The WM_NCPAINT message is sent to a window when its frame must be painted.

WM_NCRBUTTONDBLCLK 0xA6

The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

WM_NCRBUTTONDOWN 0xA4

The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

WM_NCRBUTTONUP 0xA5

The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.

WM_NEXTDLGCTL 0x28The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box

WM_NEXTMENU 0x213 The WM_NEXTMENU message is sent to an application

Page 13: WM Messages

when the right or left arrow key is used to switch between the menu bar and the system menu.

WM_NOTIFY 0x4ESent by a common control to its parent window when an event has occurred or the control requires some information.

WM_NOTIFYFORMAT 0x55

Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.

WM_NULL 0x0The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.

WM_PAINT 0xF Occurs when the control needs repainting

WM_PAINTCLIPBOARD 0x309

The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting.

WM_PAINTICON 0x26

Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.

WM_PALETTECHANGED 0x311

This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette. This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.

WM_PALETTEISCHANGING 0x310The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette.

WM_PARENTNOTIFY 0x210

The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.

WM_PASTE 0x302

An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format.

WM_PENWINFIRST 0x380 Definition Needed

WM_PENWINLAST 0x38F Definition Needed

Page 14: WM Messages

WM_POWER 0x48Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode. Obsolete : use POWERBROADCAST instead

WM_POWERBROADCAST 0x218Notifies applications that a power-management event has occurred.

WM_PRINT 0x317The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.

WM_PRINTCLIENT 0x318The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.

WM_QUERYDRAGICON 0x37

The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.

WM_QUERYENDSESSION 0x11

The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero. After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.

WM_QUERYNEWPALETTE 0x30FThis message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus.

WM_QUERYOPEN 0x13The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.

WM_QUEUESYNC 0x23

The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure.

WM_QUIT 0x12

Once received, it ends the application's Message Loop, signaling the application to end. It can be sent by pressing Alt+F4, Clicking the X in the upper right-hand of the program, or going to File->Exit.

WM_RBUTTONDBLCLK 0x206

he WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_RBUTTONDOWN 0x204 The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the

Page 15: WM Messages

client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_RBUTTONUP 0x205

The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_RENDERALLFORMATS 0x306

The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function.

WM_RENDERFORMAT 0x305

The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function.

WM_SETCURSOR 0x20The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.

WM_SETFOCUS 0x7 When the controll got the focus

WM_SETFONT 0x30An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text.

WM_SETHOTKEY 0x32An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window.

WM_SETICON 0x80

An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption.

WM_SETREDRAW 0xBAn application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn.

WM_SETTEXT 0xCText / Caption changed on the control. An application sends a WM_SETTEXT message to set the text of a window.

WM_SETTINGCHANGE 0x1A

An application sends the WM_SETTINGCHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.

WM_SHOWWINDOW 0x18 The WM_SHOWWINDOW message is sent to a window

Page 16: WM Messages

when the window is about to be hidden or shown

WM_SIZE 0x5The WM_SIZE message is sent to a window after its size has changed.

WM_SIZECLIPBOARD 0x30B

The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size.

WM_SIZING 0x214

The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position.

WM_SPOOLERSTATUS 0x2AThe WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue.

WM_STYLECHANGED 0x7DThe WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles.

WM_STYLECHANGING 0x7CThe WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.

WM_SYNCPAINT 0x88The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.

WM_SYSCHAR 0x106

The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down.

WM_SYSCOLORCHANGE 0x15This message is sent to all top-level windows when a change is made to a system color setting.

WM_SYSCOMMAND 0x112

A window receives this message when the user chooses a command from the Window menu (formerly known as the system or control menu) or when the user chooses the maximize button, minimize button, restore button, or close button.

WM_SYSDEADCHAR 0x107

The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key.

WM_SYSKEYDOWN 0x104 The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in

Page 17: WM Messages

the lParam parameter.

WM_SYSKEYUP 0x105

The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.

WM_TCARD 0x52

Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.

WM_TIMECHANGE 0x1EA message that is sent whenever there is a change in the system time.

WM_TIMER 0x113The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function.

WM_UNDO 0x304

An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.

WM_UNINITMENUPOPUP 0x125The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed.

WM_USER 0x400

The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value.

WM_USERCHANGED 0x54

The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.

WM_VKEYTOITEM 0x2ESent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message.

WM_VSCROLL 0x115

The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.

WM_VSCROLLCLIPBOARD 0x30A

The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values.

WM_WINDOWPOSCHANGED 0x47 The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has

Page 18: WM Messages

changed as a result of a call to the SetWindowPos function or another window-management function.

WM_WINDOWPOSCHANGING 0x46

The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.

WM_WININICHANGE 0x1A

An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI. Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.

WM_XBUTTONDBLCLK 0x20D

The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_XBUTTONDOWN 0x20B

The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

WM_XBUTTONUP 0x20C

The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.

C# Constants:private const UInt32 WM_ACTIVATE = 0x0006;private const UInt32 WM_ACTIVATEAPP = 0x001C;private const UInt32 WM_AFXFIRST = 0x0360;private const UInt32 WM_AFXLAST = 0x037F;private const UInt32 WM_APP = 0x8000;private const UInt32 WM_ASKCBFORMATNAME = 0x030C;private const UInt32 WM_CANCELJOURNAL = 0x004B;private const UInt32 WM_CANCELMODE = 0x001F;private const UInt32 WM_CAPTURECHANGED = 0x0215;private const UInt32 WM_CHANGECBCHAIN = 0x030D;private const UInt32 WM_CHANGEUISTATE = 0x0127;private const UInt32 WM_CHAR = 0x0102;private const UInt32 WM_CHARTOITEM = 0x002F;private const UInt32 WM_CHILDACTIVATE = 0x0022;

Page 19: WM Messages

private const UInt32 WM_CLEAR = 0x0303;private const UInt32 WM_CLOSE = 0x0010;private const UInt32 WM_COMMAND = 0x0111;private const UInt32 WM_COMPACTING = 0x0041;private const UInt32 WM_COMPAREITEM = 0x0039;private const UInt32 WM_CONTEXTMENU = 0x007B;private const UInt32 WM_COPY = 0x0301;private const UInt32 WM_COPYDATA = 0x004A;private const UInt32 WM_CREATE = 0x0001;private const UInt32 WM_CTLCOLORBTN = 0x0135;private const UInt32 WM_CTLCOLORDLG = 0x0136;private const UInt32 WM_CTLCOLOREDIT = 0x0133;private const UInt32 WM_CTLCOLORLISTBOX = 0x0134;private const UInt32 WM_CTLCOLORMSGBOX = 0x0132;private const UInt32 WM_CTLCOLORSCROLLBAR = 0x0137;private const UInt32 WM_CTLCOLORSTATIC = 0x0138;private const UInt32 WM_CUT = 0x0300;private const UInt32 WM_DEADCHAR = 0x0103;private const UInt32 WM_DELETEITEM = 0x002D;private const UInt32 WM_DESTROY = 0x0002;private const UInt32 WM_DESTROYCLIPBOARD = 0x0307;private const UInt32 WM_DEVICECHANGE = 0x0219;private const UInt32 WM_DEVMODECHANGE = 0x001B;private const UInt32 WM_DISPLAYCHANGE = 0x007E;private const UInt32 WM_DRAWCLIPBOARD = 0x0308;private const UInt32 WM_DRAWITEM = 0x002B;private const UInt32 WM_DROPFILES = 0x0233;private const UInt32 WM_ENABLE = 0x000A;private const UInt32 WM_ENDSESSION = 0x0016;private const UInt32 WM_ENTERIDLE = 0x0121;private const UInt32 WM_ENTERMENULOOP = 0x0211;private const UInt32 WM_ENTERSIZEMOVE = 0x0231;private const UInt32 WM_ERASEBKGND = 0x0014;private const UInt32 WM_EXITMENULOOP = 0x0212;private const UInt32 WM_EXITSIZEMOVE = 0x0232;private const UInt32 WM_FONTCHANGE = 0x001D;private const UInt32 WM_GETDLGCODE = 0x0087;private const UInt32 WM_GETFONT = 0x0031;private const UInt32 WM_GETHOTKEY = 0x0033;private const UInt32 WM_GETICON = 0x007F;private const UInt32 WM_GETMINMAXINFO = 0x0024;private const UInt32 WM_GETOBJECT = 0x003D;private const UInt32 WM_GETTEXT = 0x000D;private const UInt32 WM_GETTEXTLENGTH = 0x000E;private const UInt32 WM_HANDHELDFIRST = 0x0358;private const UInt32 WM_HANDHELDLAST = 0x035F;private const UInt32 WM_HELP = 0x0053;private const UInt32 WM_HOTKEY = 0x0312;private const UInt32 WM_HSCROLL = 0x0114;

Page 20: WM Messages

private const UInt32 WM_HSCROLLCLIPBOARD = 0x030E;private const UInt32 WM_ICONERASEBKGND = 0x0027;private const UInt32 WM_IME_CHAR = 0x0286;private const UInt32 WM_IME_COMPOSITION = 0x010F;private const UInt32 WM_IME_COMPOSITIONFULL = 0x0284;private const UInt32 WM_IME_CONTROL = 0x0283;private const UInt32 WM_IME_ENDCOMPOSITION = 0x010E;private const UInt32 WM_IME_KEYDOWN = 0x0290;private const UInt32 WM_IME_KEYLAST = 0x010F;private const UInt32 WM_IME_KEYUP = 0x0291;private const UInt32 WM_IME_NOTIFY = 0x0282;private const UInt32 WM_IME_REQUEST = 0x0288;private const UInt32 WM_IME_SELECT = 0x0285;private const UInt32 WM_IME_SETCONTEXT = 0x0281;private const UInt32 WM_IME_STARTCOMPOSITION = 0x010D;private const UInt32 WM_INITDIALOG = 0x0110;private const UInt32 WM_INITMENU = 0x0116;private const UInt32 WM_INITMENUPOPUP = 0x0117;private const UInt32 WM_INPUTLANGCHANGE = 0x0051;private const UInt32 WM_INPUTLANGCHANGEREQUEST = 0x0050;private const UInt32 WM_KEYDOWN = 0x0100;private const UInt32 WM_KEYFIRST = 0x0100;private const UInt32 WM_KEYLAST = 0x0108;private const UInt32 WM_KEYUP = 0x0101;private const UInt32 WM_KILLFOCUS = 0x0008;private const UInt32 WM_LBUTTONDBLCLK = 0x0203;private const UInt32 WM_LBUTTONDOWN = 0x0201;private const UInt32 WM_LBUTTONUP = 0x0202;private const UInt32 WM_MBUTTONDBLCLK = 0x0209;private const UInt32 WM_MBUTTONDOWN = 0x0207;private const UInt32 WM_MBUTTONUP = 0x0208;private const UInt32 WM_MDIACTIVATE = 0x0222;private const UInt32 WM_MDICASCADE = 0x0227;private const UInt32 WM_MDICREATE = 0x0220;private const UInt32 WM_MDIDESTROY = 0x0221;private const UInt32 WM_MDIGETACTIVE = 0x0229;private const UInt32 WM_MDIICONARRANGE = 0x0228;private const UInt32 WM_MDIMAXIMIZE = 0x0225;private const UInt32 WM_MDINEXT = 0x0224;private const UInt32 WM_MDIREFRESHMENU = 0x0234;private const UInt32 WM_MDIRESTORE = 0x0223;private const UInt32 WM_MDISETMENU = 0x0230;private const UInt32 WM_MDITILE = 0x0226;private const UInt32 WM_MEASUREITEM = 0x002C;private const UInt32 WM_MENUCHAR = 0x0120;private const UInt32 WM_MENUCOMMAND = 0x0126;private const UInt32 WM_MENUDRAG = 0x0123;private const UInt32 WM_MENUGETOBJECT = 0x0124;private const UInt32 WM_MENURBUTTONUP = 0x0122;

Page 21: WM Messages

private const UInt32 WM_MENUSELECT = 0x011F;private const UInt32 WM_MOUSEACTIVATE = 0x0021;private const UInt32 WM_MOUSEFIRST = 0x0200;private const UInt32 WM_MOUSEHOVER = 0x02A1;private const UInt32 WM_MOUSELAST = 0x020D;private const UInt32 WM_MOUSELEAVE = 0x02A3;private const UInt32 WM_MOUSEMOVE = 0x0200;private const UInt32 WM_MOUSEWHEEL = 0x020A;private const UInt32 WM_MOUSEHWHEEL = 0x020E;private const UInt32 WM_MOVE = 0x0003;private const UInt32 WM_MOVING = 0x0216;private const UInt32 WM_NCACTIVATE = 0x0086;private const UInt32 WM_NCCALCSIZE = 0x0083;private const UInt32 WM_NCCREATE = 0x0081;private const UInt32 WM_NCDESTROY = 0x0082;private const UInt32 WM_NCHITTEST = 0x0084;private const UInt32 WM_NCLBUTTONDBLCLK = 0x00A3;private const UInt32 WM_NCLBUTTONDOWN = 0x00A1;private const UInt32 WM_NCLBUTTONUP = 0x00A2;private const UInt32 WM_NCMBUTTONDBLCLK = 0x00A9;private const UInt32 WM_NCMBUTTONDOWN = 0x00A7;private const UInt32 WM_NCMBUTTONUP = 0x00A8;private const UInt32 WM_NCMOUSEMOVE = 0x00A0;private const UInt32 WM_NCPAINT = 0x0085;private const UInt32 WM_NCRBUTTONDBLCLK = 0x00A6;private const UInt32 WM_NCRBUTTONDOWN = 0x00A4;private const UInt32 WM_NCRBUTTONUP = 0x00A5;private const UInt32 WM_NEXTDLGCTL = 0x0028;private const UInt32 WM_NEXTMENU = 0x0213;private const UInt32 WM_NOTIFY = 0x004E;private const UInt32 WM_NOTIFYFORMAT = 0x0055;private const UInt32 WM_NULL = 0x0000;private const UInt32 WM_PAINT = 0x000F;private const UInt32 WM_PAINTCLIPBOARD = 0x0309;private const UInt32 WM_PAINTICON = 0x0026;private const UInt32 WM_PALETTECHANGED = 0x0311;private const UInt32 WM_PALETTEISCHANGING = 0x0310;private const UInt32 WM_PARENTNOTIFY = 0x0210;private const UInt32 WM_PASTE = 0x0302;private const UInt32 WM_PENWINFIRST = 0x0380;private const UInt32 WM_PENWINLAST = 0x038F;private const UInt32 WM_POWER = 0x0048;private const UInt32 WM_POWERBROADCAST = 0x0218;private const UInt32 WM_PRINT = 0x0317;private const UInt32 WM_PRINTCLIENT = 0x0318;private const UInt32 WM_QUERYDRAGICON = 0x0037;private const UInt32 WM_QUERYENDSESSION = 0x0011;private const UInt32 WM_QUERYNEWPALETTE = 0x030F;private const UInt32 WM_QUERYOPEN = 0x0013;

Page 22: WM Messages

private const UInt32 WM_QUEUESYNC = 0x0023;private const UInt32 WM_QUIT = 0x0012;private const UInt32 WM_RBUTTONDBLCLK = 0x0206;private const UInt32 WM_RBUTTONDOWN = 0x0204;private const UInt32 WM_RBUTTONUP = 0x0205;private const UInt32 WM_RENDERALLFORMATS = 0x0306;private const UInt32 WM_RENDERFORMAT = 0x0305;private const UInt32 WM_SETCURSOR = 0x0020;private const UInt32 WM_SETFOCUS = 0x0007;private const UInt32 WM_SETFONT = 0x0030;private const UInt32 WM_SETHOTKEY = 0x0032;private const UInt32 WM_SETICON = 0x0080;private const UInt32 WM_SETREDRAW = 0x000B;private const UInt32 WM_SETTEXT = 0x000C;private const UInt32 WM_SETTINGCHANGE = 0x001A;private const UInt32 WM_SHOWWINDOW = 0x0018;private const UInt32 WM_SIZE = 0x0005;private const UInt32 WM_SIZECLIPBOARD = 0x030B;private const UInt32 WM_SIZING = 0x0214;private const UInt32 WM_SPOOLERSTATUS = 0x002A;private const UInt32 WM_STYLECHANGED = 0x007D;private const UInt32 WM_STYLECHANGING = 0x007C;private const UInt32 WM_SYNCPAINT = 0x0088;private const UInt32 WM_SYSCHAR = 0x0106;private const UInt32 WM_SYSCOLORCHANGE = 0x0015;private const UInt32 WM_SYSCOMMAND = 0x0112;private const UInt32 WM_SYSDEADCHAR = 0x0107;private const UInt32 WM_SYSKEYDOWN = 0x0104;private const UInt32 WM_SYSKEYUP = 0x0105;private const UInt32 WM_TCARD = 0x0052;private const UInt32 WM_TIMECHANGE = 0x001E;private const UInt32 WM_TIMER = 0x0113;private const UInt32 WM_UNDO = 0x0304;private const UInt32 WM_UNINITMENUPOPUP = 0x0125;private const UInt32 WM_USER = 0x0400;private const UInt32 WM_USERCHANGED = 0x0054;private const UInt32 WM_VKEYTOITEM = 0x002E;private const UInt32 WM_VSCROLL = 0x0115;private const UInt32 WM_VSCROLLCLIPBOARD = 0x030A;private const UInt32 WM_WINDOWPOSCHANGED = 0x0047;private const UInt32 WM_WINDOWPOSCHANGING = 0x0046;private const UInt32 WM_WININICHANGE = 0x001A;private const UInt32 WM_XBUTTONDBLCLK = 0x020D;private const UInt32 WM_XBUTTONDOWN = 0x020B;private const UInt32 WM_XBUTTONUP = 0x020C;

VB Constants:Public Enum WndMsg

Page 23: WM Messages

WM_ACTIVATE = &H6 WM_ACTIVATEAPP = &H1C WM_AFXFIRST = &H360 WM_AFXLAST = &H37F WM_APP = &H8000 WM_ASKCBFORMATNAME = &H30C WM_CANCELJOURNAL = &H4B WM_CANCELMODE = &H1F WM_CAPTURECHANGED = &H215 WM_CHANGECBCHAIN = &H30D WM_CHANGEUISTATE = &H127 WM_CHAR = &H102 WM_CHARTOITEM = &H2F WM_CHILDACTIVATE = &H22 WM_CLEAR = &H303 WM_CLOSE = &H10 WM_COMMAND = &H111 WM_COMPACTING = &H41 WM_COMPAREITEM = &H39 WM_CONTEXTMENU = &H7B WM_COPY = &H301 WM_COPYDATA = &H4A WM_CREATE = &H1 WM_CTLCOLORBTN = &H135 WM_CTLCOLORDLG = &H136 WM_CTLCOLOREDIT = &H133 WM_CTLCOLORLISTBOX = &H134 WM_CTLCOLORMSGBOX = &H132 WM_CTLCOLORSCROLLBAR = &H137 WM_CTLCOLORSTATIC = &H138 WM_CUT = &H300 WM_DEADCHAR = &H103 WM_DELETEITEM = &H2D WM_DESTROY = &H2 WM_DESTROYCLIPBOARD = &H307 WM_DEVICECHANGE = &H219 WM_DEVMODECHANGE = &H1B WM_DISPLAYCHANGE = &H7E WM_DRAWCLIPBOARD = &H308 WM_DRAWITEM = &H2B WM_DROPFILES = &H233 WM_ENABLE = &HA WM_ENDSESSION = &H16 WM_ENTERIDLE = &H121 WM_ENTERMENULOOP = &H211 WM_ENTERSIZEMOVE = &H231 WM_ERASEBKGND = &H14 WM_EXITMENULOOP = &H212 WM_EXITSIZEMOVE = &H232

Page 24: WM Messages

WM_FONTCHANGE = &H1D WM_GETDLGCODE = &H87 WM_GETFONT = &H31 WM_GETHOTKEY = &H33 WM_GETICON = &H7F WM_GETMINMAXINFO = &H24 WM_GETOBJECT = &H3D WM_GETTEXT = &HD WM_GETTEXTLENGTH = &HE WM_HANDHELDFIRST = &H358 WM_HANDHELDLAST = &H35F WM_HELP = &H53 WM_HOTKEY = &H312 WM_HSCROLL = &H114 WM_HSCROLLCLIPBOARD = &H30E WM_ICONERASEBKGND = &H27 WM_IME_CHAR = &H286 WM_IME_COMPOSITION = &H10F WM_IME_COMPOSITIONFULL = &H284 WM_IME_CONTROL = &H283 WM_IME_ENDCOMPOSITION = &H10E WM_IME_KEYDOWN = &H290 WM_IME_KEYLAST = &H10F WM_IME_KEYUP = &H291 WM_IME_NOTIFY = &H282 WM_IME_REQUEST = &H288 WM_IME_SELECT = &H285 WM_IME_SETCONTEXT = &H281 WM_IME_STARTCOMPOSITION = &H10D WM_INITDIALOG = &H110 WM_INITMENU = &H116 WM_INITMENUPOPUP = &H117 WM_INPUTLANGCHANGE = &H51 WM_INPUTLANGCHANGEREQUEST = &H50 WM_KEYDOWN = &H100 WM_KEYFIRST = &H100 WM_KEYLAST = &H108 WM_KEYUP = &H101 WM_KILLFOCUS = &H8 WM_LBUTTONDBLCLK = &H203 WM_LBUTTONDOWN = &H201 WM_LBUTTONUP = &H202 WM_MBUTTONDBLCLK = &H209 WM_MBUTTONDOWN = &H207 WM_MBUTTONUP = &H208 WM_MDIACTIVATE = &H222 WM_MDICASCADE = &H227 WM_MDICREATE = &H220 WM_MDIDESTROY = &H221

Page 25: WM Messages

WM_MDIGETACTIVE = &H229 WM_MDIICONARRANGE = &H228 WM_MDIMAXIMIZE = &H225 WM_MDINEXT = &H224 WM_MDIREFRESHMENU = &H234 WM_MDIRESTORE = &H223 WM_MDISETMENU = &H230 WM_MDITILE = &H226 WM_MEASUREITEM = &H2C WM_MENUCHAR = &H120 WM_MENUCOMMAND = &H126 WM_MENUDRAG = &H123 WM_MENUGETOBJECT = &H124 WM_MENURBUTTONUP = &H122 WM_MENUSELECT = &H11F WM_MOUSEACTIVATE = &H21 WM_MOUSEFIRST = &H200 WM_MOUSEHOVER = &H2A1 WM_MOUSELAST = &H20D WM_MOUSELEAVE = &H2A3 WM_MOUSEMOVE = &H200 WM_MOUSEWHEEL = &H20A WM_MOUSEHWHEEL = &H20E WM_MOVE = &H3 WM_MOVING = &H216 WM_NCACTIVATE = &H86 WM_NCCALCSIZE = &H83 WM_NCCREATE = &H81 WM_NCDESTROY = &H82 WM_NCHITTEST = &H84 WM_NCLBUTTONDBLCLK = &HA3 WM_NCLBUTTONDOWN = &HA1 WM_NCLBUTTONUP = &HA2 WM_NCMBUTTONDBLCLK = &HA9 WM_NCMBUTTONDOWN = &HA7 WM_NCMBUTTONUP = &HA8 WM_NCMOUSEMOVE = &HA0 WM_NCPAINT = &H85 WM_NCRBUTTONDBLCLK = &HA6 WM_NCRBUTTONDOWN = &HA4 WM_NCRBUTTONUP = &HA5 WM_NEXTDLGCTL = &H28 WM_NEXTMENU = &H213 WM_NOTIFY = &H4E WM_NOTIFYFORMAT = &H55 WM_NULL = &H0 WM_PAINT = &HF WM_PAINTCLIPBOARD = &H309 WM_PAINTICON = &H26

Page 26: WM Messages

WM_PALETTECHANGED = &H311 WM_PALETTEISCHANGING = &H310 WM_PARENTNOTIFY = &H210 WM_PASTE = &H302 WM_PENWINFIRST = &H380 WM_PENWINLAST = &H38F WM_POWER = &H48 WM_POWERBROADCAST = &H218 WM_PRINT = &H317 WM_PRINTCLIENT = &H318 WM_QUERYDRAGICON = &H37 WM_QUERYENDSESSION = &H11 WM_QUERYNEWPALETTE = &H30F WM_QUERYOPEN = &H13 WM_QUEUESYNC = &H23 WM_QUIT = &H12 WM_RBUTTONDBLCLK = &H206 WM_RBUTTONDOWN = &H204 WM_RBUTTONUP = &H205 WM_RENDERALLFORMATS = &H306 WM_RENDERFORMAT = &H305 WM_SETCURSOR = &H20 WM_SETFOCUS = &H7 WM_SETFONT = &H30 WM_SETHOTKEY = &H32 WM_SETICON = &H80 WM_SETREDRAW = &HB WM_SETTEXT = &HC WM_SETTINGCHANGE = &H1A WM_SHOWWINDOW = &H18 WM_SIZE = &H5 WM_SIZECLIPBOARD = &H30B WM_SIZING = &H214 WM_SPOOLERSTATUS = &H2A WM_STYLECHANGED = &H7D WM_STYLECHANGING = &H7C WM_SYNCPAINT = &H88 WM_SYSCHAR = &H106 WM_SYSCOLORCHANGE = &H15 WM_SYSCOMMAND = &H112 WM_SYSDEADCHAR = &H107 WM_SYSKEYDOWN = &H104 WM_SYSKEYUP = &H105 WM_TCARD = &H52 WM_TIMECHANGE = &H1E WM_TIMER = &H113 WM_UNDO = &H304 WM_UNINITMENUPOPUP = &H125 WM_USER = &H400

Page 27: WM Messages

WM_USERCHANGED = &H54 WM_VKEYTOITEM = &H2E WM_VSCROLL = &H115 WM_VSCROLLCLIPBOARD = &H30A WM_WINDOWPOSCHANGED = &H47 WM_WINDOWPOSCHANGING = &H46 WM_WININICHANGE = &H1A WM_XBUTTONDBLCLK = &H20D WM_XBUTTONDOWN = &H20B WM_XBUTTONUP = &H20CEnd Enum

Masm constants in numeric order:WM_NULL equ 000hWM_CREATE equ 001hWM_DESTROY equ 002hWM_MOVE equ 003hWM_SIZE equ 005hWM_ACTIVATE equ 006hWM_SETFOCUS equ 007hWM_KILLFOCUS equ 008hWM_ENABLE equ 00AhWM_SETREDRAW equ 00BhWM_SETTEXT equ 00ChWM_GETTEXT equ 00DhWM_GETTEXTLENGTH equ 00EhWM_PAINT equ 00FhWM_CLOSE equ 010hWM_QUERYENDSESSION equ 011hWM_QUIT equ 012hWM_QUERYOPEN equ 013hWM_ERASEBKGND equ 014hWM_SYSCOLORCHANGE equ 015hWM_ENDSESSION equ 016hWM_SHOWWINDOW equ 018hWM_SETTINGCHANGE equ 01AhWM_WININICHANGE equ 01AhWM_DEVMODECHANGE equ 01BhWM_ACTIVATEAPP equ 01ChWM_FONTCHANGE equ 01DhWM_TIMECHANGE equ 01EhWM_CANCELMODE equ 01FhWM_SETCURSOR equ 020hWM_MOUSEACTIVATE equ 021hWM_CHILDACTIVATE equ 022hWM_QUEUESYNC equ 023hWM_GETMINMAXINFO equ 024hWM_PAINTICON equ 026h

Page 28: WM Messages

WM_ICONERASEBKGND equ 027hWM_NEXTDLGCTL equ 028hWM_SPOOLERSTATUS equ 02AhWM_DRAWITEM equ 02BhWM_MEASUREITEM equ 02ChWM_DELETEITEM equ 02DhWM_VKEYTOITEM equ 02EhWM_CHARTOITEM equ 02FhWM_SETFONT equ 030hWM_GETFONT equ 031hWM_SETHOTKEY equ 032hWM_GETHOTKEY equ 033hWM_QUERYDRAGICON equ 037hWM_COMPAREITEM equ 039hWM_GETOBJECT equ 03DhWM_COMPACTING equ 041hWM_OTHERWINDOWCREATED equ 042hWM_OTHERWINDOWDESTROYED equ 043hWM_COMMNOTIFY equ 044hWM_WINDOWPOSCHANGING equ 046hWM_WINDOWPOSCHANGED equ 047hWM_POWER equ 048hWM_COPYDATA equ 04AhWM_CANCELJOURNAL equ 04BhWM_NOTIFY equ 04EhWM_INPUTLANGCHANGEREQUEST equ 050hWM_INPUTLANGCHANGE equ 051hWM_TCARD equ 052hWM_HELP equ 053hWM_USERCHANGED equ 054hWM_NOTIFYFORMAT equ 055hWM_CONTEXTMENU equ 07BhWM_STYLECHANGING equ 07ChWM_STYLECHANGED equ 07DhWM_DISPLAYCHANGE equ 07EhWM_GETICON equ 07FhWM_SETICON equ 080hWM_NCCREATE equ 081hWM_NCDESTROY equ 082hWM_NCCALCSIZE equ 083hWM_NCHITTEST equ 084hWM_NCPAINT equ 085hWM_NCACTIVATE equ 086hWM_GETDLGCODE equ 087hWM_SYNCPAINT equ 088hWM_NCMOUSEMOVE equ 0A0hWM_NCLBUTTONDOWN equ 0A1hWM_NCLBUTTONUP equ 0A2hWM_NCLBUTTONDBLCLK equ 0A3h

Page 29: WM Messages

WM_NCRBUTTONDOWN equ 0A4hWM_NCRBUTTONUP equ 0A5hWM_NCRBUTTONDBLCLK equ 0A6hWM_NCMBUTTONDOWN equ 0A7hWM_NCMBUTTONUP equ 0A8hWM_NCMBUTTONDBLCLK equ 0A9hWM_NCXBUTTONDOWN equ 0ABhWM_NCXBUTTONUP equ 0AChWM_NCXBUTTONDBLCLK equ 0ADhWM_KEYFIRST equ 100hWM_KEYDOWN equ 100hWM_KEYUP equ 101hWM_CHAR equ 102hWM_DEADCHAR equ 103hWM_SYSKEYDOWN equ 104hWM_SYSKEYUP equ 105hWM_SYSCHAR equ 106hWM_SYSDEADCHAR equ 107hWM_KEYLAST equ 108hWM_UNICHAR equ 109hWM_IME_STARTCOMPOSITION equ 10DhWM_IME_ENDCOMPOSITION equ 10EhWM_IME_COMPOSITION equ 10FhWM_IME_KEYLAST equ 10FhWM_INITDIALOG equ 110hWM_COMMAND equ 111hWM_SYSCOMMAND equ 112hWM_TIMER equ 113hWM_HSCROLL equ 114hWM_VSCROLL equ 115hWM_INITMENU equ 116hWM_INITMENUPOPUP equ 117hWM_MENUSELECT equ 11FhWM_MENUCHAR equ 120hWM_ENTERIDLE equ 121hWM_MENURBUTTONUP equ 122hWM_MENUDRAG equ 123hWM_MENUGETOBJECT equ 124hWM_UNINITMENUPOPUP equ 125hWM_MENUCOMMAND equ 126hWM_CHANGEUISTATE equ 127hWM_UPDATEUISTATE equ 128hWM_QUERYUISTATE equ 129hWM_CTLCOLORMSGBOX equ 132hWM_CTLCOLOREDIT equ 133hWM_CTLCOLORLISTBOX equ 134hWM_CTLCOLORBTN equ 135hWM_CTLCOLORDLG equ 136hWM_CTLCOLORSCROLLBAR equ 137h

Page 30: WM Messages

WM_CTLCOLORSTATIC equ 138hWM_MOUSEFIRST equ 200hWM_MOUSEMOVE equ 200hWM_LBUTTONDOWN equ 201hWM_LBUTTONUP equ 202hWM_LBUTTONDBLCLK equ 203hWM_RBUTTONDOWN equ 204hWM_RBUTTONUP equ 205hWM_RBUTTONDBLCLK equ 206hWM_MBUTTONDOWN equ 207hWM_MBUTTONUP equ 208hWM_MOUSELAST equ 209hWM_MBUTTONDBLCLK equ 209hWM_MOUSEWHEEL equ 20AhWM_MOUSEHWHEEL equ 20EhWM_XBUTTONDOWN equ 20BhWM_XBUTTONUP equ 20ChWM_XBUTTONDBLCLK equ 20DhWM_PARENTNOTIFY equ 210hWM_ENTERMENULOOP equ 211hWM_EXITMENULOOP equ 212hWM_NEXTMENU equ 213hWM_SIZING equ 214hWM_CAPTURECHANGED equ 215hWM_MOVING equ 216hWM_POWERBROADCAST equ 218hWM_DEVICECHANGE equ 219hWM_MDICREATE equ 220hWM_MDIDESTROY equ 221hWM_MDIACTIVATE equ 222hWM_MDIRESTORE equ 223hWM_MDINEXT equ 224hWM_MDIMAXIMIZE equ 225hWM_MDITILE equ 226hWM_MDICASCADE equ 227hWM_MDIICONARRANGE equ 228hWM_MDIGETACTIVE equ 229hWM_MDISETMENU equ 230hWM_ENTERSIZEMOVE equ 231hWM_EXITSIZEMOVE equ 232hWM_DROPFILES equ 233hWM_MDIREFRESHMENU equ 234hWM_NCMOUSEHOVER equ 2A0hWM_MOUSEHOVER equ 2A1hWM_IME_SETCONTEXT equ 281hWM_IME_NOTIFY equ 282hWM_IME_CONTROL equ 283hWM_IME_COMPOSITIONFULL equ 284hWM_IME_SELECT equ 285h

Page 31: WM Messages

WM_IME_CHAR equ 286hWM_IME_REQUEST equ 288hWM_IME_KEYDOWN equ 290hWM_IME_KEYUP equ 291hWM_MOUSEHOVER equ 2A1hWM_NCMOUSELEAVE equ 2A2hWM_MOUSELEAVE equ 2A3hWM_WTSSESSION_CHANGE equ 2B1hWM_TABLET_FIRST equ 2c0hWM_TABLET_LAST equ 2dfhWM_CUT equ 300hWM_COPY equ 301hWM_PASTE equ 302hWM_CLEAR equ 303hWM_UNDO equ 304hWM_RENDERFORMAT equ 305hWM_RENDERALLFORMATS equ 306hWM_DESTROYCLIPBOARD equ 307hWM_DRAWCLIPBOARD equ 308hWM_PAINTCLIPBOARD equ 309hWM_VSCROLLCLIPBOARD equ 30AhWM_SIZECLIPBOARD equ 30BhWM_ASKCBFORMATNAME equ 30ChWM_CHANGECBCHAIN equ 30DhWM_HSCROLLCLIPBOARD equ 30EhWM_QUERYNEWPALETTE equ 30FhWM_PALETTEISCHANGING equ 310hWM_PALETTECHANGED equ 311hWM_HOTKEY equ 312hWM_PRINT equ 317hWM_PRINTCLIENT equ 318hWM_APPCOMMAND equ 319hWM_THEMECHANGED equ 31AhWM_HANDHELDFIRST equ 358hWM_HANDHELDLAST equ 35FhWM_AFXFIRST equ 360hWM_AFXLAST equ 37FhWM_PENWINFIRST equ 380hWM_PENWINLAST equ 38FhWM_USER equ 400h

Horizontal Scrolling Support for C++#ifndef WM_MOUSEHWHEEL#define WM_MOUSEHWHEEL 0x20E#endif