码迷,mamicode.com
首页 > 其他好文 > 详细

窗口置顶方法

时间:2016-10-13 11:37:52      阅读:99      评论:0      收藏:0      [点我收藏+]

标签:

CWindow::SetWindowPos

BOOL SetWindowPos( HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags );

BOOL SetWindowPos( HWND hWndInsertAfter, LPCRECT lpRect, UINT nFlags );

 

1 BOOL CXXX::OnInitDialog()
2 {
3   CRect rect;
4    GetWindowRect(&rect);
5     ::SetWindowPos(this->m_hWnd,HWND_TOPMOST,Rect.left,Rect.top,
6             Rect.Width(),Rect.Height(),SWP_NOMOVE | SWP_NOSIZE);
7 }

 

 

 

BringWindowToTop

This function brings the specified window to the top of the z-order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated.

BOOL BringWindowToTop( 
HWND hWnd );

Parameters

hWnd
Handle to the window to bring to the top of the z-order.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

 

bringwindowtotop 如果窗口为顶层窗口,则该窗口被激活;如果窗口为子窗口,则相应的顶级父窗口被激活。

 

窗口置顶方法

标签:

原文地址:http://www.cnblogs.com/wuguoqiang/p/5955683.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!