简体   繁体   English

如何同步一个弹出窗口始终在另一个弹出窗口上方?

[英]How to sync one popup window is always above another popup window?

How to sync one popup window is always above another popup window ? 如何同步一个弹出窗口始终位于另一个弹出窗口上方? Both windows are in the same process but in different threads. 两个窗口处于同一进程中,但线程不同。 Similar method the system uses for owner and owned windows, but such windows must belong same thread. 系统用于所有者和所有者窗口的类似方法,但是此类窗口必须属于同一线程。 In my case, there are two different UI threads in one process and windows are created in those different threads. 就我而言,一个进程中有两个不同的UI线程,并且在这些不同的线程中创建了窗口。

使用SetWindowPos

SetWindowPos(window_1, window_2, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);

Similar method the system uses for owner and owned windows, but such windows must belong same thread. 系统用于所有者和所有者窗口的类似方法,但是此类窗口必须属于同一线程。

This statement is incorrect. 这句话是不正确的。 You can indeed make the owner of a window be a window from a different process. 您确实可以使窗口的所有者成为其他过程中的窗口。 And that is the correct way to do what you desire. 这是做自己想要的事情的正确方法。

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

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