怎么做到一个对话框始终在最前面
怎样做到一个对话框始终在最前面
工具弹出一个对话框,怎么样才能做到始终在最前面呢?只有关闭该对话框才结束。否则,进行其他操作,比如浏览器打开新网页,该对话框还是在最前面。
------解决思路----------------------
SetWindowPos函数用法,::SetWindowPos(GetSafeHwnd(),HWND_TOPMOST,0,0,0,0,SWP_NOSIZE
------解决思路----------------------
SWP_NOMOVE);
void CMyApp::OnHideApplication()
{
//m_pMainWnd is the main application window, a member of CMyApp
ASSERT_VALID(m_pMainWnd);
// hide the application's windows before closing all the documents
m_pMainWnd->ShowWindow(SW_HIDE);
m_pMainWnd->ShowOwnedPopups(FALSE);
// put the window at the bottom of z-order, so it isn't activated
m_pMainWnd->SetWindowPos(&CWnd::wndBottom, 0, 0, 0, 0,
SWP_NOMOVE
------解决思路----------------------
SWP_NOSIZE
------解决思路----------------------
SWP_NOACTIVATE);
}
------解决思路----------------------
我记得有个WS_EX_TOPMOST,是窗口的Style。
当然你也可以控制失焦点事件来达到效果
------解决思路----------------------
设个Timer,隔几百毫秒设置一下,窗体置顶
------解决思路----------------------
桌面悬浮窗口等 SetWindowPos TOP_MOST
------解决思路----------------------
HWND_TOPMOST
SetWindowPos 函数。。
工具弹出一个对话框,怎么样才能做到始终在最前面呢?只有关闭该对话框才结束。否则,进行其他操作,比如浏览器打开新网页,该对话框还是在最前面。
------解决思路----------------------
SetWindowPos函数用法,::SetWindowPos(GetSafeHwnd(),HWND_TOPMOST,0,0,0,0,SWP_NOSIZE
------解决思路----------------------
SWP_NOMOVE);
void CMyApp::OnHideApplication()
{
//m_pMainWnd is the main application window, a member of CMyApp
ASSERT_VALID(m_pMainWnd);
// hide the application's windows before closing all the documents
m_pMainWnd->ShowWindow(SW_HIDE);
m_pMainWnd->ShowOwnedPopups(FALSE);
// put the window at the bottom of z-order, so it isn't activated
m_pMainWnd->SetWindowPos(&CWnd::wndBottom, 0, 0, 0, 0,
SWP_NOMOVE
------解决思路----------------------
SWP_NOSIZE
------解决思路----------------------
SWP_NOACTIVATE);
}
------解决思路----------------------
我记得有个WS_EX_TOPMOST,是窗口的Style。
当然你也可以控制失焦点事件来达到效果
------解决思路----------------------
设个Timer,隔几百毫秒设置一下,窗体置顶
------解决思路----------------------
桌面悬浮窗口等 SetWindowPos TOP_MOST
------解决思路----------------------
HWND_TOPMOST
SetWindowPos 函数。。