共用方式為


CWnd::BringWindowToTop

Brings CWnd to the top of a stack of overlapping windows.

void BringWindowToTop( );

Remarks

In addition, BringWindowToTop activates pop-up, top-level, and MDI child windows. The BringWindowToTop member function should be used to uncover any window that is partially or completely obscured by any overlapping windows.

This function just calls the Win32 BringWindowToTop function. The SetWindowPos function to change a window's position in the Z-order. The BringWindowToTop function does not change the window style to make it a top-level window. For more information, see What's the difference between HWND_TOP and HWND_TOPMOST?

Example

// Moves MDI child windows to the top when a mouse passes
// over it. CMdiView is derived from CView.
void CMdiView::OnMouseMove(UINT nFlags, CPoint point) 
{
   UNREFERENCED_PARAMETER(nFlags);
   UNREFERENCED_PARAMETER(point);

   GetParentFrame()->BringWindowToTop();
}

Requirements

Header: afxwin.h

See Also

Reference

CWnd Class

Hierarchy Chart

BringWindowToTop

Concepts

CWnd Members