SP3 and multiple monitors.

Discussion in 'Microsoft' started by scrambler, Jul 14, 2014.

Thread Status:
Not open for further replies.
  1. scrambler

    scrambler Scribbler - Standard Member

    Messages:
    301
    Likes Received:
    19
    Trophy Points:
    31
    OK so I am starting to review setting up the SP3 with a secondary monitor (23" Viewsonic 1680 x 1050).

    The usage scenario I want is:

    - Large monitor screen set as extended desktop.

    - The W8 Tile start page on the SP3 screen, which from what I understand means the SP3 has to be the primary monitor. The SP3 will be used to select Apps, run and display W8 apps on the side.

    - The 23" screen will be used to run all the desktop applications.

    Problems I can see so far.

    1) I run the SP3 at 150% (dpi) as this is what I consider readable onthe tablet (old eyes). At that Dpi settings, things on the 23" monitor are a bit on the large side...

    2) When I open a desktop program in dual monitor configuration, I would like it to automatically open on the 23" ext screen. As far as I can tell W8 just opens it where it was opened last, so after using the tablet only, it opens up on the tablet and I need to move it again.

    3) Although there is a Shortcut to send a window to the next monitor (W+Sh+->) there is no easier way to decide where to open or move a window/program.

    4) I want some desktop Shortcuts on the 23" monitor. W8 does not retain their position on the ext. screen after using the tablet by itself.

    Basically W8 does not provide much tools (apart from the sidebar settings and the monitor position) to facilitate using the SP3 as your desktop engine with an External monitor.

    Doing some research, so far it looks like UltraMon should enable me to fix all the above mentioned problems.

    1) In order to fix the scaling problem on the external screen coming from using the SP3 at 150%, the only solution I know is to change the SP3 resolution to a smaller one and use a lower dpi percentage. This is acceptable in the multi screen configuration as the SP3 is only used for the start screen and Windows App, but not great when I go back to using the SP3 by itself.
    The solution is to be able to automatically change the resolution and dpi when using two screens, but not when using the Tablet by itself.
    Apparently Ultramon has Display profiles you can define to do just that, and it also has scripts that can activate them only when in the multi monitor configuration. BUT I am not sure display profiles can change the dpi...

    2) Ultramon adds monitor selection to shortcut properties to accomplish just that. I have to test what happens if you use a shortcode meant to open something on the second screen when using the tablet by itself (hopefully it default to the single screen available).

    3) Ultramon adds monitor control on any window top, so that should help.

    4) It looks like Ultramon also enables to save desktop icon configuration for each monitor.

    The main other app I found is Display Fusion(pro). I have not seen if they can activate a display profile automatically when detecting a second monitor.

    Before I go ahead and get Ultramon to start testing this, I was wondering if others have setup the SP3 with an external monitor, and if they have found existing W8 solutions, or other alternative ones to these questions, as well as eventually have some experience with Ultramon in this scenario.

    Thank you for sharing :)
     
    Last edited: Jul 14, 2014
  2. smithderek76

    smithderek76 Pen Pal - Newbie

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    5
    I prefer Actual Multiple monitors (but would recommend ordering Actual Windows Manager which adds 8 additional software packages for a seriously discounted price) myself it has a feature that lets you easily move things to your preferred screen. I have a six monitor setup that I have at times ran with a desktop a laptop and a AIO desktop but I've never used a tablet I imagine it would work with two monitors much in the same way.
     
  3. scrambler

    scrambler Scribbler - Standard Member

    Messages:
    301
    Likes Received:
    19
    Trophy Points:
    31
    I thought I would give an update to the solutions I found and implemented for the various problem I mentioned in the OP.

    1) First the good news is that W8 remembers most Display settings of the various monitor configurations. Mainly the resolution and the respective position of both the tablet screen and the external monitor.

    So no need for any Software on that front. If I change the resolution of the tablet when in two monitors configuration, it will revert to full res when used alone, and switch back to the lower resolution I set when connected to an external monitor.

    It does not however remember the Dpi setting changes, and none of the software like Ultramon, display Fusion... take care of that either.

    I also noticed that, in addition to not getting blown up elements on the external monitor, in order to get sharp text, I really need to have the External monitor dpi set at 100%. If using anything else, the text is fuzzy. In order to make sure the dpi on the external monitor is actually 100%, I have to check the option that says use the same dpi value on all monitors.

    Now in order to automatically change the dpi settings from 150% when the tablet is used alone to 100% when the External monitor is connected, I ended up making a Script.

    After getting some initial help from the Ultramon developer, I finalized a script that monitors the dpi value and the number of monitor present.

    When I connect an external monitor, W8 reduces the resolution of the tablet, and my script changes the Dpi from 150% to 100% so the external monitor is run at native resolution with sharp text at a reasonable size. The Script also causes a Log off / log in so the new Dpi value can be taken into account (this is a pain but apparently unavoidable for now).

    In the same way, when I disconnect the external monitor, W8 resets the resolution of the tablet to its maximum value, and the script detects the change and goes back to 150% dpi.

    2) I found out that if I set the External monitor to be my Main Display, If I bring up the W8 Start Screen on the tablet, when I tap a Desktop program tile it automatically opens on the External monitor, but if I tap a W8 App tile, it opens up on the tablet Screen. This is perfect as this is exactly how I wish to use both screen. External monitor for all desktop activity, and Tablet Screen for start screen and on the side apps.

    3) To make it easier to switch any windows between the two monitors, I added a component in the script that lets me do that either by a middle mouse click on the Window Title bar, or by using the Printscreen key.

    4) It looks like W8 also keeps track of desktop shortcuts, but I have eliminated all desktop shortcuts by creating category popup list on the taskbar using the 7Stacks utility.

    Initially I scripted the dpi change in VBScript, but given I used Autohotkey to script the Middle mouse click and Printscreen button to swap windows between monitors, I ended up doing everything in Autohotkey.

    If anyone is interested in either the script for changing the Dpi value (Vbscript or Autohotkey) or the one to swap windows between screens using mouse and key shortcuts, I will be happy to make them available for download.
     
    Last edited: Jul 20, 2014
  4. scrambler

    scrambler Scribbler - Standard Member

    Messages:
    301
    Likes Received:
    19
    Trophy Points:
    31
    So after more testing, I found out that I could probably live with the Auto Scaling on the external monitor as far as object sizes are concerned, but I also found out that in that mode the text on the external monitor is fuzzy.

    So at the end of the day, I am sticking with the script for now, until I have investigated what the situation is if I upgrade to a QHD monitor.

    As requested in another thread, I am posting the script that changes the Dpi settings when detecting a change in number of monitors.

    Remember the script only deals with the Dpi change (scaling factor), as W8 takes care of changing the resolution, to what you set it for, automatically.

    It is changing the dpi value that is used in non automatic mode, which means when you check the "let me choose one scaling for all display" options.

    The reason for that is explained above. If you wanted to change the base scaling factor when in Auto mode you would need to do some reading here:
    DPI-related APIs and registry settings
    and figure out the different registry key(s) to change. But the script structure would be exactly the same, only the registry keys being change would be different.

    -----------------------------------------------------------------------------------------------------------------------------
    VBScript version (To use, put in notepad and save with the extension .vbs)
    WARNING, the forum inserts a space in impersonate below (becomes impersonat e which causes a script error), so DO NOT COPY PASTE the Vbscript, download it from
    https://onedrive.live.com/?cid=4BE668230430EFDD&id=4BE668230430EFDD!847
    -----------------------------------------------------------------------------------------------------------------------------

    Const DPI_SINGLE_MON = 144 'DPI setting for single-monitor configuration
    Const DPI_MULTI_MON = 96 'DPI setting for multi-monitor configuration
    Const POLLING_INTERVAL = 1 'number of seconds the script waits between checking for display configuration changes

    Set sh = CreateObject("WScript.Shell")
    strComputer = "."


    Do While True
    'procedure to count the number of monitors
    set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" & strComputer & "\root\wmi")
    set colItems = objWMI.ExecQuery ("SELECT * FROM WMIMonitorID")

    'testing if the system is in he right configuration
    currentdpi = sh.regread("HKEY_CURRENT_USER\Control Panel\Desktop\LogPixels")

    If colItems.count = 1 Then 'if current dpi does not match single monitor value reset it
    if currentdpi <> DPI_SINGLE_MON Then
    dpi = DPI_SINGLE_MON
    'change DPI setting and border width
    sh.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\LogPixels", dpi, "REG_DWORD"

    'log off to apply new settings
    sh.Run "shutdown /l"
    End if
    Else 'we are in a Multi monitor configuration
    if currentdpi <> DPI_MULTI_MON Then 'if current dpi does not match multi monitor value reset it
    dpi = DPI_MULTI_MON
    'change DPI setting and border width
    sh.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\LogPixels", dpi, "REG_DWORD"

    'log off to apply new settings
    sh.Run "shutdown /l"
    End if
    End if

    WScript.Sleep POLLING_INTERVAL * 1000
    Loop

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Autohotkey version (To use you need to install the latest version of Autohotkey from autohotkey, then put the script in notepad and save with the extension .ahk)
    I added a test in this one to see if a key application was open before doing a logoff and issue a warning..
    You can download the file here: https://onedrive.live.com/?cid=4BE668230430EFDD&id=4BE668230430EFDD!847
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
    SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

    ;Changing dpi settings according to the number of monitors

    Single_Mon_Dpi = 144
    Multi_Mon_Dpi = 96

    Loop
    {
    Sysget, NbM, MonitorCount ;count monitors
    ;Msgbox Number of Monitors: %NbM%

    RegRead, CurDpi, HKEY_CURRENT_USER, Control Panel\Desktop, LogPixels ;reads the dpi value
    ;Msgbox Current Dpi is %CurDpi%

    if (NbM = 1)
    {
    if CurDpi <> %Single_Mon_Dpi% ;If single monitor check if the dpi value is wrong, is so change
    {
    ;Msgbox Changing the Dpi to %Single_Mon_Dpi% and loging off
    If WinExist("Word") or WinExist("Excel") or WinExist("Internet") or WinExist("Adobe")
    {
    Msgbox Resolution needs to be changed, SAVE YOUR WORK! and Click OK
    }
    RegWrite, REG_DWORD, HKEY_CURRENT_USER, Control Panel\Desktop, LogPixels, %Single_Mon_Dpi%
    shutdown, 0
    }
    }
    else
    if CurDpi <> %Multi_Mon_Dpi% ;If Multi monitor check if the dpi value is wrong, if so change
    {
    ;Msgbox Changing the Dpi to %Multi_Mon_Dpi% and loging off
    If WinExist("Word") or WinExist("Excel") or WinExist("Internet") or WinExist("Adobe")
    {
    Msgbox Resolution needs to be changed, SAVE YOUR WORK! and Click OK
    }
    RegWrite, REG_DWORD, HKEY_CURRENT_USER, Control Panel\Desktop, LogPixels, %Multi_Mon_Dpi%
    shutdown, 0
    }
    Sleep, 300
    }

    ------------------------------------------------------------------------------------------------------------
    To automatically run the script (.vbs or .ahk), either put it in your start folder, or run it at startup by creating a scheduled task.
     
    Last edited: Aug 6, 2014
    JoeS and sanjay0864 like this.
  5. sanjay0864

    sanjay0864 Pen Pal - Newbie

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    5
    @ scrambler
    Thank you for this. Will get back with my experience once I get it working.
     
  6. mcdonsco

    mcdonsco Pen Pal - Newbie

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    5
    I'm very interested in this script as I have the same issue of having to change the dpi every time I switch between external monitor / just the surface which I do several times per day.

    But, the script isn't working for me; comes up with errors line 11 char 1...I know virtually nothing of scripting and have not been able to get it to work?
     
  7. scrambler

    scrambler Scribbler - Standard Member

    Messages:
    301
    Likes Received:
    19
    Trophy Points:
    31
    OK, So it appears that when I paste the VBScript in here, it adds a space in one of the lines and corrupts the script.
    on line 11, it shows
    impersonat e
    instead of
    impersonate.
    And It adds it even if I correct the post....

    I have Uploaded both script files uncorrupted here:
    https://onedrive.live.com/?cid=4BE668230430EFDD&id=4BE668230430EFDD!847

    They are called Dpi-Change.vbs and Dpi-Change.ahk

    Note: if you know nothing of scripting, you should probably use the Autohotkey version, as it is easy to kill the script if it is not doing what you want. When running a Autohotket script, a big H icon ends up in the Taskbar Icon Area and you can right click and exit the script this way.
    Now in order to use Autohotkey scripts, you do need to install Autohotkey from Autohotkey.org. just click on the Download button on the front page.

    On the other hand, a running VBscript needs to be killed Via the task manager, and the process to kill is less obvious. Also the VBscript should be run at startup using a scheduled task so you can run it with the highest privilege and avoid the UAC prompt.
     
    Last edited: Aug 6, 2014
  8. Ma3leemz

    Ma3leemz Pen Pal - Newbie

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    5
    Hello Scrambler..
    I've been browsing the net about this issue and you are the one that seems to have given the most effective solution.
    Now before I try it, can you please clarify if this will work with Win 10 Surface Pro 4?
    Also which script do I use then from the ones you posted in your drive?
    Thanks for your help.
     
  9. dstrauss

    dstrauss Comic Relief Senior Member

    Messages:
    12,445
    Likes Received:
    12,023
    Trophy Points:
    331
    @Ma3leemz - you might want to check out the improved scaling support in Windows 10 1511 - I use two Acer K272HUL (2560x1440) monitors daisy chained off the new dock, and can scale them independent of the SP3 and each other (if need be - for example, I generally use them at 150% scaling, and 200% scaling for the SP3, but I can do 200%+ on one just for tired old eyes if need be). Be sure to do all of teh updates now available, including 12/1, before setting up your multiple monitors.
     
Loading...
Thread Status:
Not open for further replies.

Share This Page