SSMS in High-DPI Displays: How to Stop the Madness


I spent the last few weeks travelling a lot compared to my usual routine and I got quickly fed up with bringing my mobile workstation with me. My Dell precision M4600 is a powerhouse, but it’s definitely too big and too heavy for travelling, so I decided it was time to buy a small laptop just for travelling and presenting at SQL Saturdays and events around Europe.

After lots of research, I pulled the trigger on a new XPS13. It’s a very nice, tiny and light machine, beefy enough to run my virtual machines and slim enough to fit in a small bag.

So, everything fine? Not quite. The XPS13 2015 sports a stunning QHD touch display, with almost no bezel: a small wonder. The only complaint with it is windows and its (in)ability to scale applications when running at High DPI.

Windows got better at scaling applications on HiDPI displays and Windows 10 is doing a remarkably good job at scaling applications that can actually scale. I am running at maximum resolution (3200 x 1800) with 200% scale factor and, for instance, Visual Studio 2015 renders perfectly:

VisualStudio

Other applications scale horribly. For instance, SSMS (SQL Server Management Studio) 2014 is a complete disaster:

SSMS_smart_scaling_200_percent

At a first glance, it looks ok, but look at those icons on the Object Explorer tree: aren’t they a little bit too small compared to the labels next to them?

I can live with small icons, but you just need to open some dialog windows to understand how bad things really are:

smart_scaling_200percent

As you can see, text gets scaled correctly, but the size of the window and some controls are completely wrong.

While some dialog windows are easily fixed by resizing them, some other are completely unusable. For instance, the restore database dialog, when locating a backup file, looks like this:

restore_scaling_issues

I’m not the first one to discover this kind of issues: Scott Hanselman posted his impressions quite a long time ago, but he offered no solution.

There’s also a Connect item that describes this issue, but… ok, you know what I’m about to say.

A new hope from an old technique

In Windows Vista, you had two possible ways of scaling applications: with the first one (the default) applications were instructed to scale their objects using the scaling factor imposed by the operating system. The results, depending on the quality of the application and the Windows version, could vary a lot. Some scaled correctly, some other look very similar to what we are seeing in SSMS, with some weird-looking GUIs. In Vista, this option was called “XP style DPI scaling”.

The second option, which you could activate by unchecking the “XP style” checkbox, involved drawing the graphical components of the GUI to an off-screen buffer and then drawing them back to the display, scaling the whole thing up to the screen resolution. This option is called “bitmap scaling” and the result is a perfectly laid out GUI:

SSMS_xp_scaling_200percent

In order to enable this option in Windows 10, you need to merge this key to your registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide]
"PreferExternalManifest"=dword:00000001

Then, the application has to be decorated with a manifest file that instructs Windows to disable DPI scaling and enable bitmap scaling, by declaring the application as DPI unaware. The manifest file has to be saved in the same folder as the executable (ssms.exe) and its name must be ssms.exe.manifest. In this case, for SSMS 2014, the file path is “C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe.manifest”.

Paste this text inside the manifest file and save it in UTF8 encoding:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">

<dependency>
  <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<dependency>
  <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
    </requestedPrivileges>
  </security>
</trustInfo>

<asmv3:application>
  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
    <ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</ms_windowsSettings:dpiAware>
  </asmv3:windowsSettings>
</asmv3:application>

</assembly>

This “Vista style” bitmap scaling is very similar to what Apple is doing on his Retina displays, except that Apple uses a different font rendering algorithm that looks better when scaled up. If you use this technique in Windows, ClearType rendering is performed on the off-screen buffer before upscaling, so the final result might look a bit blurry.

The amount of blurriness you will see depends on the scale factor you set in the control panel or in the settings app in Windows 10. Needless to say that exact pixel scaling looks better, so prefer 200% over 225% or 250% scale factors, because there is no such thing as “half pixel”.

Seeing is believing:

Bitmap scaling at 200%

Bitmap scaling at 200%

Bitmap scaling at 225%

Bitmap scaling at 225%

Bitmap scaling at 250%

Bitmap scaling at 250%

That’s it: nice and easy. Enjoy your High DPI lifestyle, until Microsoft comes up with a better solution (or a better SSMS).

Advertisements

