# Native Handles and Desktop::getGlobalScaleFactor

**URL:** <https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722>\
**Category:** Windows\
**Created:** [October 16, 2014, 10:10am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722 "2014-10-16T10:10:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![masshacker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/masshacker/32/650_2.png) [@masshacker](https://forum.juce.com/u/masshacker)\
**Post date:** [October 16, 2014, 10:10am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722/1 "2014-10-16T10:10:11Z")

</div>

Hello!

I have a Juce application which hosts a native window, and if I modify the global scale factor from the operating system (via the Displays section in Windows' control panel, "change the size of all items"), the Juce window is scaled correctly, while the native window is not.

Does anybody have any suggestions?

Thank you :)

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 16, 2014, 10:23am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722/2 "2014-10-16T10:23:08Z")

</div>

Sadly Windows doesn't give you much help in rescaling your UI.&nbsp;HWNDs were designed long before anyone thought that desktop scale factors would be a thing, and it's up to your own code to scale things appropriately.

---

<div class="post-metadata">

**Author:** ![masshacker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/masshacker/32/650_2.png) [@masshacker](https://forum.juce.com/u/masshacker)\
**Post date:** [October 16, 2014, 10:30am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722/3 "2014-10-16T10:30:13Z")

</div>

Ah yes,&nbsp;that's what I thought. Infact, I just double-checked with the Plugin Host demo and I see that plugin windows simply ignore the scale factor.

The funny thing is, If I use a non-Juce application to host the native window, everything gets scaled correctly!

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 16, 2014, 10:45am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722/4 "2014-10-16T10:45:23Z")

</div>

When you say "correctly", maybe you're not inspecting it&nbsp;too closely.. &nbsp;If you run an app that's not scale-aware, then Windows will just render it secretly to a bitmap and then rescale that&nbsp;image, which gets it to&nbsp;the right size, but is obviously&nbsp;very blurry!

---

<div class="post-metadata">

**Author:** ![masshacker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/masshacker/32/650_2.png) [@masshacker](https://forum.juce.com/u/masshacker)\
**Post date:** [October 16, 2014, 10:54am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722/5 "2014-10-16T10:54:54Z")

</div>

Yes, but I don't care about the blurriness. My point is: why can any commonly used plugin host (e.g. Reaper) scale plugin windows while Juce can't? Is there any special&nbsp;flags or settings for the host window?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 16, 2014, 11:07am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722/6 "2014-10-16T11:07:42Z")

</div>

IIRC it's a global flag for the whole app, not for particular windows.

---

<div class="post-metadata">

**Author:** ![masshacker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/masshacker/32/650_2.png) [@masshacker](https://forum.juce.com/u/masshacker)\
**Post date:** [October 16, 2014, 11:19am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722/7 "2014-10-16T11:19:43Z")

</div>

Ok, I think I found it. It's in juce\_win32\_Windowing.cpp, static void setDPIAwareness().

Jules, what do you think about adding a macro to bypass it?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 16, 2014, 11:26am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722/8 "2014-10-16T11:26:51Z")

</div>

Yeah, I guess I could add that. In the long run you should probably make your native windows draw themselves properly though.

---

<div class="post-metadata">

**Author:** ![masshacker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/masshacker/32/650_2.png) [@masshacker](https://forum.juce.com/u/masshacker)\
**Post date:** [October 16, 2014, 11:32am UTC](https://forum.juce.com/t/native-handles-and-desktop-getglobalscalefactor/13722/9 "2014-10-16T11:32:48Z")

</div>

Great! Thank you very much. I agree with you btw :)
