怎样做到一个对话框始终在最前面

孟如庭 2014-10-13 09:38:34
工具弹出一个对话框,怎么样才能做到始终在最前面呢?只有关闭该对话框才结束。否则,进行其他操作,比如浏览器打开新网页,该对话框还是在最前面。
...全文
685 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
shen_wei 2014-10-13
  • 打赏
  • 举报
回复
HWND_TOPMOST SetWindowPos 函数。。
孟如庭 2014-10-13
  • 打赏
  • 举报
回复
恩。属性中设置TOP_MOST即可。谢谢各位
oyljerry 2014-10-13
  • 打赏
  • 举报
回复
桌面悬浮窗口等 SetWindowPos TOP_MOST
浩南_哥 2014-10-13
  • 打赏
  • 举报
回复
设个Timer,隔几百毫秒设置一下,窗体置顶
傻X 2014-10-13
  • 打赏
  • 举报
回复
我记得有个WS_EX_TOPMOST,是窗口的Style。 当然你也可以控制失焦点事件来达到效果
lx624909677 2014-10-13
  • 打赏
  • 举报
回复
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); }

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