Posted on October 14, 2015, in SQL Server and tagged , , , , , , . Bookmark the permalink. 80 Comments.

  1. Thank you so much sir, now i can enjoy SSMS with my Hp Spectre .

  2. Thanks, my manifest for Eclipse/Java stopped working after upgrading to Windows 10 and the registry entry fixed it again.

  3. THANK YOU! Same as wezgeb! Why does life have to be so difficult sometimes?

  4. My friend, many thanks for this. You have provided a solution that Microsoft was incapable or unwilling to provide for a problem caused by themselves. Cheers

  5. This is just so useful! FWIW I’ve just sent a tweet out saying so, thanks 🙂

  6. Thank you for your post, it worked perfectly.

  7. I might sound very naive but how to marge a key into the registry? like i know the steps to open the registry and reach the path till …[sidebyside], but then what should I do? and I have no idea what a manifist file is? is there anyway i can get steps to do that?

    I would appreciate your help guys, i am using windows 8.1 and it is very frustrating using MS SQL server with the High DPI!

    • Copy this text to notepad and save it as “hidpi.reg”.
      Windows Registry Editor Version 5.00

      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide]
      "PreferExternalManifest"=dword:00000001

      When saving the file, put the name in quotes, otherwise notepad will try to save it as hidpi.reg.txt.
      Double click the hidpi.reg file to merge it to the registry.

      Regarding the manifest file, copy the XML from the post and paste it in notepad. Save it as “ssms.exe.manifest” (same caution about the quotes applies). In the save as dialog in notepad, make sure you choose the UTF8 encoding.

      That’s it.

      • You are simply Awesome! Thank you so much, works grrreatt now!

      • Thank you Moath for asking for this clarification.
        Thank you Spaghettidba for both the solution and this response for those of us with less experience but the same frustration 🙂

  8. rogier werschkull

    In the November 2015 release of the standalone SSMS installation Microsoft finally added bitmap scaling for High resolution displays, see: https://msdn.microsoft.com/en-us/library/mt588477.aspx

  9. How did you solve the same scaling issue, but with SSDT?
    I copied the manifest file to SSDT folder, it now renders fine, but it gives me an error that debug function is not available and I have to reinstall SSDT.

    • AFAIK, SSDT is built on a different visual studio shell (2012 or 2013, depending on your setup) and it should not have scaling issues. What scaling problems are you seeing?

      • This is what I see out of the box:
        http://postimg.org/image/vwoy6qo1d/
        This is what I can see thanks to your xml manifest put into the same folder as devenv.exe:
        http://postimg.org/image/jh2m4dadb/

        The results are pretty amazing. Unfortunately, when I press “Start” I get the error:
        ——————–
        Unable to start debugging.
        The debugger is not properly installed.
        Run setup to install or repair the debugger. (Microsoft.DataTransformationServices.VsIntegration)
        ——————–

        I had a theory that it starts another application within Visual Studio.
        I found out that when you press “start” on SSIS package it runs DtsDebugHost.exe from “C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn” (depending on your version of course). So I decided to try adding manifest with the same name to it. Sadly, this did not solve the problem. I still get the error.

    • I have the same problem with visual studio 2015. When I remove devenv.exe.manifest file then debuging is working. Did you find any solution how to set the manifest file for visual studio?

      • I don’t understand what you mean. Visual studio is scaled perfectly in my QHD display. What are you trying to do?

      • Visual studio 2015 is scaled perfectly but winforms application development (I mean visual studio winforms layout development) has issues in case you are using hiDPI display. But I managed to generate the right visual studio manifest file using mt utility after that I set application dpiAware attribute and now winforms development works correctly. I have Win10 with 4k display native resolutin, zoom is set to 200% but I can work with my old winforms project and all is scaled correctly in visual studio winform preview using dpiAware attribute 🙂

      • Cool! Thanks for the feedback.

      • hi,
        make devenv.exe.manifest. open command promt same folder (you need write permission on this folder)
        D:\>mt -inputresource:”C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe” -out:devenv.exe.manifest
        use this command. this will make visual studio manifest on your empty devenvçexçmanifest file.

        Microsoft Visual Studio

        false
        true

        this is my file. You need change only this section;
        true

        change true to false.
        Sory for my english 🙂

  10. Thank you. Very impressed you worked out that solution.

  11. Reblogged this on Nicholas Rogoff's Blog and commented:
    Got a new high resolution latop with scaling and struggling to use SSMS. Here’s the fix

  12. Thanks, this worked like a charm for me! Surface Pro 4 is now usable.

  13. Thank you so much for this! I also used this technique to create a manifest file for mstsc.exe in the Windows System32 directory. Remote Desktop no longer requires a magnifying glass to be used on a Surface Book!

  14. OMG, you’re a legend! That is soooo good. I dropped $3,500 on a new Surface book as a dev laptop and was feeling pain with SSMS. Now to see if I can fix Remote Desktop. Thank you so much, this totally worked!!

  15. Amazing post! Worked like a charm! :)) Thank you!

  16. Worked perfectly, thank you!

  17. wow, you made my day, thanks a million, i was feeling it was my big mistake buying XPS 13 2015, but now i am actually feeling good 🙂

  18. Tanks very much for your solution for this, now it works great on Surface Pro 4

  19. I didn’t think it would work. But it does! Thank you!

  20. THANK YOU!!! YOU MADE MY DAY! YOU ARE GREAT!

  21. I can’t say how much this changed my working experience, really glad you posted your solution! Thanks a lot!

  22. Thank you so much for this. Now able to use SSMS on my XPS 13 when traveling.
    P.S. I’ve also recently installed SQL Server 2016 CTP 3.3 and they appear to have applied this fix, or something similar.

  23. Just applied the same fix to SQL Server Data Tools 2015, i.e. by renaming the manifest file to “devenv.exe.manifest” and saving it to “C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\”.
    Your gift just keeps on giving!

  24. Another thank you! This is a huge help!

  25. Worked for me…THANK YOU!….

  26. You deserve some sort of reward for this. Been setting up a new XPS 15 this weekend and this is a lovely solution. SSMS, SoapUI (and, I suspect many other applications) – all now usable.

  27. Hi Gianluca,

    I’d like to add my thanks along with all the others. Being unable to use effectively SSMS on my new fully loaded Surface Book was driving me nuts!

    You’re a star.

  28. OMG Awesome…thanks!!!

  29. Thanks for your post – I’ve been using this solution on my XPS13 since I ran across it. It has helped to no end -I am using it with Calibre ebook editor, 7zip V15.14, Bittorrent 7.2.1, VLC 2.2…and so on.

    There are a few drawbacks to this method though:
    1-slight blurring of text/icons
    SOLUTION: use DPI Awareness Enabler (Freeware) – easy, just drag & drop applications into the bottom pane. You will have a larger but very crisp/clear display.

    2-does not work if the application is called indirectly (via another application)
    You MUST click on the app yourself (L-click on the .exe or R-click >”open with” or “send to” -select desired .exe)
    For example: if you click on a torrent file in Firefox >>and Firefox opens Bittorrent (when it’s not already running) ..Bittorrent is NOT rescaled despite the manifest.

    If anyone has a solution to this problem – PLEASE post…you are a genius.

    Just FYI -there is one alternate solution which works for some apps:
    Create a new environment variable named “QT_PIXEL_DENSITY_RATIO” and assign it the value “auto”
    log out and log in again…and any apps which use QT will be rescaled.
    *this works for Calibre and Calibre’s ebook-viewer…
    Kudos to Tim Zwicker for coming up with this solution.

  30. I’ve been struggling with this scaling problem since I got my DELL XPS13 – it almost makes me want to return the stupid computer. I finally implemented this external manifest solution – but it does NOT work for Kindle for PC or Gyration Motiontools (the software for my mouse/keyboard, essential for my daily functioning)!!

    Neither the external manifest nor environment variable solution (QT_DEVICE_PIXEL_RATIO – auto) worked for these applications. I’ve attached pictures (of Kindle 4 PC) – but I had to uninstall Gyration (it was 1.5″ x 1.5″ ….impossibly small).

    IF anyone has a fix for this please post and let me know.

    ALSO : The “manifest solution” has a fairly significant drawback: it won’t work if the application is started “thru” another application…
    eg if you click a torrent file in Firefox >and Firefox starts Bittorrent >>Bittorrent is NOT rescaled, despite the external manifest.

    IF anyone has a solution for this…again, please, please let me know!

  31. Any idea if similarly this same fix can be applied to Visual Studio 2015? When I open server explorer and try to add new database same display issue is noted here. Not sure if anyone is going through the same thing.

  32. Thanks for this! I’m pretty sure my eyes were close to popping out before adding the manifest.

    For those who are having issues with this fix – if the app you are using is 32-bit, you may want to try changing the processorArchitecture value from “amd64” to either “x86” or “*”. Not a guaranteed solution, but it may help.

  33. Love that fix! awesome work m8, cheers!

  34. As of now, since release of SQL Server 2016 and SSMS having it’s own download page, you can now download the latest Version of SSMS here: https://msdn.microsoft.com/en-us/library/mt238290.aspx

    It now fully supports 4K displays. I just tested it on my XPS 15 and Works great! No longer any scaling issues with SSMS. Super happy now!

    • Not sure what you mean by fully supports. It looks like crap on my high res monitor. Windows render correctly, but the text is extremely blurry, I am missing something?

      • Just to leave a follow-up. I had my scaling at 225% and it was very blurry, changed it to 200% and it’s pretty good now. Not as good as apps that actual support high DPI, but much better.

  35. wow – Fantastic Fix!! – Can’t believe Microsoft have not resolved this yet though…

  36. Thanks so much… stupid Windows

  37. Thank you! very helpful. now my eyes will no longer pop out when I’m working with my Surface

  38. I’m running Windows 8.1 on a 27″ iMac so I can self-teach myself SSMS. Just getting the sizing right when I initially installed Windows took a minute. This process worked great and I can finally see EVERYTHING! Thank you so much!

  39. Thank you so much… This worked for me, then I had to redo this setting after a windows update. I’m using an iMac with SSMS on Windows 10 Boot Camp.

  40. Awesome tutorial mate! Thanks for this pro tip!

  41. Thanks!

    I used this for SSMS 2012 on my 4k screen and it works perfectly.

  42. As I mentioned before, this worked perfectly for SSMS 2012 on my 4k screen…. however, I just discovered that when I now go into SSRS (SQL Server Reporting Services) and edit a report in the Report Builder, the Report Builder’s resolution is ALL wrong… all small, just like SSMS was before this RegEdit and manifest change.

    When I backed out the RegEdit change and manifest (and rebooted it allow the registry to be re-read), then when I edit a report in the Report Builder, the report builder is fine (and of course SSMS is back to being an unusable resolution.

    Is there any information available as to what is the conflict? Or perhaps an additional edit I could make?

    Thanks!

    Dave

    • I suggest that you download and install the latest ssms update. It supports hidpi without registry hacks that may affect other applications’ behavior.

      • The client that I am working for is using SQL 2012. If I install the latest SQL 2016 we would be out of sync.

        Is there a way of using the latest SSMS on SQL 2012? Perhaps I’m misunderstanding something about that. (I wouldn’t be the first time!)

        Thanks for your help.

        Dave

      • Ssms is not tied to a particular version of the relational engine anymore. You can work with any version of SQL server using the latest ssms.

  43. ah, yes…. it been a long day…. I’ll try the SSMS download later tonight.

    Thanks for your help!

  44. Thanks.

    I had forgotten that Microsoft no longer ties SSMS to a particular version…. plus now the Developer’s Edition of SQL is free.

    Using the latest version of SSMS does indeed solve the 4k monitor problem for both the SSMS and SSRS’ Report Builder.

    Thanks for your help.

    Dave

  45. Thank you very much for this tip! I have been struggling with this issue for as long as I can remember after switching to Windows 10 Anniversary edition. Not only SSMS 2014 was affect, so was VS 2012. This tip helps me to fix them both. Thank you!

    • This fix does not work for VS 2012. While everything displayed correctly, I ran into this error

      “Error while trying to run project: Unable to start debugging.
      An error occurred that usually indicates a corrupt installation (code 0x80040155). If the problem persists, repair your visual studio installation via ‘Add or Remove Programs’ in Control Panel.”

      Removing the manifest file and the error is gone.

  46. This still appears to be a problem with Sql Server Data Tools for VS 2015. Just fixed it using the variant described by pynchmeawake . Awesome.

  47. Lee S Jackson

    This worked awesome – thank you!

  48. thanks for the tip. works great, and saves lots of hassles

  1. Pingback: Using SQL Server on high resolution monitors - Simons SQL Blog

  2. Pingback: Announcing SQL Server Management Studio - November 2015 Release - Microsoft SQL Server Release Services - Site Home - MSDN Blogs

  3. Pingback: Announcing SQL Server Management Studio Release - Microsoft SQL Server Release Services - Site Home Blogs - MyDBAPool

  4. Pingback: Announcing SQL Server Management Studio – November 2015 Release - MyDBAPool

  5. Pingback: SSMS February Preview – Curated SQL

  6. Pingback: FIX: SQL Server Management Studio and 4k Monitors - SQL Server - SQL Server - Toad World

  7. Pingback: SSMS in High-DPI Displays – Senior DBA

  8. Pingback: SSMS 2016 is now HiDPI ready | spaghettidba

  9. Pingback: [Windows 10] DPI Scaling madness on High Resolution Monitors | ConfigMonkey.co.uk

  10. Pingback: SSMS in High-DPI Displays: How to Stop the Madness – Nicholas Rogoff Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: