Quick-switch between Extended Desktop and Surround?

Hi!, first post here so hi everyone!. Yes, sucks that my first post is to ask for help sorry =(.

I recently put together a NV Surround setup and while everything seems to be working as it should I just can't make any of the ideas or tricks mentioned everywhere to quickly switch from surround to extended and back to surround work.
I'm running Win8.1 on a single GTX770 (will add SLI later on) and I've tried the WIN+P trick, the nvidia shortcuts and the script posted here and changing the DPI/screen settings among others. I can get surround working and go back to extended using the script posted here but Unknown-One but running it again says it failed to activate surround. The NV shortcuts have a similar issue, I can go from Surround to a single screen (other two disabled) but I can't switch back to Surround.

Has anyone managed to make switching back and forth work on Win8.1? Is there anything else I could try or maybe something that I'm doing wrong?.
 
I can get surround working and go back to extended using the script posted here but Unknown-One but running it again says it failed to activate surround.
So when you're already in Surround mode, my script will drop you back to 3 monitors in Extended Desktop mode without a problem... well, that's good.

When switching from Extended mode back to Surround mode, my script simply calls Ctrl + Alt + S (the default hotkey for activating Surround). If pressing Ctrl + Alt + S manually doesn't activate Surround, then you have a driver problem (or you've disabled driver hotkeys)
 
Yup, if I run your script when in surround mode I see it going from Surround to just 1 screen (the other 2 blank) then the WIN+P menu shows up and it goes back to 3 screens without any issue.

I'll do a clean driver install and see if that fixes anything.

Thanks!.
 
So when you're already in Surround mode, my script will drop you back to 3 monitors in Extended Desktop mode without a problem... well, that's good.

When switching from Extended mode back to Surround mode, my script simply calls Ctrl + Alt + S (the default hotkey for activating Surround). If pressing Ctrl + Alt + S manually doesn't activate Surround, then you have a driver problem (or you've disabled driver hotkeys)


Okay so I did a clean install of the latest drivers. Uninstalled the ones I had, boot into safemode to clean up everything then installed the newest stable (340.52) drivers again.

Steps I did:
  • Setup Surround and it worked correctly as usual.
  • Ran your script and it dropped me from Surround to extended desktop.
  • Ran your script again and it successfully switched to Surround! (Bezel correction resolultion were lost but expected).
  • I decided to reboot my computer to see what would happen.
  • Ran your script and it failed to switch into Surround. Tried running it again and the first-time config popup showed up.


What I've seen so far:
The NV Surround shortcut doesn't seem to work everytime. There's a chance that if I setup surround I can use your script to switch back and forth but there's also a chance that it will drop me into Extended fail when trying to go back to surround (when this happens the manual shortcut doesn't work either) and even if it works it's lost when my computer restarts.

Any ideas?.
 
If manually punching-in the Nvidia shortcut (Ctrl + Alt + S) isn't working, there's not much I can do.

That's a driver bug and should be reported to Nvidia.
 
I just came in to post a huge THANK YOU for this script, Unknown One, which is now pinned to my start menu in Windows 8.1. The only change I had to do was to set the surround change button to ctrl + alt + s in Nvidia control panel. Now that I have the power to game on all 3 screens, but need SLI to be disabled for work, this is a massive, huge time saver.

Setup: U2412ms, 1920x1200 x3, GTX 980 SLI.
 
Just had to register to thank OP for this amazing tool!!
I searched for over 4 hours for a fix to the ugly borders on my windows aswell as VLC spanning across all three screens leaving two screens black (since changing back to extended takes 2-3min and shitloads of clicking) and stumbled upon this thread and i cant thank you enough dude! This tool has saved me so much hassle when going back and forth from surround id almost kiss you (nohomo)!!

The only bug i encountered was that for some reason it suddenly stopped returning to 3 screens extended and only activated one screen (primary) but a reboot solved that so not too worried :)

Setup: 3x 27" Samsung S27D391HS @ 1920x1080/5760x1080 powered by a GTX 780 OC DCII
 
Curious if this will work with 4 GPUs and 4 Displays (3 in surround)?

Im ultimately looking for a way to toggle between surround and all display mode due to each display being connected to its own gpu (apart from the accessory one, for some reason i CANNOT get that to work unless its sharing a gpu)

Since nvidia doesnt care to enable SLI in windowed, if i want to run say, multiple wow clients I cant do so without losing SLI and thus performance bigtime. to make things worse, it forces all the cards to run at 100% all the time causing me to essentially overheat.

Being able to toggle between surround and between each gpu driving its own monitor would be amazing. Considering nvidia requires them to be plugged into their own seperate cards for SLI to work, i dont know why its so hard to un-SLI it yet still have it powering their own respective displays.

Aaaaanyways. Way to go on making the script for the community regardless of whether it will work for me or not.
 
Curious if this will work with 4 GPUs and 4 Displays (3 in surround)?
Give it a try and let me know! I'm curious if it works (or if it doesn't work, how it fails) on such a setup.

I might be able to whip-up a fix if there's a problem. :)

The only change I had to do was to set the surround change button to ctrl + alt + s in Nvidia control panel.
Was that key-combo set to something else by default on Windows 8.1, or just not enabled by default?
 
well - fwiw i just tried it and it initiates - gives me the notice to make sure that surround is enabled (which it is) and proceeds to open the win+P bar. It defaults on extend and it seems to click it and close the bar but since thats where it was anyhow, it did nothing.

I figured perhaps it was the tick and not the tock, so i tried it again - same result.

Essentially does nothing :p lol.

To be clear, I have 4 cards, and 4 displays. 3 are in surround, the 4th is just an accessory display. Nvidia requires me to have each display hooked up to a different card EXCEPT the accessory display which will not work unless it shares a card (the first one) which drives me nuts but thats a different story. They are all in portrait which I noticed your script had/has? issues with. Unsure if they were resolved.

Either way, im using win 8.1 x64 and yea.....

I have all the nvidia shortcuts enabled, and boy are they buggy but I seem to be able to get them toggling between surround and single display sli just fine, but trying to toggle between single display to all display/extended or surround to all display/extended isnt working.

Gah! What gets me is these guys are making money hand over fist, they have been charging twice what ati/amd has been for decades now. Theyve been pushing SLI/Surround for many years so its not like its a new or immature technology. If their is one place nvidia falls flat on its face, its software support and quality control :p

Getting off topic again. Anyhow, if you have time/when you have time, if you can clarify whether or not it "should" be working with my set up, and if not.. if you can make adjustments - ill gladly test for ya :)

Either way, thank you very much!
 
Just came across this thread. Unknown-One, you are a badass ninja.

