Sorry I didn't put a specific issue title.
My dev environment is Windows 7 with Visual Studio 2010. The product targets for Windows 7, 8 and 10.
Question 1: How could I get the current DPI settings?
The code below always returns 96 which is 100% DPI scale.
_dpiX = GetDeviceCaps(hdc, LOGPIXELSX);
Question 2: How could I get the actual resolution?
I have tried to use GetSystemMetrics with different options, they all return the same value which is the scaled resolution. For example, with an actual resolution 1920*1080 and 175% DPI, they all return 1097*617.
GetSystemMetrics(SM_CXFULLSCREEN)
GetSystemMetrics(SM_CXSCREEN)
GetSystemMetrics(SM_CXVIRTUALSCREEN)
Question 3: Can I set the app not to use DPI visualization feature?
We have a work around involving tick the 'disable display scaling on high DPI settings' option in Properties->Compatibility and use 'change settings for all users'. I have set the project DPIAwareness to true in Visual Studio, but it doesn't do anything.
Edit: Some people say if the product is set to DPI aware, it won't get DPI visualization. In my case, it's a GUI program passing some command arguments to another executable. I have set the executable DPIAwareness to true in my project. But nothing is done with the GUI. So if the GUI is not DPI aware, and it starts the other processes, are the other processes also not DPI aware?