In my application I’d like to find what scaling factor each monitor is set to.
I’ve tried GetScaleFactorForMonitor (from SHCORE.DLL) but it returns 140 for my 4K monitor when Windows shows it as 150%. The other monitors that are set to 100% all return 100.
Am I misunderstanding something or is there a better way to get this info?
A bit more investigation seems to suggest that the GetScaleFactorForMonitor result is influenced by the DPI awareness of the calling process and this is why the result is wrong for XE. I had assumed that the call would be independent. Oh well.
Today I read many pages about manifests and get the general idea, but I’m stalled at the point of what exactly to name the file and how to add it into my Delphi XE project. There were many contradictory explanations online.
I can see in Project Options where I need to uncheck Use Runtime Themes and that does seem to affect the manifest section in the exe’s resources (I looked with Resource Hacker).
Can someone please help me over this hurdle? I’m obviously missing something!
I read all that, but the issue is that Delphi XE only has one option; a checkbox called Enable Runtime Themes. There is nowhere to specify a custom manifest. Maybe it’s just not possible with Delphi XE ?
My only option seems to be to deploy the manifest file alongside the exe ?
In the project options → Application → Runtime Themes → Use custom manifest, set it to the saved manifest file.
Rebuild the project.
However, after that, when I run the application. It does not show the elevate to adminsitrator messagebox. I try to open and browse its resources. There is a manifest file inside the resource, but it is not the one I set.
So, how to set custom manifest file for a project?
Make sure to set the “Target” choice at the top of that window to each target type and check the setting. I’ve had to hand edit the dproj file to fix issues with bad target info being stuck. I also use Project Magician from Uwe Raabe which is a huge help. – MarkF
No, in XE the only option is a checkbox, so it looks like I’m out of luck there.
I did try putting the manifest file (with the DPI Awareness) in the same folder as the exe, but either it’s not being used or doesn’t help the other code I’m trying to use.