This works perfectly for me. I have a single 970 with 3x 1920x1080 monitors on Win 8.1. Coming from an ATI setup, their profiles are a start, but still a pain. Nvidia's shortcuts work well for turning off Surround, but left me with only one screen and then having to manually setup the 3 screens for normal extended desktop every time.

Anyway THANKS Unknown-One!
 
well - fwiw i just tried it and it initiates - gives me the notice to make sure that surround is enabled (which it is) and proceeds to open the win+P bar. It defaults on extend and it seems to click it and close the bar but since thats where it was anyhow, it did nothing.
I think the fact that you have Surround + an additional Extended desktop is what's screwing up the script. I never accounted for such a configuration.
It checks that the aspect ratio of your primary monitor is wide enough to be a Surround config, passes that check, and tries to switch... at which point, it fails, because Windows already has your display configuration down as "extended".

I'll attach a spare monitor to my Surround setup so I can troubleshoot. Keep an eye on this thread, I think this is fix-able :)
 
you are amazing!! Ill be absolutely speechless if you make it function properly. You will help ALOT more people than you see in just this thread thats for sure. Already are :p

Anyhow, in case it helps or is relevent. The 3 screens are 27" 2560x1440 in portrait and the bezel corrected resolution is 4680x2560. The accessory display is a 24" 1920x1200 in portrait.

Since nvidia/windows is wonky and cant get on the same page, the monitors are individual shown as 1-2-4-3 and in "surround" the surround is shown as 2 and the accessory is shown as 1 for some reason. Even though the surround is set as my "main" display obviously.

Anyhow, hope all that made sense. Take your time. Ive lived with it this long and I'd hate to see you use time you could use for something else just for little ole me :p

That being said, ill be keeping an eye lol. Thanks again!
 
Ok, so, I've figured out what's causing things to screw up on Windows 8.x

It's a bug in Nvidia's drivers. The Ctrl + Alt + S key-combo, which is supposed to toggle between Surround enabled /disabled, only works one-way. It will disable surround, but not re-enable it.

This is a legitimate driver bug that should be reported to Nvidia. Anyone know if they have a submission form?

Edit: For reference, changing Windows 8.1'as DPI scaling mode to "Let me choose one scaling level for all my displays" seems to have fixed the problem. Still a pretty obvious bug, but at least there's a work-around
 
This refuses to work for me and I do not know why.

It will change from NVSurround to the Extended 3 monitors but will not change back to NVSurround.

I just get an error and the next time I launch it, it's back at the "First Time Setup" thing.


Rig is in the Sig, using latest drivers (344.75) on Windows 8.1 Pro. All monitors are connected to the primary card (as SLI requires this)


The only thing I think it could be related to is I am running DisplayFusion to give me taskbars when in extended mode. Not sure if that program is causing issues. I do notice when I change to NV Surround (via NVCP) I only get a taskbar on the center monitor, I would think Win 8.1 would put it on all 3...
 
This refuses to work for me and I do not know why.

It will change from NVSurround to the Extended 3 monitors but will not change back to NVSurround.
...I just said in the post above yours that there's a driver bug causing the problem. Not much I can do about it until Nvidia fixes their drivers.

Nvidia's drivers stop listening for the Ctrl + Alt + S key combo randomly, making it impossible to switch reliably (even if you try to do it by manually entering the key combo, it doesn't work).

I'm currently rewriting the app to actually interact with the driver GUI directly... it's the last thing I wanted to do, but it will work no matter what Nvidia screws up with their hotkeys.
 
Last edited:
...I just said in the post above yours that there's a driver bug causing the problem. Not much I can do about it until Nvidia fixes their drivers.

Nvidia's drivers stop listening for the Ctrl + Alt + S key combo randomly, making it impossible to switch reliably (even if you try to do it by manually entering the key combo, it doesn't work).

I'm currently rewriting the app to actually interact with the driver GUI directly... it's the last thing I wanted to do, but it will work no matter what Nvidia screws up with their hotkeys.
I did the work around in your post (Windows DPI setting) and that still doesn't work. You made no mention of the work around not working constantly.
 
I did the work around in your post (Windows DPI setting) and that still doesn't work. You made no mention of the work around not working constantly.
Its been mentioned multiple times in this thread that issues are being caused by Nvidia's drivers not responding to the key-combo that they're supposed to respond to. Either scripted or manually entered by users.

The only thing I can do now is redo my scripting to actually open the Nvidia control panel and click all the buttons automatically because Nvidia's hotkey system is so utterly broken. I'll try and get a proof-of-concept released tonight.
 
Last edited:
Ok, give this release a try guys. Now the script attempts to use the Nvidia hotkey to switch, and if that fails, will then MANUALLY configure Surround through the GUI for you.
If it has to fall back to configuration through the GUI, it's a bit on the slow side. Just click the button and wait, you'll see it step through the Nvidia control panel all on its own, and you should be put in the desired mode.

Version 4 (Beta 1) https://db.tt/rJUvuEH4
- Almost a total rewrite. More robust fallback. Fixes for Windows 8.1
- Will work even if the Nvidia hotkey system stops responding.
- This is a beta version, does not have full error handling, and can be slower to switch modes. May not work with SLI.


Save that executable somewhere, pin a shortcut to it on your taskbar, and you have one-click switching at your disposal. Also, make sure the following prerequisites are met:
1. Nvidia Surround has been set up manually at least once.
2. The Ctrl + Alt + S key-combo is enabled in the Nvidia Control Panel.


Source:
Code:
;NoTrayIcon
;==============================================================================================
; Determine current display state
;==============================================================================================
DetectNow:
IF (A_ScreenWidth/A_ScreenHeight > 1.8)
{
	Goto, ToggleOff
}

IF (A_ScreenWidth/A_ScreenHeight < 1.8)
{
	Goto, ToggleOn
}

MsgBox, 16, Nvidia Surround Toggle, ERROR: Failed to determine current display state.
Exit


;==============================================================================================
; Toggle-off routine (switch to Extended Desktop mode)
;==============================================================================================
ToggleOff:
WinActivate ahk_class Shell_TrayWnd
Send {LCtrl down}
Send {LAlt down}
Send {s down}
Sleep 100
Send {LCtrl up}{LAlt up}{s up}
Sleep 2000

IF (A_ScreenWidth/A_ScreenHeight < 1.8)
{
	Run %windir%\System32\DisplaySwitch.exe /extend
	Exit
}
Else
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 5
WinActivate
Sleep 2000
ControlClick, Static3				; Configure Surround link
Sleep 2000
Runwait, taskkill /im nvcplui.exe /f
Sleep 2000
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 5
WinActivate
Sleep 2000
ControlClick, Button4			; Span displays with surround checkbox
Sleep 1000
ControlClick, Button7			; Apply button
Sleep 2000
Runwait, taskkill /im nvcplui.exe /f
Run %windir%\System32\DisplaySwitch.exe /extend
Exit


