Delphi应用程序窗口z顺序和MainFormOnTaskBar属性 [英] Delphi application window z order and MainFormOnTaskBar property

查看:980
本文介绍了Delphi应用程序窗口z顺序和MainFormOnTaskBar属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



使用Windows 7,我们遇到了一些问题,例如模式窗口出现在Delphi 7中。主窗口以及最终无法与程序进行交互,因为用户需要与模态窗体进行交互,并且由于它位于主窗口之下,所以这是不可能的。



为了避免这种情况问题我将项目的 MainFormOnTaskBar 属性更改为True(较旧项目没有这个属性),现在我继续进行同一个项目。阅读文档我发现了新的Form属性 PopupParent 。如果将MainFormOnTaskBar设置为True,是否必须使用此属性?是否有另一种解决这个问题的方法?

解决方案

是的,对于pop-under模式表单,您必须修复Z顺序使用 PopupParent PopupMode ,详见 Allen Bauer 在他的博客文章 PopupMode和PopupParent



MainFormOnTaskBar 文档说,它与弹出式下拉菜单没什么关系:它用于选择从哪里获得任务栏上的标题/图标信息(您的 Application MainFormOnTaskBar:= True 做更多和这篇文章由史蒂夫Trefethen (来自Delphi团队成员)更详细地解释了更多细节。

这个更多有涉及z顺序的后果。一些你可能喜欢更多或更少,所以这里有几个例子:



请注意,随着微软推出更多的功能,但随着Vista推出的问题也不容小觑,但也带走了一些曾经拥有的自由应用程序。请阅读这些一个>两个文章那么Nathanial Woolls将会给这些人留下更好的印象。

I'm maintaining an application originally written in Delphi 7 and ported to Delphi XE.

Using Windows 7, we have experienced some problems like modal windows appearing under the main window and the eventual inability to interact with the program because the user is expected to interact with the modal form and that's impossible since it's under the main window.

To avoid this problem I changed the MainFormOnTaskBar property of the project to True (older projects don't have this property) and now I continue with the same project. Reading documentation I found the new Form property PopupParent. Is it mandatory to use this property if I set MainFormOnTaskBar to True? Is there another solution to this problem?

解决方案

Yes, for the modal forms that "pop-under", you have to fix the Z-order using PopupParent or PopupMode, as explained by Allen Bauer in his blog post PopupMode and PopupParent.

MainFormOnTaskBar documentation says it has little to do with the pop-under: it is for choosing where the Title/Icon information on the taskbar is obtained from (your Application or MainForm).

However, MainFormOnTaskBar := True does more and this article by Steve Trefethen (ex Delphi team member) explains many more details it in more detail.

This "more" has consequences involving z-order. Some you might like more or maybe less, so here are are a few examples:

Note that fighting the issues introduced with Vista were no small feat to solve as Microsoft introduced a lot more functionality but also took away some freedom applications used to have. Read these two articles by Nathanial Woolls to get a better impression on those.

这篇关于Delphi应用程序窗口z顺序和MainFormOnTaskBar属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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