简体   繁体   English

delphi7转换为delphi tokyo应用程序任务栏图标不喜欢移至第二屏幕应用程序

[英]delphi7 converted to delphi tokyo app taskbar icon does not like to move to second screen app

my delphi7 apps always show in the primary screen monitor taskbar 😣, Now in delphi 10.2 If I move the app to the second screen the taskbar icon move to that seconds screen 🆒. 我的delphi7应用程序始终显示在主屏幕监视器任务栏😣中,现在显示在delphi 10.2中。如果我将应用程序移至第二个屏幕,则任务栏图标将移至该秒屏幕🆒。 So now my issue is with the old delphi7 apps which I open and compile with delphi 10.2, they still have the old behavior 😱. 所以现在我的问题是使用delphi 10.2打开并编译的旧delphi7应用程序,它们仍然具有旧行为😱。 So how can I solve that?? 那么我该如何解决呢? 🤔 🤔

In Delphi 7, all TForm windows are owned by the hidden TApplication window at runtime, which is the window that actually manages the app's Taskbar button. 在Delphi 7中,所有TForm窗口在运行时都由隐藏的TApplication窗口拥有,该窗口实际上是管理应用程序的“任务栏”按钮的窗口。 That window remains on the primary monitor when you move your Forms to other monitors. 当您将窗体移动到其他监视器时,该窗口仍保留在主监视器上。 That is why you don't see the app's Taskbar button move to other monitors. 这就是为什么您看不到应用程序的“任务栏”按钮移动到其他监视器的原因。

In Delphi 2007 and later, TForm windows are no longer owned by the hidden TApplication window by default on Vista+. 在Delphi 2007和更高版本中,默认情况下,在Vista +上, TForm窗口不再由隐藏的TApplication窗口拥有。 This behavior is controlled by the TApplication.MainFormOnTaskBar property, which did not exist yet in Delphi 7. Being owned by the hidden TApplication window causes all kinds of problems in Vista+ for the Taskbar, the Task switcher, Aero, etc, so ShowMainFormOnTaskBar should always be set to true. 此行为由TApplication.MainFormOnTaskBar属性控制,该属性在Delphi 7中尚不存在。被隐藏的TApplication窗口拥有,会在Vista +中导致任务栏,任务切换器,Aero等各种问题,因此ShowMainFormOnTaskBar应该始终设置为true。

When you upgrade your Delphi 7 project to Delphi 10.2, be sure to set Application.MainFormOnTaskBar := true; 当您将Delphi 7项目升级到Delphi 10.2时,请确保设置Application.MainFormOnTaskBar := true; in the app's main startup code so the app interacts with Vista+ properly. 在应用程序的主要启动代码中,以便该应用程序与Vista +正确交互。 MainFormOnTaskBar is false by default when migrating a pre-D2007 project. 迁移D2007之前的项目时, MainFormOnTaskBar默认情况下为false。

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

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