简体   繁体   English

Delphi SDI应用程序-是否不处理级联/平铺水平和垂直平铺?

[英]Delphi SDI application - Not handling cascade/tile horizontal & tile vertically?

My application doesn't seem to receive or handle the same windows messages for the Cascade, Tile Horizontal/Tile Vertical on specific windows versions. 在特定的Windows版本上,我的应用程序似乎无法接收或处理级联,平铺/垂直瓷砖的相同Windows消息。

Windows XP x32 - Not working Windows XP x32-无法正常工作
Windows XP x64 - Not tested Windows XP x64-未测试
Windows Vista x32 - Not working Windows Vista x32-无法正常工作
Windows Vista x64 - Works fine?? Windows Vista x64- 工作正常吗?
Windows 7 x32 - Not tested Windows 7 x32-未测试
Windows 7 x64 - Not working Windows 7 x64-无法正常工作

Anyone any idea's as to why this may be the case? 任何人都知道为什么会这样吗? Is there anything specific to Vista x64 that isn't with the others, I wouldn't have thought so myself! Vista x64是否有其他任何其他特有的东西,我自己也不会这么想!

Update 更新资料

More specifically I am referring to when I have one or more instances of my application open and I hold Ctrl and select these from the task bar and then try to Cascade/Tile. 更具体地说,我指的是当我打开一个或多个应用程序实例时,按住Ctrl并从任务栏中选择这些实例,然后尝试进行Cascade / Tile。

Older versions of our application prior to upgrading to Delphi 2009 seem to work as expected. 在升级到Delphi 2009之前,我们的应用程序的旧版本似乎可以正常工作。 Differences from this is we are now using the DevExpress ribbon components. 与此不同的是,我们现在正在使用DevExpress功能区组件。 Even more frustratingly is we have another version of the application which is in Delphi 2009 and using the ribbons and that works fine! 更令人沮丧的是,我们在Delphi 2009中有了该应用程序的另一个版本,并且使用了功能区,并且效果很好!

If you're talking about Delphi's TForm.Cascade and TForm.Tile methods, from the documentation (Delphi 7, as it was handy): 如果您在谈论Delphi的TForm.Cascade和TForm.Tile方法,请参阅文档(Delphi 7,因为它很方便):

Use Cascade to arrange MDI child forms so they overlap.

Cascade works only if the form is an MDI parent form (that is, if the form’s 
FormStyle property is fsMDIForm).

As you can see, they're only designed for MDI child forms; 如您所见,它们仅适用于MDI子表单; they have no effect on non-MDI child forms. 它们对非MDI子窗体没有影响。 That might explain why they're not working on three of the four OS's you've tested on. 这也许可以解释为什么它们不能在您测试过的四个操作系统中的三个上工作。 (I'd suspect the Vista x64 working is a fluke of some kind.) (我怀疑Vista x64的工作是某种偶然。)

EDIT: Based on the comment, the problem isn't related to TForm.Cascade/Tile. 编辑:根据评论,该问题与TForm.Cascade / Tile不相关。

I think Craig Young is on the right track, though. 不过,我认为Craig Young的发展方向正确。 Have you tried adding 您是否尝试过添加

Application.ShowMainFormOnTaskbar := True;

to the .DPR file? 到.DPR文件? I think the issue may be that, on projects started in earlier versions of Delphi and then updated to newer versions, the flag isn't set and the Application's window is what's put on the taskbar. 我认为问题可能是,在从早期版本的Delphi开始并随后更新为较新版本的项目上,未设置标志并且应用程序的窗口位于任务栏上。 Changing it to the main form instead may fix the issue. 相反,将其更改为主要形式可以解决此问题。

A simple Delphi app has two 'main' handles. 一个简单的Delphi应用程序具有两个“主要”句柄。 One is for the main form, and the other for the TApplication instance. 一个用于主窗体,另一个用于TApplication实例。

Personally I don't use the functionality to tile or cascade applications on the desktop (I prefer to run things maximised). 我个人不使用该功能在桌面上平铺或级联应用程序(我更喜欢最大化运行内容)。 Consequently, I've never bothered to dig around with that behaviour. 因此,我从不费心去挖掘这种行为。 But I can give some pointers: 但我可以给出一些指示:

  • Most likely the TApplication.WndProc method is receiving the message, but it doesn't help trying to resize that. TApplication.WndProc方法很可能正在接收消息,但是它无助于调整大小。
  • I suggest you intercept the relevant messages and simply pass them on to the main form's handle. 我建议您拦截相关消息,然后将其传递给主表单的句柄。
    • The TApplication.OnMessage event is the simplest, and should suffice. TApplication.OnMessage事件是最简单的,应该足够了。
    • If not, you could try using TApplication.HookMainWindow(); 如果没有,您可以尝试使用TApplication.HookMainWindow();。

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

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