简体   繁体   中英

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:

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.
—SA Permalink
Sergey Alexandrovich

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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