;==============================================================================================
; Toggle-on routine (switch to Surround mode)
;==============================================================================================
ToggleOn:
WinActivate ahk_class Shell_TrayWnd
Send {LCtrl down}
Send {LAlt down}
Send {s down}
Sleep 100
Send {LCtrl up}{LAlt up}{s up}
Sleep 2000

IF (A_ScreenWidth/A_ScreenHeight > 1.8)
{
	Exit
}
Else
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 5
WinActivate
Sleep 2000
ControlClick, Static3				; Configure Surround link
Sleep 2000
Runwait, taskkill /im nvcplui.exe /f
Sleep 2000
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 5
WinActivate
Sleep 2000
ControlClick, Button4			; Span displays with surround checkbox
Sleep 1000
ControlClick, Button7			; Apply button
WinWait, NVIDIA Set Up Surround, , 5
Sleep 1000
WinActivate
ControlClick, Edit1				; Bezel Correction Value
Sleep 1000
Send 128{Delete}
Sleep 1000
Send {enter}
Sleep 2000
WinClose, NVIDIA Set Up Surround
Sleep 1000
Runwait, taskkill /im nvcplui.exe /f
Exit
 
Last edited:
Another day, another revision. This one should be significantly faster

Version 4 (Beta 2) https://db.tt/OiFRyEyI
- When enabling Surround, bezel corrected resolutions don't vanish anymore!
- Various speed improvements.
- Fixed delays replaced with wait-loops. Helps if the Nvidia control panel takes longer than expected to load.
- Works without using the Nvidia hotkey system, at all.
- This is a beta version, and does not have full error handling. May not work with SLI.

Source:
Code:
#NoTrayIcon
;==============================================================================================
; Determine current display state
;==============================================================================================
DetectNow:
IF (A_ScreenWidth/A_ScreenHeight > 1.8)
{
	Goto, ToggleOff
}

IF (A_ScreenWidth/A_ScreenHeight < 1.8)
{
	Goto, ToggleOn
}

MsgBox, 16, Nvidia Surround Toggle, ERROR: Failed to determine current display state.
Exit


;==============================================================================================
; Toggle-off routine (switch to Extended Desktop mode)
;==============================================================================================
ToggleOff:
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 5
WinActivate
Sleep 2000
IfWinExist, , Span &displays with Surround
{
	Goto, ToggleOffShortcut
}
Else
ControlClick, Static3				; Configure Surround link
Sleep 2000
Runwait, taskkill /im nvcplui.exe /f
Sleep 1000
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 5
WinActivate
Sleep 2000
ToggleOffShortcut:
ControlClick, Button4			; Span displays with surround checkbox
Sleep 500
ControlClick, Button7			; Apply button
ToggleOffWaitLoop:
IF (A_ScreenWidth/A_ScreenHeight > 1.8)
{
	Sleep 100
	Goto, ToggleOffWaitLoop
}
Else
Run %windir%\System32\DisplaySwitch.exe /extend
Runwait, taskkill /im nvcplui.exe /f
Exit


;==============================================================================================
; Toggle-on routine (switch to Surround mode)
;==============================================================================================
ToggleOn:
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 5
WinActivate
Sleep 2000
IfWinExist, , Span &displays with Surround
{
	Goto, ToggleOnShortcut
}
Else
ControlClick, Static3				; Configure Surround link
Sleep 2000
Runwait, taskkill /im nvcplui.exe /f
Sleep 1000
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 5
WinActivate
Sleep 2000
ToggleOnShortcut:
ControlClick, Button4			; Span displays with surround checkbox
Sleep 1000
ControlClick, Button7			; Apply button
WinWait, NVIDIA Set Up Surround, , 5
WinActivate
Sleep 500
ControlClick, Edit1				; Bezel Correction Value
Send 128{Delete}{enter}
ToggleOnWaitLoop:
IF (A_ScreenWidth/A_ScreenHeight < 1.8)
{
	Sleep 100
	Goto, ToggleOnWaitLoop
}
Else
Runwait, taskkill /im nvcplui.exe /f
Exit
 
Serious props for staying on this project with regular updates for so many years. I'm still using the older version of your utility that I downloaded years back for the GTX 680 still plugging along in my office PC. It's worked flawlessly all this time but I'll give this new version a shot and let you know if I see any difference.

On a side note, it'll be interesting to see how all this works on Windows 10. Never did get around to trying out 8.1 on a multidisplay system and it's looking like that's not going to happen at this point...
 
Serious props for staying on this project with regular updates for so many years. I'm still using the older version of your utility that I downloaded years back for the GTX 680 still plugging along in my office PC. It's worked flawlessly all this time but I'll give this new version a shot and let you know if I see any difference.

On a side note, it'll be interesting to see how all this works on Windows 10. Never did get around to trying out 8.1 on a multidisplay system and it's looking like that's not going to happen at this point...
Glad to hear it's still working for you. Version 3 is great for Windows 7 systems, but the nvidia hotkey system seems to have some issues on Windows 8.x, causing the older script to fail. I know you brought this feature request up with Nvidia, but considering how support has done nothing but get WORSE, I can only imagine that they decided to put their development resources elsewhere...

If you're going to update, give this latest version a try. It should be considerably faster and more robust than the v4 beta releases. It also allows you to set a custom bezel compensation value, which will be re-applied automatically when switching to Surround.


Version 5 https://db.tt/tGMTdkNz
- Bezel correction now user-defined (custom value can be entered within %appdata%\NVSToggle\NVSToggleV5.ini).
- Lots of speed and reliability improvements.
- Works (mostly) off-screen. CMD windows and Nvidia Control Panel are hidden during execution as much as possible.
- Works with no dependency on the unreliable Nvidia hotkey system.
- Full error-handling re-implemented.
- SLI has not been tested with this version as of yet. If you try it on an SLI system, let me know what happens.

Source:
Code:
#NoTrayIcon
ErrCode = 000
;==============================================================================================
; First-run configuration
;==============================================================================================
FileDelete, %appdata%\NVSToggle\NVSToggle.ini
IniRead, FirstRunVar, %appdata%\NVSToggle\NVSToggleV5.ini, NVSToggle, FirstRun
IF (FirstRunVar = "Completed")
{
	IniRead, BezelCorrectionVar, %appdata%\NVSToggle\NVSToggleV5.ini, NVSToggle, BezelCorrection
	Goto, DetectNow
}

FileCreateDir, %appdata%\NVSToggle
IniWrite, Completed, %appdata%\NVSToggle\NVSToggleV5.ini, NVSToggle, FirstRun
IniWrite, 128, %appdata%\NVSToggle\NVSToggleV5.ini, NVSToggle, BezelCorrection
BezelCorrectionVar = 128


