Ancient Delphi VCL应用似乎没有Windows主题或VCL样式 [英] Ancient Delphi VCL app looks to have no Windows theme or VCL Style

查看:113
本文介绍了Ancient Delphi VCL应用似乎没有Windows主题或VCL样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那是我的分析.我今天早上将我的应用程序分发"给我们的组织是为了了解,在这个旧的win32应用程序上使用XE8进行了一个月的新工作之后,使用Windows 7基本"主题的客户端 not 参见非常褪色的外观.但是,我们那些使用远程桌面或使用基本主题的人,请参阅有关我认为我们经常看到的内容.

That's my analysis, anyway. I "distributed" my app to our organization this morning only to learn that, after a month of new work in XE8 on this old win32 app, clients not using the Windows 7 "Basic" theme see a very faded appearance. But those of us using remote desktop or using the Basic theme see about what I think we've always seen.

事实:

  • 由XE8,Win32和最新的Raize组件制成
  • XPMan一路移除
  • 在所有配置中,启用主题"均处于启用"状态,选中了Metropolis,将Windows设置为外观中的默认主题.
  • 最近带有一些Raize组件的小型应用程序看起来不错,我已经尝试遵循该应用程序制定的模式.
  • 真相:

  • Made with XE8, Win32, current Raize components
  • XPMan removed along the way
  • "Enable themes" is "on" in all configs, Metropolis checked, Windows is set as the default theme in Appearance.
  • A recent small app with some Raize components looks fine, and I've tried to follow the pattern laid down by this app.
  • Truths:

  1. 从Delphi 1开始,我一直在随身携带这个应用程序;我可能已经围绕Delphi 2重建了项目源代码,但是除此之外,我对dproj文件的了解还不多.
  2. 我怀疑我将不得不专注于资源编译位.我知道的唯一资源是图标和清单,我想清单是这里的真正问题.我大约一个月前删除了"XPMan",但直到今天早上才部署.

dpr看起来像这样:

The dpr looks like this:

program db_silookup;
uses
  Vcl.Forms,
  Vcl.Themes,
  Vcl.Styles,
  //...
  {$R *.res}
  {$R 'win7.rc'}
begin
  Application.Initialize;
  Application.UseMetropolisUI;
  Application.CreateForm(TfmSi, fmSi);
  Application.CreateForm(TfmXferList, fmXferList);
  TStyleManager.TrySetStyle('Windows');
  Application.Title:='Law School Lookup';
  Application.Run;
end.

由于我怀疑这很重要,所以win7.rc是:

And because I suspect it matters, win7.rc is:

1 24 "win7.manifest"

依次是:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32" name="App" version="3.1.0.0" processorArchitecture="*"/>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/>
    </dependentAssembly>
  </dependency>
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!--The ID below indicates application support for Windows Vista -->
        <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
        <!--The ID below indicates application support for Windows 7 -->
        <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
    </application>
  </compatibility>
</assembly>

推荐答案

从您的应用中禁用/删除与Metropolis相关的所有内容. Metropolis仅适用于Windows 8+ Metro风格的应用程序,这些应用程序与旧版应用程序没有业务往来(除非您希望将UI转换为Metropolis,这实际上是一种重写).

Disable / remove everything related to Metropolis from your app. Metropolis is only meant for Windows 8+ Metro style apps, which legacy apps have no business working with (unless you wish to convert your UI to Metropolis which is practically a re-write).

Metropolis UI的使用似乎已经覆盖了您的颜色,并且正在使用Metro风格应用程序中原本会使用的颜色.

It seems as if the usage of Metropolis UI has overridden your colors and is using the colors which it would otherwise be using in a Metro style application.

另一种选择(清理时)是从头开始,而没有.dproj文件(以防万一,将其备份).它将自动检测应用程序的类型并将其升级为默认设置.当然,您仍然必须在设置中重新做很多事情,但这是摆脱任何旧参考并清理此类问题的好方法(假设您已经删除了所有其他Metropolis参考).

Another option (while cleaning up) would be to start from scratch without a .dproj file (back it up just in case). It will automatically detect the type of app and upgrade it to default settings. You will still of course have to re-do many things in the setup, but it's a good way to rid any old references and clean up these sort of problems (given you've already removed all other Metropolis references).

这篇关于Ancient Delphi VCL应用似乎没有Windows主题或VCL样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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