Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the WIN32 API WM_REFLECT message for?

Tags:

winapi

I can't find documentation for it, even on MSDN...

like image 228
Corey Trager Avatar asked Oct 14 '08 15:10

Corey Trager


People also ask

What is message reflection?

Message reflection lets you handle messages for a control, such as WM_CTLCOLOR, WM_COMMAND, and WM_NOTIFY, within the control itself. This makes the control more self-contained and portable. The mechanism works with Windows common controls as well as with ActiveX controls (formerly called OLE controls).

What is window message?

The operating system communicates with your application window by passing messages to it. A message is simply a numeric code that designates a particular event. For example, if the user presses the left mouse button, the window receives a message that has the following message code.

What is message loop in windows programming?

The message loop is an obligatory section of code in every program that uses a graphical user interface under Microsoft Windows. Windows programs that have a GUI are event-driven. Windows maintains an individual message queue for each thread that has created a window. Usually only the first thread creates windows.

What is message in visual programming?

Windows MessagesThe system passes input to a window procedure in the form of a message. Messages are generated by both the system and applications. The system generates a message at each input event—for example, when the user types, moves the mouse, or clicks a control such as a scroll bar.


1 Answers

It's not Win32; it's MFC. Ordinarily, a Win32 control raises events by sending a message to its parent window. However, if you've got your own class derived from one of MFC's wrappers (e.g. you've wrapped CTreeCtrl with CMyFunkyTreeCtrl), you might want to handle these events in the derived class.

MFC uses these reflection messages to bounce the event back to the class itself, where your derived class can see them.

Look at TN062: Message Reflection for Windows Controls (MFC) for more information.

like image 122
Roger Lipscombe Avatar answered Sep 28 '22 09:09

Roger Lipscombe