;==============================================================================================
; Determine current display state
;==============================================================================================
DetectNow:
IF (A_ScreenWidth/A_ScreenHeight > 1.8)
	Goto, ToggleOff

IF (A_ScreenWidth/A_ScreenHeight < 1.8)
	Goto, ToggleOn

ErrCode = 001
Goto, MsgFail


;==============================================================================================
; Toggle-off routine (switch to Extended Desktop mode)
;==============================================================================================
ToggleOff:
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 8
{
	WinMove, -4096, -4096
	WinActivate
}

Loop
{
	IfWinExist, , Span &displays with Surround
		Goto, ToggleOffShortcut

	Sleep 100
	IF a_index > 20
        Break
}

ControlClick, Static3				; Configure Surround link
Sleep 2000
Runwait, taskkill /im nvcplui.exe /f, , Hide
Sleep 1000

Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 8
{
	WinMove, -4096, -4096
	WinActivate
}

Sleep 2000
ToggleOffShortcut:
ControlClick, Button4			; Span displays with surround checkbox
Sleep 500
ControlClick, Button7			; Apply button

Loop
{
	IF (A_ScreenWidth/A_ScreenHeight < 1.8)
		{
		Run %windir%\System32\DisplaySwitch.exe /extend
		Runwait, taskkill /im nvcplui.exe /f, , Hide
		Exit
		}
	
	Sleep 100
	IF a_index > 50
		{
		ErrCode = 002
        Goto, MsgFail
		}
}

ErrCode = 005
Goto, MsgLoop


;==============================================================================================
; Toggle-on routine (switch to Surround mode)
;==============================================================================================
ToggleOn:
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 8
{
	WinMove, (A_ScreenWidth/2 - 512), -4096
	WinActivate
}

Loop
{
	IfWinExist, , Span &displays with Surround
		Goto, ToggleOnShortcut
		
	IfWinExist, , Set PhysX Configuration
	{
		ErrCode = 003
		Goto, MsgCompat
	}
		
	Sleep 100
	IF a_index > 20
        Break
}

ControlClick, Static3				; Configure Surround link
Sleep 2000
Runwait, taskkill /im nvcplui.exe /f, , Hide
Sleep 1000

Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 8
{
	WinMove, -4096, -4096
	WinActivate
}

Sleep 2000
ToggleOnShortcut:
ControlClick, Button4			; Span displays with surround checkbox
Sleep 1000
ControlClick, Button7			; Apply button
WinWait, NVIDIA Set Up Surround, , 8
{
	WinMove, -4096, -4096
	WinActivate
}

Sleep 500
ControlClick, Edit1				; Bezel Correction Value
Send %BezelCorrectionVar%{Delete}{enter}

Loop
{
	IF (A_ScreenWidth/A_ScreenHeight > 1.8)
	{
		Runwait, taskkill /im nvcplui.exe /f, , Hide
		Exit
	}
		
	Sleep 100
	IF a_index > 80
	{
		ErrCode = 004
        Goto, MsgFail
	}
}

ErrCode = 006
Goto, MsgLoop


;==============================================================================================
; Message Boxes and error windows
;==============================================================================================

MsgFail:
Run, taskkill /im nvcplui.exe /f, , Hide
MsgBox, 16, Nvidia Surround Toggle, Error: `nFailed to determine current display state. (Code %ErrCode%)
	Exit
	
MsgCompat:
Run, taskkill /im nvcplui.exe /f, , Hide
MsgBox, 64, Nvidia Surround Toggle, Attention: `nYour system is not NVIDIA Surround capable. (Code %ErrCode%)
	Exit
	
MsgLoop:
Run, taskkill /im nvcplui.exe /f, , Hide
MsgBox, 16, Nvidia Surround Toggle, Error: `nExecution has escaped a loop unexpectedly. (Code %ErrCode%)
	Exit
 
Last edited:
This is a quick feature-release for people getting jumbled-screens when switching to Surround. You can now tell the script how to shuffle your screens from the config file :D

Version 6 https://db.tt/lMeiZtNO
- If displays are jumbled in Surround, script can now be configured to automatically swap screens around (custom value can be entered within %appdata%\NVSToggle\NVSToggleV6.ini).
- The above "SwapScreens" value can be set to: 0 for no-swapping, 1 for swap left/right, 2 for swap left/center, 3 for swap right/center.

Source:
Code:
#NoTrayIcon
ErrCode = 000
;==============================================================================================
; First-run configuration
;==============================================================================================
FileDelete, %appdata%\NVSToggle\NVSToggle.ini
IniRead, FirstRunVar, %appdata%\NVSToggle\NVSToggleV6.ini, NVSToggle, FirstRun
IF (FirstRunVar = "Completed")
{
	IniRead, BezelCorrectionVar, %appdata%\NVSToggle\NVSToggleV6.ini, NVSToggle, BezelCorrection
	IniRead, SwapScreenVar, %appdata%\NVSToggle\NVSToggleV6.ini, NVSToggle, SwapScreens
	Goto, DetectNow
}

FileCreateDir, %appdata%\NVSToggle
IniWrite, Completed, %appdata%\NVSToggle\NVSToggleV6.ini, NVSToggle, FirstRun
IniWrite, 128, %appdata%\NVSToggle\NVSToggleV6.ini, NVSToggle, BezelCorrection
IniWrite, 0, %appdata%\NVSToggle\NVSToggleV6.ini, NVSToggle, SwapScreens
BezelCorrectionVar = 128


;==============================================================================================
; Determine current display state
;==============================================================================================
DetectNow:
IF (A_ScreenWidth/A_ScreenHeight > 1.8)
	Goto, ToggleOff

IF (A_ScreenWidth/A_ScreenHeight < 1.8)
	Goto, ToggleOn

ErrCode = 001
Goto, MsgFail


;==============================================================================================
; Toggle-off routine (switch to Extended Desktop mode)
;==============================================================================================
ToggleOff:
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 8
{
	WinMove, -4096, -4096
	WinActivate
}

Loop
{
	IfWinExist, , Span &displays with Surround
		Goto, ToggleOffShortcut

	Sleep 100
	IF a_index > 20
        Break
}

ControlClick, Static3				; Configure Surround link
Sleep 2000
Runwait, taskkill /im nvcplui.exe /f, , Hide
Sleep 1000

Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 8
{
	WinMove, -4096, -4096
	WinActivate
}

Sleep 2000
ToggleOffShortcut:
ControlClick, Button4			; Span displays with surround checkbox
Sleep 500
ControlClick, Button7			; Apply button

Loop
{
	IF (A_ScreenWidth/A_ScreenHeight < 1.8)
		{
		Run %windir%\System32\DisplaySwitch.exe /extend
		Runwait, taskkill /im nvcplui.exe /f, , Hide
		Exit
		}
	
	Sleep 100
	IF a_index > 50
		{
		ErrCode = 002
        Goto, MsgFail
		}
}

ErrCode = 005
Goto, MsgLoop


;==============================================================================================
; Toggle-on routine (switch to Surround mode)
;==============================================================================================
ToggleOn:
Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 8
{
	WinMove, -4096, -4096
	WinActivate
}

Loop
{
	IfWinExist, , Span &displays with Surround
		Goto, ToggleOnShortcut
		
	IfWinExist, , Set PhysX Configuration
	{
		ErrCode = 003
		Goto, MsgCompat
	}
		
	Sleep 100
	IF a_index > 20
        Break
}

ControlClick, Static3				; Configure Surround link
Sleep 2000
Runwait, taskkill /im nvcplui.exe /f, , Hide
Sleep 1000

Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
WinWait, NVIDIA Control Panel, , 8
{
	WinMove, -4096, -4096
	WinActivate
}

Sleep 2000
ToggleOnShortcut:
ControlClick, Button4			; Span displays with surround checkbox
Sleep 1000
ControlClick, Button7			; Apply button
WinWait, NVIDIA Set Up Surround, , 8
	WinMove, 0, 0
	WinActivate
	Sleep 200
	IF (SwapScreenVar = 1)
	{
		MouseClickDrag, Left, 300, 200, 700, 200, 1
	}
	IF (SwapScreenVar = 2)
	{
		MouseClickDrag, Left, 300, 200, 520, 200, 1
	}
	IF (SwapScreenVar = 3)
	{
		MouseClickDrag, Left, 550, 200, 330, 200, 1
	}
	Sleep 200
	ControlClick, Edit1				; Bezel Correction Value
	Send %BezelCorrectionVar%{Delete}{enter}

Loop
{
	IF (A_ScreenWidth/A_ScreenHeight > 1.8)
	{
		Runwait, taskkill /im nvcplui.exe /f, , Hide
		Exit
	}
		
	Sleep 100
	IF a_index > 80
	{
		ErrCode = 004
        Goto, MsgFail
	}
}

ErrCode = 006
Goto, MsgLoop


;==============================================================================================
; Message Boxes and error windows
;==============================================================================================

MsgFail:
Run, taskkill /im nvcplui.exe /f, , Hide
MsgBox, 16, Nvidia Surround Toggle, Error: `nFailed to determine current display state. (Code %ErrCode%)
	Exit
	
