简体   繁体   English

设置窗口的所有者而不激活/带到前面

[英]Set window's owner without activating/bringing to front

I've been googling for days for how to set window's owner without activating/bringing owner to front and couldn't manage to find it. 我一直在谷歌搜索如何设置窗口的所有者而不激活/将所有者带到前面,并且无法找到它。 Currently I'm using winapi: 目前我正在使用winapi:

SetWindowLong(hwndWindow, GWL_HWNDPARENT, hwndOwner); // GWL_HWNDPARENT = -8

or built in wrap: 或内置包装:

new WindowInteropHelper(window) { Owner = owner };

Both works fine for setting owner, but they are bringing owner window to front which causes problems when there are a lot of windows. 两者都适用于设置所有者,但它们将所有者窗口带到前面,当有很多窗口时会导致问题。

Thanks for help! 感谢帮助!

This helped: 这有助于:

Please see: https://msdn.microsoft.com/en-us/library/windows/desktop/ms633541%28v=vs.85%29.aspx Pay attention for the note in "Remarks" about the requirement to change the styles and synchronize the UISTATE. 请参阅: https//msdn.microsoft.com/en-us/library/windows/desktop/ms633541%28v=vs.85%29.aspx请注意“备注”中有关更改样式要求的说明并同步UISTATE。
—SA Permalink -SA固定链接
Sergey Alexandrovich Sergey Alexandrovich

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM