开发者

MFC: Make dialog always above A SMALL SET of other dialogs

开发者 https://www.devze.com 2023-04-10 04:39 出处:网络
Google-ing yields results on how to make a dialog \"always on top\" of everything.This is not what I want, though.

Google-ing yields results on how to make a dialog "always on top" of everything. This is not what I want, though.

Say I have a huge amount of dialogs. Within this pile of dialogs, consider 3 of them -- A, B and C.

I want C to always be on top of A and B, but not the rest of the pile. In other words, if C is active, then it should be on top, otherwise it will be below another active dialog, except for when it involves A and B.

And by the way, A and B can never appear at the same time.

With that, the only way I've managed to do it is by destroying C every time, and then re-create it with a 开发者_如何学运维new parent (A or B, depending who is visible). I've learned that once child dialogs are created, the ownership cannot be transferred, hence the need to destroy.

I cannot afford to keep destroying it (long story to it).

Any other way to achieve this? Thanks!


With that, the only way I've managed to do it is by destroying C every time, and then re-create it with a new parent (A or B, depending who is visible).

If you have the handle to C's window in A or B, how about sending a user-defined message to C, when ever you want to set C as TopMost ?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号