Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Set "Disable display scaling on high DPI settings"


  • Please log in to reply
2 replies to this topic
yourbuddypal
  • Members
  • 32 posts
  • Last active: May 17 2013 06:50 AM
  • Joined: 29 Jun 2009
On windows 7 and Vista, there are compatibility options that can be set on the properties for an exe. I use firefox on my HTPC that has a high dpi set, and need the "Disable display scaling on high DPI settings" option to be set so that Flash videos display in proper full screen (youtube, etc). With every new (now rapid) release of firefox, this setting has been getting cleared. I just made a script to set this option automatically and have it set up as a scheduled task so that it does so automatically.

First of all, I had to find where this setting was being persisted. I correctly suspected that it was in the registry, and it turns out the full path is along the lines of:

HKEY_USERS\<USERSID>\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

It is a per-user setting, so I used the script provided by Maestr0 from this thread about finding the current user's SID: <!-- m -->http://www.autohotke.../topic9721.html<!-- m -->

From there, a registry key just needed to be created in that location. Heres the script:

if 0 = 1
{
	SID := GetSID()
	regPath = %SID%\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

	RegWrite, REG_SZ, HKEY_USERS, %regPath%, %1%, HIGHDPIAWARE
}
else
{
	MsgBox, An application path is required as a single paramater.
}

GetSID()
{
   Loop , HKLM , SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList, 1, 1
   {
      if A_LoopRegName = ProfileImagePath
      {
         RegRead , OutputVar
         if outputvar contains %A_UserName%
            StringReplace , SID, A_LoopRegSubKey, SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\ ,,
      }
   }
   return %SID%
}

Its not too complex as all the pieces are simple. I just thought it was kind of neat how it all came together and thought I'd share. I figured there are still at least a few other firefox comrades out there...

JSLover
  • Members
  • 920 posts
  • Last active: Nov 02 2012 09:54 PM
  • Joined: 20 Dec 2004

It is a per-user setting, so I used the script provided by Maestr0 from this thread about finding the current user's SID...

...you should be able to just use HKCU to get the "current user", instead of using HKU & finding the SID.

You might also try setting that same key down the HKLM path & find out if it can be a per-machine setting? A lot of settings can be per-user OR per-machine. To test, unset the per-user setting, set the per-machine setting & just find out if it works.

I'm also curious as to how/why it's getting unset on an update?...you could try to change the permissions on the key so that it can't be updated & see if it will stick.

  • Guests
  • Last active:
  • Joined: --

It is a per-user setting, so I used the script provided by Maestr0 from this thread about finding the current user's SID...

...you should be able to just use HKCU to get the "current user", instead of using HKU & finding the SID.

You might also try setting that same key down the HKLM path & find out if it can be a per-machine setting? A lot of settings can be per-user OR per-machine. To test, unset the per-user setting, set the per-machine setting & just find out if it works.

I'm also curious as to how/why it's getting unset on an update?...you could try to change the permissions on the key so that it can't be updated & see if it will stick.


Good suggestions. I was thinking about the machine-level setting as well but did not test it. I don't know why the setting gets lost per, it is really annoying. My assumption is that the old firefox.exe gets deleted and the new one is then copied over.