Share via

Managing the Current View

As part of the default implementation of frame windows, a frame window keeps track of a currently active view. If the frame window contains more than one view, as for example in a splitter window, the current view is the most recent view in use. The active view is independent of the active window in Windows or the current input focus.

When the active view changes, the framework notifies the current view by calling its OnActivateView member function. You can tell whether the view is being activated or deactivated by examining OnActivateView's bActivate parameter. By default, OnActivateView sets the focus to the current view on activation. You can override OnActivateView to perform any special processing when the view is deactivated or reactivated. For example, you might want to provide special visual cues to distinguish the active view from other, inactive views.

A frame window forwards commands to its current (active) view, as described in Command Routing, as part of the standard command routing.

See also

Using Frame Windows