Share via


COleControl::SetFocus

Causes the control's container window to take possession of the input focus on the control's behalf.

CWnd* SetFocus( );

Return Value

A pointer to the CWnd window object that previously had the input focus, or NULL if there is no such window.

Remarks

If the control is activated and windowless, this function causes the control's container window to take possession of the input focus, on the control's behalf. The input focus directs keyboard input to the container's window, and the container dispatches all subsequent keyboard messages to the OLE object that calls SetFocus. Any window that previously had the input focus loses it.

If the control is not windowless, this function causes the control itself to take possession of the input focus (same as CWnd::SetFocus).

Requirements

Header: afxctl.h

See Also

Reference

COleControl Class

Hierarchy Chart

COleControl::GetFocus

Other Resources

COleControl Members