1.BOOL SetForegroundWindow( HWND hWnd );2.BOOL SetWindowPos( HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags ); hWndInsertAfter :HWND_TOPMOST Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.3.BOOL SetWindowPos( const CWnd* pWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags );pWndInsertAfter :wndTopMost Places the window above all nontopmost windows. The window maintains its topmost position even when it is deactivated.
or SWP_NOACTIVATE);
2.SetForegroundWindow( );
例子程序
);2.BOOL SetWindowPos( HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags
);
hWndInsertAfter :HWND_TOPMOST
Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.3.BOOL SetWindowPos(
const CWnd* pWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT nFlags
);pWndInsertAfter :wndTopMost
Places the window above all nontopmost windows. The window maintains its topmost position even when it is deactivated.