Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
CloudShow Manager
DisplayFusion
FileSeek
HashTools
LogFusion
Notepad Replacer
Online Base64 Decoder
Online Base64 Encoder
Online JSON Formatter
ShellSend
TrayStatus
VoiceBot
WallpaperFusion
Window Inspector
More Apps...
DisplayFusion
CheckCentral
CloudShow
ClipboardFusion
FileSeek
TrayStatus
VoiceBot
WallpaperFusion
Display
Fusion
by Binary Fortress Software
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
Features
Free vs Pro
More
Screenshots
Scripted Functions (Macros)
Languages
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Purchase
Login / Register
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Nvidia Surround Helper
Return to DisplayFusion Scripted Functions (Macros)
Description
This function is meant to reduce the pain of switching between nVidia Surround and Extended Desktops.
Language
C#.net
Minimum Version
7.1.0+
Created By
solaris765
Contributors
-
Date Created
Mar 20, 2015
Date Last Modified
Apr 6, 2015
Scripted Function (Macro) Code
Copy
Select All
using System; using System.Drawing; using System.Collections.Generic; // The 'windowHandle' parameter will contain the window handle for the: // - Active window when run by hotkey // - Window Location target when run by a Window Location 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 { public static void Run(IntPtr windowHandle) { //Nvidia control panel executable location. string nvctl = "A:\\Program Files\\NVIDIA Corporation\\Control Panel Client\\nvcplui.exe"; //Can add to or remove from list to fit needs. string[] predictedPrograms = { "A:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "A:\\Program Files\\Logitech Gaming Software\\LCore.exe", "A:\\Program Files (x86)\\Skype\\Phone\\Skype.exe" }; //Saves all running Programs string[] arr = BFS.Application.GetAllRunningApplicationFiles(); //Close predicted Programs. for (int i = 0; i < predictedPrograms.Length; ++i) BFS.Application.Kill(BFS.Application.GetAppIDByFile(predictedPrograms[i])); BFS.Application.Start(nvctl, ""); System.Threading.Thread.Sleep(800); //Wait BFS.Window.SetLocation(BFS.Window.GetWindowByText("NVIDIA Control Panel"),0,0); if (BFS.ScriptSettings.ReadValue("Surround") == "true") DisableSurround(); else EnableSurround(); //Wait for nvctl to get closed by user. BFS.Application.WaitForExitByFile(nvctl,0); //Re-Open predicted Programs. for (int i = 0; i < arr.Length; ++i) if (!BFS.Application.IsAppRunningByFile(arr[i])) BFS.Application.Start(arr[i], ""); // default Resolution if (BFS.ScriptSettings.ReadValue("Surround") == "false") { BFS.DisplayFusion.LoadMonitorProfile("Default"); System.Threading.Thread.Sleep(3000); //Wait BFS.DisplayFusion.LoadWallpaperProfile("Default"); } // nVidia Surround / AMD Eyefinity else if (BFS.ScriptSettings.ReadValue("Surround") == "true") { BFS.DisplayFusion.LoadMonitorProfile("Nvidia Surround"); System.Threading.Thread.Sleep(3000); //Wait BFS.DisplayFusion.LoadWallpaperProfile("Nvidia Surround"); } } //Manipulates Nvidia control panel to Enable Surround. public static void EnableSurround() { BFS.DisplayFusion.SaveDesktopIconsProfile("Default"); BFS.ScriptSettings.WriteValue("Surround", "true"); BFS.Input.SetMousePosition(337, 279); BFS.Input.LeftClickMouse(); System.Threading.Thread.Sleep(500); //Wait BFS.Input.SetMousePosition(831, 685); BFS.Input.LeftClickMouse(); System.Threading.Thread.Sleep(500); //Wait } //Manipulates Nvidia control panel to Disable Surround. public static void DisableSurround() { BFS.DisplayFusion.SaveDesktopIconsProfile("Surround"); BFS.ScriptSettings.WriteValue("Surround", "false"); BFS.Input.SetMousePosition(337, 258); BFS.Input.LeftClickMouse(); System.Threading.Thread.Sleep(500); //Wait BFS.Input.SetMousePosition(831, 685); BFS.Input.LeftClickMouse(); System.Threading.Thread.Sleep(500); //Wait } }