<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>DisplayFusion RSS: Windows 10 + Nvidia Surround [script fix]</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=f05bf8b8-cfd5-4855-9338-de937c98a3db" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=f05bf8b8-cfd5-4855-9338-de937c98a3db</link>
<description>DisplayFusion RSS: Windows 10 + Nvidia Surround [script fix]</description>
<lastBuildDate>Wed, 08 Apr 2026 07:24:06 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=f05bf8b8-cfd5-4855-9338-de937c98a3db</generator>
<item>
<title>RE: Windows 10 + Nvidia Surround [script fix]</title>
<link>https://www.displayfusion.com/Discussions/View/windows-10-nvidia-surround-script-fix/?ID=f05bf8b8-cfd5-4855-9338-de937c98a3db#4</link>
<pubDate>Wed, 28 Feb 2018 19:27:53 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/windows-10-nvidia-surround-script-fix/?ID=f05bf8b8-cfd5-4855-9338-de937c98a3db#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[Sorry for the late reply!
It seems like scripting is pretty unreliable with nVidia surround. We'll look for a better way to do this in the future.
Thanks!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Sorry for the late reply!<br/>
<br/>
It seems like scripting is pretty unreliable with nVidia surround. We'll look for a better way to do this in the future.<br/>
<br/>
Thanks!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Windows 10 + Nvidia Surround [script fix]</title>
<link>https://www.displayfusion.com/Discussions/View/windows-10-nvidia-surround-script-fix/?ID=f05bf8b8-cfd5-4855-9338-de937c98a3db#3</link>
<pubDate>Fri, 10 Feb 2017 10:25:28 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/windows-10-nvidia-surround-script-fix/?ID=f05bf8b8-cfd5-4855-9338-de937c98a3db#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[If you enable Surround from the NVidia Panel, and run the script, you return to the normal profile.
But then the script no longer returns to the Surround profile
Code
Copy
Select All
using System;
using System.Drawing;
using System.Runtime.InteropServices;
// The 'windowHandle' parameter ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
If you enable Surround from the NVidia Panel, and run the script, you return to the normal profile.<br/>
<br/>
But then the script no longer returns to the Surround profile<br/>
<br/>
<div id="" class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019d6bfa1c2171a8b5e34d6601b51a42" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019d6bfa1c2171a8b5e34d6601b51a42Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019d6bfa1c2171a8b5e34d6601b51a42Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;
using System.Runtime.InteropServices;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump List owner when run from a Taskbar Jump List
//   - Currently focused window if none of these match
public static class DisplayFusionFunction
{
    [DllImport("User32.dll", CharSet = CharSet.Unicode, PreserveSig = true)]
    private static extern IntPtr FindWindow([MarshalAs(UnmanagedType.LPWStr)] string lpClassName, [MarshalAs(UnmanagedType.LPWStr)] string lpWindowName);

public static void Run(IntPtr windowHandle)
{
        //get the system tray window
        IntPtr trayWnd = FindWindow("Shell_TrayWnd", null);

        //focus the window
        BFS.Window.Focus(trayWnd);
        
        //mute the computer
        BFS.Input.SendKeys("{VK_173}");
        
        //send the nvidia surround hotkey
        BFS.Input.SendKeys("%(^(S))");
        
        //wait for surround to be applied
        BFS.General.ThreadWait(3500);
        
        //unmute the computer
        BFS.Input.SendKeys("{VK_173}");
        
        //load a monitor profile
        //NOTE: Change the profile names with profiles for your computer
        if(IsSurroundEnabled())
            BFS.DisplayFusion.LoadMonitorProfileHideErrors("Surround");
        else
            BFS.DisplayFusion.LoadMonitorProfileHideErrors("144hz y 60hz");
}

