使用子级更改Z顺序弹出对话框 [英] Changing Z Order with Child & Popup dialogs

查看:101
本文介绍了使用子级更改Z顺序弹出对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要更改应用程序中同时具有子级和子级的弹出对话框的Z顺序.其他弹出对话框.该应用程序由多个POPUP&一个视图下有一个CHILD对话框.用户操作后,我需要更改其中一个弹出对话框的Z顺序,并将其发送到所有现有对话框(包括子对话框)的后面.

我面临的问题是弹出对话框没有出现在子"对话框的后面(而是出现在应用程序其余的弹出对话框的后面).对我来说,将唯一的子"对话框的样式更改为弹出式不是一个选择.我们不能在儿童后面放置弹出对话框吗?

以下代码用于更改Z顺序:

Hi
I have a need to change the Z order of a popup dialog within a application, which has both child & other popup dialogs. The application consists of multiple POPUP & one CHILD dialog under a view. After a user action, i need to change the Z order of one of the Popup dialogs and send it behind all the existing dialogs (including the child dialog).

The issue i am facing is the popup dialog is not going behind Child dialog (while is it going behind rest of the popup dialogs of the app as expected). Changing the style of the only Child dialog to popup is not an option for me. Can we not place a popup dialog behind a child?

Following code is used to change the Z Order:

SetWindowPos(&CWnd::wndBottom, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING);



任何帮助将不胜感激.

谢谢,
Aravind B.



Any help is greatly appreciated.

Thanks,
Aravind B.

推荐答案

我认为您无法实现这一目标.

以下摘录自 SetWindowPos SetWindowPos [ ^ ]:
I think you cannot achieve this.

The following is from the remark section of the SetWindowPos[^]:
引用 ^ ]:

非最顶层的窗口可以拥有最顶层的窗口,但是不会发生相反的情况.最高窗口所拥有的任何窗口(例如,对话框)本身都将成为最高窗口,以确保所有拥有的窗口都位于其所有者之上.

A non-topmost window can own a topmost window, but the reverse cannot occur. Any window (for example, a dialog box) owned by a topmost window is itself made a topmost window, to ensure that all owned windows stay above their owner.

由于弹出窗口是子对话框所拥有的,因此不能隐藏在它的后面.

As your pop up is owned by the child dialog it cannot be hidden behind it.


这篇关于使用子级更改Z顺序弹出对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