Share via


CWnd::SetForegroundWindow

Puts the thread that created the window into the foreground and activates the window.

BOOL SetForegroundWindow(   );

Return Value

Nonzero if the function is successful; otherwise 0.

Remarks

Keyboard input is directed to the window, and various visual cues are changed for the user. The foreground window is the window with which the user is currently working. The foreground window applies only to top-level windows (frame windows or dialogs boxes).

Example

See the example for CWnd::FindWindow.

Requirements

Header: afxwin.h

See Also

Reference

CWnd Class

Hierarchy Chart

CWnd::GetForegroundWindow