![]() |
Win10 Hohe DPI-Einstellung ändern
Liste der Anhänge anzeigen (Anzahl: 1)
Hallo,
um ein (mit Delphi7 programmiertes) Spiel auf Win10 mit hoher Auflösung und Skalierung vernünftig darzustellen, kann man unter Eigenschaften der EXE, Kompatibilität, Hohe DPI-Einstellungen ändern, dann "Hohe DPI-Skalierung überschreiben" anwählen und auf "System" stellen, dies bringt das gewünschte Ergebnis. Um das ganze Benutzerfreundlich und automatisiert zu erledigen die Frage: Wie kann ich diese Einstellung Programmiertechnisch einstellen? |
AW: Win10 Hohe DPI-Einstellung ändern
Zitat:
Code:
(Die Kommentare muss man den gewünschten Einstellungen ensprechend rausnehmen und die Descriptions natürlich auch ändern.)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- This manifest tells Windows Vista to Windows 10 not to virtualize any file or registry access. Also, it disables themes support and optionally enables DPI awareness per monitor --> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="template from dzlib build tools" type="win32" /> <!-- remove this comment to enable themes <dependency> <dependentassembly> <assemblyidentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publickeytoken="6595b64144ccf1df" language="*" processorarchitecture="*"> </assemblyidentity> </dependentassembly> <dependency> --> <!-- remove this comment to tell Windows that this program is DPI aware, per monitor <asmv3:application> <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> <dpiAware>True/PM</dpiAware> <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness> </asmv3:windowsSettings> </asmv3:application> --> <description>This application was built using buildtools from dzlib</description> <!-- COMPATIBILITY SECTION SPECIFIES IF APP IS COMPLIANT DISABLES PCA IF SPECIFIED --> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <!-- We support Windows Vista --> <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- We support Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <!-- We support Windows 8 --> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <!-- We support Windows 8.1 --> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- We support Windows 10 --> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> </application> </compatibility> <!-- TRUSTINFO SECTION SPECIFIES REQUESTED PERMISSIONS AND UIPI DISABLEMENT (SPECIAL CONDITIONS APPLY TO UIPI DISABLEMENT)--> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false" /> </requestedPrivileges> </security> </trustInfo> </assembly> Dieses Manifset muss als Ressource an das Programm gebunden werden, z.B. mittels einer solchen rc-Datei:
Code:
#define MANIFEST_RESOURCE_ID 1
#define RT_MANIFEST 24 MANIFEST_RESOURCE_ID RT_MANIFEST "<name der Datei hier>" Neuere Delphis können das zum Teil selbst. Per Monitor DPI kann soweit ich weiss erst Delphi 10.4. |
AW: Win10 Hohe DPI-Einstellung ändern
Nach diversen Tests hier das Manifest welches die gewünschte Ansicht (groß) bringt:
Code:
Um die RES zu erzeugen benutze ich eine my.manifest mit obigem Inhalt und eine manifest.rc die so aussieht
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="TheAppName" type="win32" /> <asmv3:application> <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> <dpiAware>false</dpiAware> <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">unaware</dpiAwareness> </asmv3:windowsSettings> </asmv3:application> <description>This application was built using buildtools from dzlib</description> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <!-- We support Windows Vista --> <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- We support Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <!-- We support Windows 8 --> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <!-- We support Windows 8.1 --> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- We support Windows 10 --> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> </application> </compatibility> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false" /> </requestedPrivileges> </security> </trustInfo> </assembly>
Delphi-Quellcode:
Doppel-Klick auf manifest.rc erzeugt die manifest.res
1 24 "my.manifest"
das ganze dann via {$R 'Manifest.res'} in der dpr eingebunden (Delphi7) :-D |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:34 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz