Trying to my Delphi 2010 application more user freindly in high DPI modes in Windows 7 I have been trying several methods to retrive PixelsPerInch and compare to 96. Alas, n
Don't respond to the user's DPI setting.
Respond the user's font preference.
If you only respond to the user's DPI setting, then your form will not get bigger if the user uses a larger font than you used at design time, e.g.
By responding to font size (in pixels), you get high-DPI support for free (and you're being a good developer!):
13px Windows 2000/XP (what you designed with)15px (scale your designed form by 115%)15px Windows Vista/7 (scale your designed form by 115%)16px my home machine (scale your form by 123%)16px my work machine (scale your designed form by 123%)You want to turn all your form's Scaled property off; so they don't try to respond to dpi settings. You want the .NET WinForms equivalent of AutoScaleMode.Font.
And yes, once you've paid your taxes, and can handle different DPI settings, declare your application highDpi aware using a manifest - as other answers have given.
Don't use SetProcessDPIAware, as it may be too late for DLLs that you depend on who already read the current DPI:
Note SetProcessDPIAware is subject to a possible race condition if a DLL caches dpi settings during initialization. For this reason, it is recommended that dpi-aware be set through the application (.exe) manifest rather than by calling SetProcessDPIAware.