I know when I'm out of my depth on something and need to ask the experts, and this is a bit of a doozy.
I have a 4 monitor setup on my video card...
1. 1080x1920 Primary Desktop
2. 1280x720 Extended Desktop
3. 1280x720 Extended Desktop
4. 1280x720 Extended Desktop
I would like to have an AHK script that will allow me to press one key to toggle through the following multi monitor changes for monitor 4.
a. Monitor 4 is an extended desktop
b. Monitor 4 is a duplicate of monitor 2
c. Monitor 4 is a duplicate of monitor 3
I'm using a single NVidia Video Card to drive all of these displays (Kepler based) but I don't even know if there is scripting available to make these types of changes.
I found this script for ultramon which seems like it will be helpful for the mirror switching...
Const SOURCE_MON = 2 'number of the monitor which should get mirrored
TARGET_MONS = Array(3,4) 'number of the monitor(s) the source monitor should be mirrored on
Const MIRROR_EXE = "%ProgramFiles%\UltraMon\UMMirrorClient.exe" 'path and name of the mirroring executable
Set sh = CreateObject("WScript.Shell")
umVer = sh.RegRead("HKLM\Software\Realtime Soft\UltraMon\CurrentVersion")
val = ""
For i = 0 To UBound(TARGET_MONS)
val = val & TARGET_MONS(i) & ":" & SOURCE_MON & ";"
Next
sh.RegWrite "HKCU\Software\Realtime Soft\UltraMon\" & umVer & "\Mirroring\Monitor\Mirror Monitors", val
sh.Run """" & MIRROR_EXE & """ /start monitor"
also there is a plugin for Ultramon called MirrorMon which looks like it has some nice extra variables...
Const MONITOR = 2 'number of the monitor that should be mirrored
Const MIRRORMON_EXE = "%ProgramFiles%\UltraMon\MirrorMon.exe" 'location of MirrorMon.exe
Const POSITION = "100,100" 'position (x and y coordinates) of the MirrorMon window
Const SIZE = "400,300" 'size (width and height) of the MirrorMon window
Const OPTIONS = "" 'options for MirrorMon window: m = maximized, f = fullscreen
Const ZOOM = "100" 'zoom factor in percent
Set sys = CreateObject("UltraMon.System")
Set sh = CreateObject("WScript.Shell")
Set mon = sys.Monitors(CLng(MONITOR) - 1)
cmd = """" & MIRRORMON_EXE & """ /s 1 " & mon.HMonitor & " /w " & POSITION & "," & SIZE & "," & OPTIONS & " /z " & ZOOM
sh.Run cmd
This script is supposed to toggle mirroring on or off, but I'm not sure if it will do what I need.
Const UM_MIRROR_EXE = "%ProgramFiles%\UltraMon\UMMirrorClient.exe"
Set sh = CreateObject("WScript.Shell")
umVer = CLng(0)
str = sh.RegRead("HKLM\Software\Realtime Soft\UltraMon\CurrentVersion")
If str <> "" Then
strParts = Split(str, ".")
str = "&H"
For i = 0 To 2
num = Hex(strParts(i))
If Len(num) = 1 Then num = "0" & num
str = str & num
Next
str = str & "00"
umVer = CLng(str)
End If
If umVer >= &H03000300 Then
'3.0.3 or later
Set wnd = CreateObject("UltraMon.Window")
running = wnd.Find("UltraMonMirrorMsgWnd", "UltraMonMirrorMsgWnd", 3, 0, 0)
If running = True Then
sh.Run("""" & UM_MIRROR_EXE & """ /stop")
Else
sh.Run("""" & UM_MIRROR_EXE & """ /start lastmode")
End If
Else
'3.0.2 or earlier
If sh.Run("""" & UM_MIRROR_EXE & """ /start",, True) = 2 Then
'mirroring already running, stop it
sh.Run("""" & UM_MIRROR_EXE & """ /stop")
End If
End If
There's a bunch of super useful UltraMon scripts on this page that look very interesting for multi-monitor setups.
http://www.realtimesoft.com/ultramon/scripts/