MsgCompat:
Run, taskkill /im nvcplui.exe /f, , Hide
MsgBox, 64, Nvidia Surround Toggle, Attention: `nYour system is not NVIDIA Surround capable. (Code %ErrCode%)
	Exit
	
MsgLoop:
Run, taskkill /im nvcplui.exe /f, , Hide
MsgBox, 16, Nvidia Surround Toggle, Error: `nExecution has escaped a loop unexpectedly. (Code %ErrCode%)
	Exit

INI File (located in "%appdata%\NVSToggle\") definitions:
Code:
[NVSToggle]
FirstRun=Completed           Clearing this will result in the INI file being reset to default values on next-run.
BezelCorrection=128          Number of pixels to add to each monitor boundary for bezel correction.
SwapScreens=0                Swap screen order when switching to Surround. Possible values are 0, 1, 2, and 3.
 
Last edited:
Hi,

The script works great to enter Surround mode. However, I have problem getting back to Extended mode.

To understand my problem, I have 3 monitors and 1 TV connected to my single GPU. The 3 monitors are set to extended mode with TV disabled. NVIDIA Control Panel marked my monitors as "1 of 3", "2 of 3" and "3 of 3" where I arranged them as follow,
  1. 2 of 3
  2. 1 of 3
  3. 3 of 3

On enabling Surround in NVIDIA Control Panel, it would automatically enabled all the 4 connected displays (monitors + TV) and rearranged them as (using script or manually done),
  1. 1 of 3
  2. 2 of 3
  3. 3 of 3
  4. TV

This happen before NVIDIA Control Panel shows the dialog box to arrange the Surround mode. The script will then arrange the surround correctly (from the ini).

On exiting Surround to Extended mode, the line
Code:
Run %windir%\System32\DisplaySwitch.exe /extend

doesn't seem to register. It did open up the Project panel and it seems to select "Extended" but it remains at "PC Screen only". If I manually set to "Extended" using Win+P and select "Extended", it will enable all the displays. This is because it is reverting to the configuration when entering Surround mode where all 4 displays are automatically enabled and rearranged as stated above.

Is there a way to resolve this? From what I see, in my case, to enable Extended, I need to use NVIDIA Control Panel to enable only the 3 monitors and rearrange them again. So, it seems that the Extended mode also require some config in the INI file.

Thanks.
 
Yeah, this new redone version of the script has never been tested on quad-monitor systems using an accessory monitor. No idea how it behaves there.

On exiting Surround to Extended mode, the line
Code:
Run %windir%\System32\DisplaySwitch.exe /extend

doesn't seem to register. It did open up the Project panel and it seems to select "Extended" but it remains at "PC Screen only". If I manually set to "Extended" using Win+P and select "Extended", it will enable all the displays.
So the ONLY thing that's not working, is the script is exiting before it can click the "extended" button on the sidebar? And doing that last action manually a moment later works?

Try this version and tell me if it makes a difference. The "Run" has been changed to a "Runwait", and a small 100ms delay has been added to try and give the system a bit more time. https://db.tt/L8E2dVyF
 
Hi,

The test version managed to get the "Extend" mode back.

So, the only problem left is caused by NVIDIA Control Panel where it enabled all 4 displays and rearrange them when "Span displays with Surround" is clicked. Most likely, the only way to workaround this is to use NVIDIA Control Panel to enable only pre-selected display and rearrange them via the INI file. Is it possible?

Thanks.
 
Hi,

The test version managed to get the "Extend" mode back.
Sweet, one problem solved :)

So, the only problem left is caused by NVIDIA Control Panel where it enabled all 4 displays and rearrange them when "Span displays with Surround" is clicked. Most likely, the only way to workaround this is to use NVIDIA Control Panel to enable only pre-selected display and rearrange them via the INI file. Is it possible?
Ok, this is fixable, but I'm going to need a little help from you. Can you list the exact step-by-step process you go through to switch modes and get the monitors into the correct order?

I need to know exactly what buttons you click (or objects you drag) so I can script a fix for accessory displays. Screenshots, where appropriate, would be very helpful.
 
This is a big release with lots of fixes and features. Lots of scripting optimizations (and overall better implementation). Sorry about all the new versions lately, but the rewrite and the new switching method require more fine-tuning than the old hotkey method.

Version 7 https://db.tt/wZU1Ge4W
- Improved config file handling and management. New GUI for first-run / program upgrades.
- Support for correctly detecting Surround/Extended on 21:9 monitors.
- Support for inverted-landscale surround (Orientation must be set to 2 in NVSToggle.ini).
- Preliminary/Experemental support for portrait surround (Orientation must be set to 1 in NVSToggle.ini).
- Preliminary/Experemental support for inverted-portrait surround (Orientation must be set to 3 in NVSToggle.ini).
- Upgrading to future versions of NVSToggle will not reset the config file unless it's actually neccisary.
- Prevented script from hanging if the user starts multiple instances at once.
- Improved error handling and prevented invalid config values from causing errors.
- Improved reliability of switching to Extended mode.
- Code cleanup. Easier to read and easier to maintain.
- Some small speed improvements.

Source:
Code:
;==============================================================================================
; 0 Set Defaults
;==============================================================================================
#NoTrayIcon
#SingleInstance

AppVersionStatic = 7
CfgVersionStatic = 7
BezelCorrectionStatic = 128
SwapScreensStatic = 0
OrientationStatic = 0


;==============================================================================================
; 1 Write new configuration file
;==============================================================================================
IniRead, CfgVersionVar, %appdata%\NVSToggle\NVSToggle.ini, NVSToggle, CfgVersion
	IF CfgVersionVar != %CfgVersionStatic%
	{
		FileRemoveDir, %appdata%\NVSToggle\, 1
		FileCreateDir, %appdata%\NVSToggle
		
		IniWrite, %AppVersionStatic%, %appdata%\NVSToggle\NVSToggle.ini, NVSToggle, AppVersion
		IniWrite, %CfgVersionStatic%, %appdata%\NVSToggle\NVSToggle.ini, NVSToggle, CfgVersion
		IniWrite, %BezelCorrectionStatic%, %appdata%\NVSToggle\NVSToggle.ini, UserOptions, BezelCorrection
		IniWrite, %SwapScreensStatic%, %appdata%\NVSToggle\NVSToggle.ini, UserOptions, SwapScreens
		IniWrite, %OrientationStatic%, %appdata%\NVSToggle\NVSToggle.ini, UserOptions, Orientation
		
		MsgNewCFG()
	}


;==============================================================================================
; 2 Read configuration file
;==============================================================================================
IniRead, AppVersionVar, %appdata%\NVSToggle\NVSToggle.ini, NVSToggle, AppVersion
	IF (AppVersionVar < AppVersionStatic)
		IniWrite, %AppVersionStatic%, %appdata%\NVSToggle\NVSToggle.ini, NVSToggle, AppVersion

IniRead, BezelCorrectionVar, %appdata%\NVSToggle\NVSToggle.ini, UserOptions, BezelCorrection
	IF (BezelCorrectionVar < 0) or (BezelCorrectionVar > 1024){
		IniWrite, %BezelCorrectionStatic%, %appdata%\NVSToggle\NVSToggle.ini, UserOptions, BezelCorrection
		BezelCorrectionVar = %BezelCorrectionStatic%
	}
IniRead, SwapScreenVar, %appdata%\NVSToggle\NVSToggle.ini, UserOptions, SwapScreens
	IF (SwapScreenVar < 0) or (SwapScreenVar > 3){
		IniWrite, %SwapScreensStatic%, %appdata%\NVSToggle\NVSToggle.ini, UserOptions, SwapScreens
		SwapScreenVar = %SwapScreensStatic%
	}
IniRead, OrientationVar, %appdata%\NVSToggle\NVSToggle.ini, UserOptions, Orientation
	IF (OrientationVar < 0) or (OrientationVar > 3){
		IniWrite, %OrientationStatic%, %appdata%\NVSToggle\NVSToggle.ini, UserOptions, Orientation
		OrientationVar = %OrientationStatic%
	}


;==============================================================================================
; 3 Determine current display state
;==============================================================================================
IF (OrientationVar = 1) or (OrientationVar = 3)
	AspectRatioVar = 0.8
Else
	AspectRatioVar = 3.6

IF (AspectRatioVar < A_ScreenWidth/A_ScreenHeight)
	ToggleVar = ToggleOff

IF (AspectRatioVar >= A_ScreenWidth/A_ScreenHeight)
	ToggleVar = ToggleOn


;==============================================================================================
; 4 Open NVIDIA Control Panel off screen
;==============================================================================================
Loop{
	Run "C:\Program Files\NVIDIA Corporation\Control Panel Client\nvcplui.exe"
	WinWait, NVIDIA Control Panel, , 8
		WinMove, -4096, -4096
		WinActivate

	Loop{
		IfWinExist, , Span &displays with Surround
		{
			Sleep 1000
			ControlClick, Button4			; Span displays with surround checkbox
			Sleep 500
			ControlClick, Button7			; Apply button
			Goto, %ToggleVar%
		}

		IfWinExist, , Set PhysX Configuration	; The presence of this menu item indicates Surround is not supported
			MsgCompat()

		Sleep 100
		IF a_index > 20					; Assume control panel has loaded and the page needs to be switched
		{
			ControlClick, Static3				; Configure Surround link
			Sleep 1000
			Runwait, taskkill /im nvcplui.exe /f, , Hide
			Sleep 500
			Break
		}
	}
	
	IF a_index > 3
		MsgTime("402")
}

MsgError("403")

;==============================================================================================
; 5 Toggle-off (switch to Extended Desktop mode)
;==============================================================================================
ToggleOff:
	Loop{
		IF (AspectRatioVar > A_ScreenWidth/A_ScreenHeight){
			Sleep 100
			Runwait %windir%\System32\DisplaySwitch.exe /extend
			Runwait, taskkill /im nvcplui.exe /f, , Hide
			Exit
		}
		
		Sleep 100
		IF a_index > 50
			MsgTime("501")
	}

MsgError("502")

;==============================================================================================
; 6 Toggle-on (switch to Surround mode)
;==============================================================================================
ToggleOn:
	WinWait, NVIDIA Set Up Surround, , 8
		WinMove, 0, 0
		WinActivate
	
		IF (SwapScreenVar != 0){
			Sleep 200
			IF (SwapScreenVar = 1)
				MouseClickDrag, Left, 300, 200, 700, 200, 1
			IF (SwapScreenVar = 2)
				MouseClickDrag, Left, 300, 200, 520, 200, 1		
			IF (SwapScreenVar = 3)
				MouseClickDrag, Left, 550, 200, 330, 200, 1
			}
			
		IF (OrientationVar != 0){
			Sleep 200
			IF (OrientationVar = 1){
				MouseClick, Right, 330, 145, 1, 1
				MouseClick, Left, 343, 180, 1, 1
				}
			IF (OrientationVar = 2){
				MouseClick, Right, 330, 145, 1, 1
				MouseClick, Left, 343, 203, 1, 1
				}
			IF (OrientationVar = 3){
				MouseClick, Right, 330, 145, 1, 1
				MouseClick, Left, 343, 224, 1, 1
				}
		}
		
		Sleep 200
		ControlClick, Edit1				; Bezel Correction Value
		Send %BezelCorrectionVar%{Delete}{enter}

	Loop{
		IF (AspectRatioVar < A_ScreenWidth/A_ScreenHeight)
		{
			Runwait, taskkill /im nvcplui.exe /f, , Hide
			Exit
		}
		
		Sleep 100
		IF a_index > 80
			MsgTime("602")
	}

MsgError("603")

;==============================================================================================
; 7 Message Boxes and error windows
;==============================================================================================
MsgNewCFG(){
	MsgBox, 323, Nvidia Surround Toggle, A new config file has been created in the following location:`n"%appdata%\NVSToggle\NVSToggle.ini"`n`nWould you like to edit these settings now?
		IfMsgBox Cancel
			Exit
		IfMsgBox Yes
			RunWait %windir%\System32\Notepad.exe %appdata%\NVSToggle\NVSToggle.ini
	Return
}
	
MsgCompat(){
	Run, taskkill /im nvcplui.exe /f, , Hide
	MsgBox, 64, Nvidia Surround Toggle, Attention: `nYour system is not NVIDIA Surround capable.
	Exit
}

MsgTime(ErrCode){
	Run, taskkill /im nvcplui.exe /f, , Hide
	MsgBox, 16, Nvidia Surround Toggle, Error: `nTimed out while waiting for the NVIDIA Control Panel. (Code %ErrCode%)
	Exit
}

MsgError(ErrCode){
	Run, taskkill /im nvcplui.exe /f, , Hide
	MsgBox, 16, Nvidia Surround Toggle, Error: `nExecution halted unexpectedly. (Code %ErrCode%)
	Exit
}

INI File (%appdata%\NVSToggle\NVSToggle.ini) definitions:
Code:
BezelCorrection=128
     The bezel correction value (in pixels).
     Valid settings for this option are 0 through 1024.

SwapScreens=0
     Re-order screens in Surround mode.
     0 = Nothing swapped
     1 = Swap left and right
     2 = Swap left and center
     3 = Swap right and center

Orientation=0
     Screen orientation in Surround mode.
     0 = Landscape
     1 = Portrait
     2 = Inverted landscape
     3 = Inverted portrait
 
Last edited:
Sweet, one problem solved :)

Ok, this is fixable, but I'm going to need a little help from you. Can you list the exact step-by-step process you go through to switch modes and get the monitors into the correct order?

I need to know exactly what buttons you click (or objects you drag) so I can script a fix for accessory displays. Screenshots, where appropriate, would be very helpful.

Hi, thank you. I'll be taking your offer on this.

Below is the screenshot of "Set up multiple display" in NVIDIA Control Panel after exiting the Surround mode.
extend.jpg


Basically, I need to
  1. uncheck "Samsung [2]"
  2. swap [1] with [4]

The result is as follow,
extend_Target.jpg


Again, thank you.
 
@programatix: Give this test version a try: https://db.tt/AkpjeXzF

You'll notice a new option in the config file labeled "AccessoryDisplay"
It defaults to 0, change it to 1 to enable the new hack. Let me know how it works. :)

If it works as expected, I'll make this a fully-developed feature for Version 8.
 
@Unknown-One, I've tested the "AccessoryDisplay". After the "Applying changes..." sequence appear,

On first try, the desktop returns back to "Extend" mode. Then the NVIDIA Control Panel briefly opened up in "Set Up Multiple Display. Display [3] and [2] were unchecked, but nothing happens. I opened NVIDIA Control Panel and all monitors are checked, meaning the change was not applied.

On second try, the desktop returns back to "Extend" mode. Then the NVIDIA Control Panel briefly opened up in "Set Up Multiple Display. Display [3] were unchecked, but nothing happens. I opened NVIDIA Control Panel and all monitors are checked, meaning the change was not applied.

On third try, the desktop stuck at 1 display. Then the NVIDIA Control Panel briefly opened up in "Set Up Multiple Display. Only Display [1] is checked.

On all tries, display [1] and [4] are not swapped.

For each try, before going back to "Surround" mode, I rearranged the display in correct order and checked only 3 displays.

On another matter, would it be better if the INI file is saved in %programdata% instead? This is because the monitor configuration is based on the machine we are using, not the profile where the script is run.

Thanks.
 
Ok, one more test version. Give this a go and see if it works as expected: https://db.tt/AkpjeXzF

And great point about the config file, this test version moves it into %programdata% instead of %appdata%. You'll need to go ahead and set your options again, as well.

Edit: Mind if I ask why you want the accessory display enabled in Surround mode, but disabled in Extended Desktop mode? Seems like something you'd always want to keep enabled.
 
Last edited:
Hello, I registered specifically to thank you for programming this. I literally switch, everyday, back and forth manually from "span" to "extended". I do hope you keep this product alive, as it doesn't seem to work on my Win 8.1 setup.

FWIW, when I open Nvidia Surround Toggle v8 Test.exe, I can see that the Nvidia control panel (nvcplui.exe) opens off-screen and ultimately reports "timed out while waiting for the nvidia control panel. (Code 602)". If I terminate the v8test.exe process before it times out, I can alt-space to move the off-screen window for nvcplui.exe back on-screen and it seems to work fine. Perhaps it's due to Windows 8.1. I did try to load the most recent nvidia driver 344.75, but it also results in a code-602 error.

Anyway, just want to thank you for writing this. It's too bad nvidia doesn't focus on this issue.
 
Ok, one more test version. Give this a go and see if it works as expected: https://db.tt/AkpjeXzF

And great point about the config file, this test version moves it into %programdata% instead of %appdata%. You'll need to go ahead and set your options again, as well.

Edit: Mind if I ask why you want the accessory display enabled in Surround mode, but disabled in Extended Desktop mode? Seems like something you'd always want to keep enabled.

I haven't had a chance to test it out yet. However to answer your question on the accessory display, as I have described it before, when enabling Surround mode, NVIDIA Control Panel briefly enabled all displays (and rearrange them, while still in Extend mode) before switching to Surround mode and display the monitor arrangement dialog (where only the 3 original displays are selected, accessory display is disabled). Due to this, on returning to Extend mode, all displays are enabled too as Windows remembers the last display configuration.

