Controls and the Mouse

Controls are implemented as small child windows. These windows do not look like normal application windows. Instead, they define a rectangular region of the application window that holds the control. In this sense, they are similar to subwindows. The difference is that these child windows are maintained by the host graphical system.

In the general model for graphical user interfaces, the system directs events to the window where the event occurred. This window owns the event. The effect of this is most noticeable when you examine what happens when controls interact with the mouse. As the mouse moves across the application screen, the various windows that the pointer passes over each receive the appropriate events. If you look at an application screen that has several controls, the application window receives those mouse events that occur when the pointer is in the application window, but not over any of the controls. When the mouse pointer is over a control, that control receives the mouse events.

This means that the setting of the runtime configuration variable MOUSE_FLAGS affects the behavior of the mouse only when it is not over a control. When the mouse is over a control, that control does its own mouse processing.

If you need to process the mouse while it is over a control, there are two options:

Note: It is rare that your program would need to manage the mouse directly. In most cases, controls manage their own mouse messages without any intervention by the program.