| Message | Map entry | Description |
|---|---|---|
| WM_ACTIVATE | ON_WM_ACTIVATE() | The framework calls this member function when a CWnd object is being activated or deactivated. |
| WM_ACTIVATEA PP | ON_WM_ACTIVATEAPP() | The framework calls this member function to all top-level windows of the task being activated and for all top-level windows of the task being deactivated. |
| WM_APPCOMM AND | ON_WM_APPCOMMAND() | The framework calls this member function when the user generates an application command event. |
| WM_CANCELMODE | WM_CANCELMODE() | The framework calls this member function to inform CWnd to cancel any internal mode. |
| WM_CHILDACTIVATE | ON_WM_CHILDACTIVATE() | If the CWnd object is a multiple document interface (MDI) child window, OnChildActivate is called by the framework when the user clicks the window's title bar or when the window is activated, moved, or sized. |
| WM_CLIPBOAR DUPDATE | ON_WM_CLIPBOARDUPDATE() | The framework calls this member function when the contents of the clipboard have changed. |
| WM_CLOSE | ON_WM_CLOSE() | The framework calls this member function as a signal that the CWnd or an application is to terminate. |
| WM_CONTEXTMENU | ON_WM_CONTEXTMENU() | Called by the framework when the user has clicked the right mouse button (rightclicked) in the window. |
| WM_COPYDATA | ON_WM_COPYDATA() | This member function is called by the framework to copy data from one application to another. |
| WM_CREATE | ON_WM_CREATE() | The framework calls this member function when an application requests that the Windows window be created by calling the Create or CreateEx member function. |
| WM_CTLCOLOR | ON_WM_CTLCOLOR() | The framework calls this member function when a child control is about to be drawn. |
| WM_DELETEITEM | ON_WM_DELETEITEM() | The framework calls this member function to inform the owner of an owner-draw list box or combo box that the list box or combo box is destroyed or that items have been removed. |
| WM_DESTROY | ON_WM_DESTROY() | he framework calls this member function to inform the CWnd object that it is being destroyed. |
| WM_DRAWITEM | ON_WM_DRAWITEM() | The framework calls this member function for the owner of an owner-draw button control, combo-box control, list-box control, or menu when a visual aspect of the control or menu has changed. |
| WM_DROPFILES | ON_WM_DROPFILES() | The framework calls this member function when the user releases the left mouse button over a window that has registered itself as the recipient of dropped files. |
| WM_ENABLE | ON_WM_ENABLE() | The framework calls this member function when an application changes the enabled state of the CWnd object. Syntax. |
| WM_HELPINFO | ON_WM_HELPINFO() | Handles F1 Help within the application (using the current context). |
| WM_HOTKEY | ON_WM_HOTKEY() | The framework calls this member function when the user presses a system-wide hot key. |
| WM_HSCROLL | ON_WM_HSCROLL() | The framework calls this member function when the user clicks a window's horizontal scroll bar. |
| WM_KEYDOWN | ON_WM_KEYDOWN() | The framework calls this member function when a nonsystem key is pressed. |
| WM_KEYUP | ON_WM_KEYUP() | The framework calls this member function when a nonsystem key is released. |
| WM_KILLFOCUS | ON_WM_KILLFOCUS() | The framework calls this member function immediately before losing the input focus. |
| WM_LBUTTONDBLCLK | ON_WM_LBUTTONDBLCLK() | The framework calls this member function when the user double-clicks the left mouse button. |
| WM_LBUTTONDOWN | ON_WM_LBUTTONDOWN() | The framework calls this member function when the user presses the left mouse button. |
| WM_LBUTTONUP | ON_WM_LBUTTONUP() | The framework calls this member function when the user releases the left mouse button. |
| WM_MBUTTONDBLCLK | ON_WM_MBUTTONDBLCLK() | The framework calls this member function when the user double-clicks the middle mouse button. |
| WM_MBUTTONDOWN | ON_WM_MBUTTONDOWN() | The framework calls this member function when the user presses the middle mouse button. |
| WM_MBUTTONUP | ON_WM_MBUTTONUP() | The framework calls this member function when the user releases the middle mouse button. |
| WM_MENUSELECT | ON_WM_MENUSELECT() | If the CWnd object is associated with a menu, OnMenuSelect is called by the framework when the user selects a menu item. |
| WM_MOUSEACTIVATE | ON_WM_MOUSEACTIVATE() | The framework calls this member function when the cursor is in an inactive window and the user presses a mouse button. |
| WM_MOUSEHOVER | ON_WM_MOUSEHOVER() | The framework calls this member function when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent. |
| WM_MOUSEHWHEEL | ON_WM_MOUSEHWHEEL() | The framework calls this member when the current window is composed by the Desktop Window Manager (DWM), and that window is maximized. |
| WM_MOUSELEAVE | ON_WM_MOUSELEAVE() | The framework calls this member function when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent. |
| WM_MOUSEMOVE | ON_WM_MOUSEMOVE() | The framework calls this member function when the mouse cursor moves. |
| WM_MOVE | ON_WM_MOVE() | The framework calls this member function after the CWnd object has been moved. |
| WM_PAINT | ON_WM_PAINT() | The framework calls this member function when Windows or an application makes a request to repaint a portion of an application's window. |
| WM_SETFOCUS() | ON_WM_SETFOCUS( ) | The framework calls this member function after gaining the input focus. |
| WM_SIZE( ) | ON_WM_SIZE( ) | The framework calls this member function after the window's size has changed. |
| WM_TIMER | ON_WM_TIMER() | The framework calls this member function after each interval specified in the SetTimer member function used to install a timer. |
| WM_VSCROLL | ON_WM_VSCROLL() | The framework calls this member function when the user clicks the window's vertical scroll bar. |
| WM_WINDOWPOSCHANGED | ON_WM_WINDOWPOSCHANGED() | The framework calls this member function when the size, position, or Z-order has changed as a result of a call to the SetWindowPos member function or another window-management function. |
| Sr.No. | Constant/value & Description |
|---|---|
| 1 | VK_LBUTTON Left mouse button |
| 2 | VK_RBUTTON Right mouse button |
| 3 | VK_CANCEL Control-break processing |
| 4 | VK_MBUTTON Middle mouse button (three-button mouse) |
| 5 | VK_BACK BACKSPACE key |
| 6 | VK_RETURN ENTER key |
| 7 | VK_TAB TAB key |
| 8 | VK_CLEAR CLEAR key |
| 9 | VK_SHIFT SHIFT key |
| 10 | VK_CONTROL CTRL key |
| 11 | VK_MENU ALT key |
| 12 | VK_PAUSE PAUSE key |
| 13 | VK_CAPITAL CAPS LOCK key |
| 14 | VK_ESCAPE ESC key |
| 15 | VK_SPACE SPACEBAR |
| 16 | VK_PRIOR PAGE UP key |
| 17 | VK_NEXT PAGE DOWN key |
| 18 | VK_END END key |
| 19 | VK_HOME HOME key |
| 20 | VK_LEFT LEFT ARROW key |
| 21 | VK_UP UP ARROW key |
| 22 | VK_RIGHT RIGHT ARROW key |
| 23 | VK_DOWN DOWN ARROW key |
| 24 | VK_SELECT SELECT key |
| 25 | VK_PRINT PRINT key |
| 26 | VK_EXECUTE EXECUTE key |
| 27 | VK_SNAPSHOT PRINT SCREEN key |
| 28 | VK_INSERT INS key |
| 29 | VK_DELETE DEL key |
| 30 | VK_NUMPAD0 Numeric keypad 0 key |
| 31 | VK_NUMPAD1 Numeric keypad 1 key |
| 32 | VK_NUMPAD2 Numeric keypad 2 key |
| 33 | VK_NUMPAD3 Numeric keypad 3 key |
| 34 | VK_NUMPAD4 Numeric keypad 4 key |
| 35 | VK_NUMPAD5 Numeric keypad 5 key |
| 36 | VK_NUMPAD6 Numeric keypad 6 key |
| 37 | VK_NUMPAD7 Numeric keypad 7 key |
| 38 | VK_NUMPAD8 Numeric keypad 8 key |
| 39 | VK_NUMPAD9 Numeric keypad 9 key |
| 40 | VK_MULTIPLY Multiply key |
| 41 | VK_ADD Add key |
| 42 | VK_SEPARATOR Separator key |
| 43 | VK_SUBTRACT Subtract key |
| 44 | VK_DECIMAL Decimal key |
| 45 | VK_DIVIDE Divide key |
| 46 | VK_F1 F1 key |
| 47 | VK_F2 F2 key |
| 48 | VK_F3 F3 key |
| 49 | VK_F4 F4 key |
| 50 | VK_F5 F5 key |
| 52 | VK_F6 F6 key |
| 53 | VK_F7 F7 key |
| 54 | VK_F8 F8 key |
| 55 | VK_F9 F9 key |
| 56 | VK_F10 F10 key |
| 57 | VK_F11 F11 key |
| 58 | VK_F12 F12 key |
| 59 | VK_NUMLOCK NUM LOCK key |
| 60 | VK_SCROLL SCROLL LOCK key |
| 61 | VK_LSHIFT Left SHIFT key |
| 62 | VK_RSHIFT Right SHIFT key |
| 63 | VK_LCONTROL Left CONTROL key |
| 64 | VK_RCONTROL Right CONTROL key |