So, I never want the accessory display to be enabled during the Surround/Extend mode switching.
 
I never want the accessory display to be enabled during the Surround/Extend mode switching.
Wait... so you just want the accessory display disabled during switching? So you want it turned back-on automatically at some point too, or no?

Hello, I registered specifically to thank you for programming this. I literally switch, everyday, back and forth manually from "span" to "extended". I do hope you keep this product alive, as it doesn't seem to work on my Win 8.1 setup.
Heh, I actually rewrote the whole thing specifically to support Windows 8.1. I'm using it on Windows 8.1 now, and it switches perfectly every time.

Error Code 602 could mean a couple of different things. Is the "NVIDIA Set Up Surround" window appearing in the top-left corner of the screen, or does it just launch the Nvidia control panel off-screen and do nothing else until the 602 error pops up?
 
Wait... so you just want the accessory display disabled during switching? So you want it turned back-on automatically at some point too, or no?

The 2nd test script managed to get the configuration applied. However, it disabled the wrong display. Instead of "Samsung [2]" being disabled, it disabled "DELL U2414H (3 of 3) [3]". Displays [1] and [4] are correctly swapped.

I actually want the accessory display to be as it is when switching back to "Extend" mode. However, it would be impossible for now since NVIDIA Control Panel simply enabled all displays before Surround mode is enabled, thus the original setting would be lost. Well unless there is a way for the script to save the setting before enabling the Surround mode. However, most of the time I have the accessory display disabled anyway.

For the accessory display, current Windows "Second screen only" works fine, script is not needed for it.
 
Heh, I actually rewrote the whole thing specifically to support Windows 8.1. I'm using it on Windows 8.1 now, and it switches perfectly every time.

Error Code 602 could mean a couple of different things. Is the "NVIDIA Set Up Surround" window appearing in the top-left corner of the screen, or does it just launch the Nvidia control panel off-screen and do nothing else until the 602 error pops up?


Thanks for the followup. Here's what happens.

Screenshot 1: snapshot time: 0:00s
http://imageshack.com/a/img540/7374/WwtXZH.jpg
Before clicking anything.

Screenshot 2: snapshot time: 0:01s
I then double-click the EXE. It was hard to get this screenshot because the nvcplui only displays for a fraction of a second
http://imageshack.com/a/img538/6459/78eabV.jpg

Screenshot 3: snapshot time: 0:02s
After the nvcplui displays for a fraction of a second, this is what the screen looks like for 9 seconds:
http://imageshack.com/a/img673/5659/JWbESv.jpg


Screenshot 4: snapshot time: 0:11s
after the 9 second delay, the nvcplui shows up, along with the sound that some error occurred. The screen looks like this for about 8 seconds
http://imageshack.com/a/img673/2852/QIBvd8.jpg

screenshot 5: snapshot time: 0:19s
here's where things end up after the previous 19 seconds:
http://imageshack.com/a/img661/5205/2cRrRb.jpg

What's weird, is that if I end the surround-toggle.exe process between screenshot 3 and 4 (e.g. at 0:05s), then the nvcplui process stays and it's definiately off-screen. I have to alt-space then move-window to get it back in-frame. Maybe my install is messed up?
 
The 2nd test script managed to get the configuration applied. However, it disabled the wrong display. Instead of "Samsung [2]" being disabled, it disabled "DELL U2414H (3 of 3) [3]". Displays [1] and [4] are correctly swapped.
That's strange... it's set to disable the 4th monitor in the list (as that was the location of the Samsung display in your screenshot)

Is the Samsung display not the 4th monitor in the list anymore?

Screenshot 2: snapshot time: 0:01s
I then double-click the EXE. It was hard to get this screenshot because the nvcplui only displays for a fraction of a second
http://imageshack.com/a/img538/6459/78eabV.jpg
Ok, I see what's different, you have an SLI setup. I did note that this new version hadn't been tested on SLI, so this is actually really fantastic feedback! :)

The reason the current script isn't working is because the window controls are totally different from what it's expecting. Single-card + Surround only has a single checkbox, rather than four radio buttons.

What I need you to do is install AutoHotkey on your system. It includes a utility called "AutoIt3 Window Spy" that you can use to find the class-names of those radio buttons.
Open Window Spy, make sure the Nvidia Control Panel is the currently active window, and hover over the "Span displays with Surround" and "Activate All Displays" radio buttons.
WindowSpy should give you a readout with something like "ClassNN: Button X" for those two radio buttons.

If you can tell me what those two ClassNN names are, I think I can get this fixed for SLI systems. A screenshot of the Window Spy window showing all "visible window text" for the Nvidia Control Panel would be very useful, too.
 
Last edited:
That's strange... it's set to disable the 4th monitor in the list (as that was the location of the Samsung display in your screenshot)

Is the Samsung display not the 4th monitor in the list anymore?

The Samsung display is still the 4th display in the list.

Checkbox position is 339, 320 (In active window)

With Samsung enabled,
Code:
>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
Select a Task...
Select a Task...
Left View
Adjust image settings with preview
Manage 3D settings
Configure Surround, PhysX
Change resolution
Adjust desktop color settings
Rotate display
View HDCP status
Set up digital audio
Adjust desktop size and position
Set up multiple displays
Set up stereoscopic 3D
View rating for games
Adjust video color settings
Adjust video image settings
System Information
<a id="LINK_TARGET">System Information</a>
{73BCA54E-6AEB-4597-8F27-E1284FF12722}:{894BF76C-115F-44B7-9B32-ABFA7E6A804A}
1. Select the displays you want to use.
2. D&rag the icons to match your display configuration.
?1. Display DELL U2414H (1 of 3) - Primary
?4. Display DELL U2414H (2 of 3)
?3. Display DELL U2414H (3 of 3)
?2. Display SAMSUNG
Primary display

With Samsung disabled,
Code:
>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
Select a Task...
Select a Task...
Left View
Adjust image settings with preview
Manage 3D settings
Configure Surround, PhysX
Change resolution
Adjust desktop color settings
Rotate display
View HDCP status
Set up digital audio
Adjust desktop size and position
Set up multiple displays
Set up stereoscopic 3D
View rating for games
Adjust video color settings
Adjust video image settings
System Information
<a id="LINK_TARGET">System Information</a>
{73BCA54E-6AEB-4597-8F27-E1284FF12722}:{894BF76C-115F-44B7-9B32-ABFA7E6A804A}
1. Select the displays you want to use.
2. D&rag the icons to match your display configuration.
?1. Display DELL U2414H (1 of 3) - Primary
?4. Display DELL U2414H (2 of 3)
?3. Display DELL U2414H (3 of 3)
Primary display
 
Back
Top