• Advertisement
Sign in to follow this  

Bug in Vista RC1 - High DPI mode always 96 dpi

This topic is 4170 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I found unpleasant bug that still exists even in latest Windows Vista RC1. We call SetProcessDPIAware because we want to manually support High DPI mode. In this mode (as earlier in Windows XP) I retrieve PPI value as Microsoft recommends: HDC screen = GetDC(0); scaleX = GetDeviceCaps(screen, LOGPIXELSX) / 96.0; scaleY = GetDeviceCaps(screen, LOGPIXELSY) / 96.0; ReleaseDC(0, screen); But in Windows Vista RC1 it allows return 96, instead of 120 as I set in display properties.

Share this post


Link to post
Share on other sites
Advertisement
Bring up an explorer window that has your app icon in it. Right click->Properties->Compatibility->Disable display scaling on high DPI settings->OK. Then run your app and see if you get the same result.

If that fixes it then you have some sort of timing problem and you have not actually called SetProcessDPIAware yet or the code you showed is an approximation and you're really getting a cached value from before you called it.

If it doesn't fix it then I have no clue try going changing themes to the Classic theme. If you still get 96 then it's definitely some wierd bug in your app. Otherwise I have no clue.

Share this post


Link to post
Share on other sites
You're right!
After calling SetProcessDPIAware I still gets cached value.

I did as you recommended and now I've got right value.

Why SetProcessDPIAware works so strange? I called it before creating of any windows in my application.

Share this post


Link to post
Share on other sites
Yes, calling of SetProcessDPIAware returns True.
And I see that no Bilinear scaling more in my application.

But GetDeviceCaps(screen, LOGPIXELSX) returns 96.

Share this post


Link to post
Share on other sites
Sorry, it was my mystake. You're right - I used cached value. I moved call of SetProcessDPIAware before all in my application and all works fine now.
Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement