Reflected Window Message IDs

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

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 controlMessage reflected to the control
WM_COMMANDOCM_COMMAND
WM_CTLCOLORBTNOCM_CTLCOLORBTN
WM_CTLCOLOREDITOCM_CTLCOLOREDIT
WM_CTLCOLORDLGOCM_CTLCOLORDLG
WM_CTLCOLORLISTBOXOCM_CTLCOLORLISTBOX
WM_CTLCOLORSCROLLBAROCM_CTLCOLORSCROLLBAR
WM_CTLCOLORSTATICOCM_CTLCOLORSTATIC
WM_DRAWITEMOCM_DRAWITEM
WM_MEASUREITEMOCM_MEASUREITEM
WM_DELETEITEMOCM_DELETEITEM
WM_VKEYTOITEMOCM_VKEYTOITEM
WM_CHARTOITEMOCM_CHARTOITEM
WM_COMPAREITEMOCM_COMPAREITEM
WM_HSCROLLOCM_HSCROLL
WM_VSCROLLOCM_VSCROLL
WM_PARENTNOTIFYOCM_PARENTNOTIFY
WM_NOTIFYOCM_NOTIFY
System_CAPS_ICON_note.jpg 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.

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

Show: