Skip to content

Latest commit

 

History

History
43 lines (36 loc) · 3.89 KB

reflected-window-message-ids.md

File metadata and controls

43 lines (36 loc) · 3.89 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Reflected Window Message IDs
Reflected Window Message IDs
11/04/2016
OCM_CTLCOLORBTN
OCM_PARENTNOTIFY
OCM_VKEYTOITEM
OCM_CTLCOLORSTATIC
OCM_HSCROLL
OCM_CHARTOITEM
OCM_DRAWITEM
OCM_MEASUREITEM
OCM_COMPAREITEM
OCM_COMMAND
OCM_NOTIFY
OCM_CTLCOLORMSGBOX
OCM_DELETEITEM
OCM_CTLCOLORLISTBOX
OCM_CTLCOLORDLG
OCM_CTLCOLOREDIT
OCM_CTLCOLORSCROLLBAR
OCM_VSCROLL
OCM_CTLCOLOR
OCM_HSCROLL message [MFC]
OCM_PARENTNOTIFY message [MFC]
messages, reflected
reflected messages, window message Ids
OCM_CTLCOLORDLG message [MFC]
OCM_COMMAND message [MFC]
OCM_CTLCOLORMSGBOX message [MFC]
OCM_COMPAREITEM message [MFC]
OCM_DRAWITEM message [MFC]
OCM_VSCROLL message [MFC]
OCM_CTLCOLOREDIT message [MFC]
OCM_VKEYTOITEM message [MFC]
OCM_CHARTOITEM message [MFC]
OCM_CTLCOLORBTN message [MFC]
OCM_CTLCOLORSTATIC message [MFC]
OCM_MEASUREITEM message [MFC]
OCM_CTLCOLOR message [MFC]
OCM_CTLCOLORSCROLLBAR message [MFC]
OCM_ messages
OCM_DELETEITEM message [MFC]
OCM_CTLCOLORLISTBOX message [MFC]
OCM_NOTIFY message [MFC]
reflected messages
3417ff51-ff9f-458c-bff4-17c200f00d96

Reflected Window Message IDs

A quick way to create an ActiveX control, or other specialized control, is to subclass a window. For more information, see MFC ActiveX Controls: Subclassing a Windows Control.

To prevent the control's container from receiving the window messages sent by a subclassed Windows control, COleControl creates a "reflector" window to intercept certain window messages and send them back to the control. The control, in its window procedure, can then process these reflected messages by taking actions appropriate for an ActiveX control.

The following table shows the messages that are intercepted and the corresponding messages that the reflector window sends.

Message sent by the control Message reflected to the control
WM_COMMAND OCM_COMMAND
WM_CTLCOLORBTN OCM_CTLCOLORBTN
WM_CTLCOLOREDIT OCM_CTLCOLOREDIT
WM_CTLCOLORDLG OCM_CTLCOLORDLG
WM_CTLCOLORLISTBOX OCM_CTLCOLORLISTBOX
WM_CTLCOLORSCROLLBAR OCM_CTLCOLORSCROLLBAR
WM_CTLCOLORSTATIC OCM_CTLCOLORSTATIC
WM_DRAWITEM OCM_DRAWITEM
WM_MEASUREITEM OCM_MEASUREITEM
WM_DELETEITEM OCM_DELETEITEM
WM_VKEYTOITEM OCM_VKEYTOITEM
WM_CHARTOITEM OCM_CHARTOITEM
WM_COMPAREITEM OCM_COMPAREITEM
WM_HSCROLL OCM_HSCROLL
WM_VSCROLL OCM_VSCROLL
WM_PARENTNOTIFY OCM_PARENTNOTIFY
WM_NOTIFY OCM_NOTIFY

Note

If the control runs on a Win32 system, there are several types of WM_CTLCOLOR* messages it may receive. For more information, see WM_CTLCOLORBTN, WM_CTLCOLORDLG, WM_CTLCOLOREDIT, WM_CTLCOLORLISTBOX, WM_CTLCOLORMSGBOX, WM_CTLCOLORSCROLLBAR, WM_CTLCOLORSTATIC.

See also

MFC ActiveX Controls: Subclassing a Windows Control
TN062: Message Reflection for Windows Controls