    private static bool IsSurroundEnabled()
    {
        return (BFS.Monitor.GetPrimaryMonitorBounds().Width / (double)BFS.Monitor.GetPrimaryMonitorBounds().Height &gt; 1.8d);
    }
}</pre><textarea id="code019d6bfa1c2171a8b5e34d6601b51a42" name="code019d6bfa1c2171a8b5e34d6601b51a42" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Windows 10 + Nvidia Surround [script fix]</title>
<link>https://www.displayfusion.com/Discussions/View/windows-10-nvidia-surround-script-fix/?ID=f05bf8b8-cfd5-4855-9338-de937c98a3db#2</link>
<pubDate>Thu, 09 Feb 2017 17:08:09 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/windows-10-nvidia-surround-script-fix/?ID=f05bf8b8-cfd5-4855-9338-de937c98a3db#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[Thanks for the AHK script! I put together a DisplayFusion scripted function that should do the same thing as the script above. Here's how to get it working:
Download the file attached to this post
Set up NVidia Surround on your computer, so the HotKey (ctrl+alt+s) will toggle properly
Open the...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks for the AHK script! I put together a DisplayFusion scripted function that should do the same thing as the script above. Here's how to get it working:<br/>
<br/>
<ul class="ListBullet">
<li>Download the file attached to this post</li>
<li>Set up NVidia Surround on your computer, so the HotKey (ctrl+alt+s) will toggle properly</li>
<li>Open the DisplayFusion Settings window to the 'Functions' tab</li>
<li>Click the 'Add Scripted' button</li>
<li>Copy the code from the file you download in the first step to the window that pops up</li>
<li>Change the profile names on lines 39 & 41 to something that exists on your computer</li>
<li>Give the script a key combination if you want, then click OK to close and save the script, then OK again in the Settings window to save and apply your changes</li></ul>
<br/>
I hope this works for everyone!
</div>
]]></content:encoded>
</item>
<item>
<title>Windows 10 + Nvidia Surround [script fix]</title>
<link>https://www.displayfusion.com/Discussions/View/windows-10-nvidia-surround-script-fix/?ID=f05bf8b8-cfd5-4855-9338-de937c98a3db</link>
<pubDate>Sat, 04 Feb 2017 01:25:28 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/windows-10-nvidia-surround-script-fix/?ID=f05bf8b8-cfd5-4855-9338-de937c98a3db</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hi, I found this toggle. But I would like to be able to apply it to the scripts section, in #C or Visual Basic. So that the rest of people can enjoy the advantages of being able to change from normal mode to surround easily.
; Toggle-off routine (switch to Extended Desktop mode)
Run C:\Program ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hi, I found this toggle. But I would like to be able to apply it to the scripts section, in #C or Visual Basic. So that the rest of people can enjoy the advantages of being able to change from normal mode to surround easily. <br/>
<br/>
; Toggle-off routine (switch to Extended Desktop mode)<br/>
Run C:\Program Files (x86)\DisplayFusion\displayfusioncommand.exe -monitorloadprofile "<b>Here put the profile you have saved</b>"<br/>
<br/>
<div id="" class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019d6bfa1c3274328a774cd713ad6e1a" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019d6bfa1c3274328a774cd713ad6e1aJs'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019d6bfa1c3274328a774cd713ad6e1aJs" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">;==============================================================================================
; First-run configuration
;==============================================================================================
IniRead, FirstRunVar, %appdata%\NVSToggle\NVSToggle.ini, NVSToggle, FirstRun
IF (FirstRunVar = "Completed")
{
Goto, DetectNow
}

MsgBox, 65, Nvidia Surround Toggle, To allow this application to configure itself for first-time use, please enable Nvidia Surround using the Nvidia Control Panel now. `n`nClick "OK" when ready, or "Cancel" to quit.
IfMsgBox Ok
Goto, DoubleCheck
else
Exit

DoubleCheck:
IF (A_ScreenWidth/A_ScreenHeight &gt; 1.8)
{
Goto, FirstRun
}

MsgBox, 21, Nvidia Surround Toggle, Error: Nvidia Surround is not enabled.
IfMsgBox Retry
Goto, DoubleCheck
else
Exit

FirstRun:
FileCreateDir, %appdata%\NVSToggle
IniWrite, Completed, %appdata%\NVSToggle\NVSToggle.ini, NVSToggle, FirstRun

;==============================================================================================
; Determine current display state
;==============================================================================================
DetectNow:
IF (A_ScreenWidth/A_ScreenHeight &gt; 1.8)
{
Goto, ToggleOff
}

IF (A_ScreenWidth/A_ScreenHeight &lt; 1.8)
{
Goto, ToggleOn
}

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

Exit

;==============================================================================================
; Toggle-off routine (switch to Extended Desktop mode)
;==============================================================================================
ToggleOff:
Send {Volume_Mute}
WinActivate ahk_class Shell_TrayWnd
Send {LCtrl down}
Send {LAlt down}
Send {s down}
Sleep 100
Send {LCtrl up}{LAlt up}{s up}
Sleep 3500
Send {Volume_Mute}
Run C:\Program Files (x86)\DisplayFusion\displayfusioncommand.exe -monitorloadprofile "144hz y 60hz"
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 3500
IF (A_ScreenWidth/A_ScreenHeight &lt; 1.8)
{
Goto, SurroundFail
}
IF (A_ScreenWidth/A_ScreenHeight = 1.8)
{
Goto, SurroundFail
}
Exit

SurroundFail:
MsgBox, 21, Nvidia Surround Toggle, Error: Nvidia Surround could not be enabled!
FileDelete, %appdata%\NVSToggle\NVSToggle.ini
Exit</pre><textarea id="code019d6bfa1c3274328a774cd713ad6e1a" name="code019d6bfa1c3274328a774cd713ad6e1a" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>