Add context menu for DPI settings - windows

There are over 200 older programs that aren't displayed correctly and setting each .exe DPI awareness is a chore, I'm looking for a way to automate it from a batch process or a context menu that would possibly make it easier and quicker.
Is there a way DPI Aware settings on Windows 10 context menu, or somehow change the DPI settings to all the .exe/.lnk files in a single menu?

Related

Changing high DPI scaling override property under Windows 10

In the Windows 10 file properties of an executable in the compatibility tab, there is an option to override the default DPI scaling behaviour. The default is "Application", which lets the program handle DPI scaling itself. I'd like to change this option on an executable (not developed by me), which I want to be scaled by Windows (option "System"). How can I change this property programmatically (WinAPI?)?

Make Windows Common Dialogs "Per Monitor DPI-Aware"

I have a program which was created in VS2008 with MFC.
Now I've modified it to make it "Per Monitor DPI-Aware", and it's almost done. I've modified the manifest and handled the WM_DPICHANGE message. But there's still one problem:
I used CFileDialog class to show Open/Save dialogs, and used SHBrowseForFolder function to show folder selection dialog. But all these dialogs are NOT "Per Monitor DPI-Aware", they won't adjust their UI when you move them between monitors with different DPI settings.
I use spy++ to monitor messages of these dialogs, I find they can receive WM_DPICHANGED message but they just don't handle it.
And I've tested the open file dialog in notepad.exe on Windows 10, it worked perfectly.
Does anyone know how can I make these dialogs "Per Monitor DPI-Aware"?
--------EDIT--------
There're two more problems:
When I move a window to a monitor with different DPI, the window resize itself, but the height of it's title bar and title font-size are not changed.
The checkbox controls' box size is not changed either.
I feel these problems may have some kind of connections, but I can't figure it out.
--------SAD NEWS--------
I compiled microsoft's "DPI Tutorial Sample" with VS2013, and it has the same problem.
https://code.msdn.microsoft.com/DPI-Tutorial-sample-64134744
The titlebar (caption bar) can be scaled by calling EnableNonClientDpiScaling which is available on versions of Windows >= the Windows 10 Anniversary Update (1607).
If you want to DPI scale an older dialog that doesn't support per-monitor DPI scaling you can use SetThreadDpiAwarenessContext (with DPI_AWARENESS_CONTEXT_SYSTEM_AWARE or DPI_AWARENESS_CONTEXT_UNAWARE) to have the top-level windows of the dialog scaled by Windows. The dialog might be blurry but it will at least be sized correctly (also only available on >= 1607 builds of Windows 10). The usage pattern is to call this API before opening the dialog and then restore the previous DPI context immediately after calling the API.
According to MSDN the window that processes WM_DPICHANGED message should return 0. However, any MFC window or control you send WM_DPICHANGED will return 0, since thay call the default window procedure for the unknown messages.
Therefore, judging if some window does process WM_DPICHANGED message by testing its LRESULT return value against zero is not accurate.
The window's title bar of a per-monitor DPI aware application doesn't scale when moving across different DPI monitors as documented on MSDN. Unfortunately, non-client area of the window never adjust the DPI.
Calculator and other per-monitor DPI aware Windows native apps have custom title bar drawing, as described here.

Why these icons don't combine while my taskbar buttons group policy is "always combine"?

my system is Win7 Ultimate 32bit, and my taskbar buttons group poliy is "Always combine, hide laybels".
There is one program that have some shortcuts, when I open that program by clicking different shortcuts, I found that the icons didn't combine as the policy says.
All these shortcuts are targeted to the same position.
Can anyone tell me why this happen and how to combine all these icons?
Thanks
PS:The system says that I am a new user and have no right to post images....
Applications do have some control over their taskbar appearance but the shortcut used to start them also matters. If one shortcut specifies a App Model Id and a different shortcut does not (One you created perhaps?) then Windows might decide that these are two different apps (Or the same app with separate "modes")
If the application does not call SetCurrentProcessExplicitAppUserModelID then the auto generated Id might also not match if you run 32 and 64 bit versions of the same app...

Control Panel Item Icons (Windows XP)

Control Panel items are normally registered under HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace, however a lot of the built-in panels aren't listed there, such as the Automatic Updates item.
I'm trying to find out where the icon used for the Automatic Updates item is. If you open the Control Panel in Tiles mode (48x48 icons) you'll see the icon is being scaled up, yet all of the icon resources in all of the Windows Update files have 48x48 subimages, so I can't figure this one out.
It's a similar story with the NVidia control panel item: the icon is black and seemingly downscaled from a subimage larger than 48x48, yet the actual nvidia control panel files don't contain this black icon (instead they have the silver version). When I create a Shortcut to the control panel item and inspect its binary bits there is no path to the icon specified, just to the cpl file itself (with the totally different icon). I've checked the registry and there aren't any clues in there either.
Any ideas?
Control Panel applets can be registered in several different ways, or not at all (if they reside in the %system% folder):
Registering Control Panel Items
If an applet does not register its icon information in the Registry, then the applet has to provide the icon information when requested by the Control Panel via the CPL_INQUIRE and/or CPL_NEWINQUIRE messages to its CPLApplet() entry point, in which case the applet has no idea what size icon to return. It sounds like maybe you are running into that scenario.

"Use windows xp style dpi scaling" disables automatic auto-hide of taskbar on W7. Workaround?

We noticed that on W7 with DPI set to > 125% or to > 100% with ("Use windows xp style dpi scaling") turned off, our fullscreen mode (which sets the client rect of our window = desktop rect of the main monitor) no longer hides the task bar like it does for other settings.
(The setting can be found in the Control Panel\Appearance and Personalization\Display section after clicking on the "Set custom text size (DPI)" link)
I found the following interesting article:
http://www.mathies.com/weblog/?p=908
So I set out to try to work around the bug in other means than manually hiding/restoring the taskbar visibility but so far I've failed and currently believe it's a bug in W7 (and possibly vista).
The following applications also fail to work properly in fullscreen mode (the taskbar is still visible):
* Microsoft Visual Studio 2008
* Microsoft Word 2007
* Adobe Reader 9.1.3
These apps work (probably by hiding the task bar through the WIN32 API):
* Powerpoint Slide Show
I also tried creating a brand new MFC-based app and use its "SetFullScreenMode()" functionality but it fails in the same way as all other apps on the list.
For now it seems the only temporary fix which has worked for me is to disable display scaling on high DPI settings for the program your using fullscreen with.
To do this goto properties (right-click the program's shortcut) >> compatability >> and check the option to disable display scaling on high DPI settings.
The only drawback is that you will not get the higher DPI for that program but the taskbar should hide when fullscreen is enabled.
This is a problem that I understand Windows 7 developers are aware of but have not come out with a solution.

Resources