windows窗口setparent、setowner

编程入门 行业动态 更新时间:2024-10-28 02:22:19

windows<a href=https://www.elefans.com/category/jswz/34/1771087.html style=窗口setparent、setowner"/>

windows窗口setparent、setowner

window窗口

  • overlapped 重叠窗口
  • popout 弹出窗口
  • child 子窗口
  • layered 分层窗口

setparent

SetParent(hWnd, hParent)
SetWindowLong(hWnd,GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) |WS_CHILD&~WS_POPUP)

setowner

GetWindow(hWnd, GW_OWNER) //获取owner窗口
SetWindowLong(hWnd, GWL_HWNDPARENT, (LONG)hNewOwnnerhwnd) //修改owner
ShowOwnedPopups(hWnd,fShow) //owner窗口和附属窗口一起弹出

子线程中设置,弹窗提示效果

EnableWindow(m_hWnd, FALSE);   //通过enable窗口可以设置父窗口禁用
WaitForSingleObject(pi.hProcess, -1);
EnableWindow(m_hWnd, TRUE);

CreateWindowEx创建窗口时指定父窗口

任务栏显示

  • WS_EX_APPWINDOW,任务栏显示窗口图标
  • WS_EX_TOOLWINDOW ,任务栏隐藏窗口图标

合并两个不同进程的任务栏窗口

  • SetCurrentProcessExplicitAppUserModelID(L"test")
  • 相同代码使用命令行参数启动两个进程

更多推荐

windows窗口setparent、setowner

本文发布于:2023-11-15 21:55:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606941.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗口   windows   setowner   setparent

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!