Login / Register
▼
Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
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
VoiceBot
WallpaperFusion
Home
▼
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
▼
Features
Features
Incredible Desktop Wallpaper
Monitor Configuration
Monitor Splitting
Powerful Functions
Triggers
Multi-Monitor Taskbars
Useful Windows 10 Tweaks
Useful Windows 8 Tweaks
Windows Lock Screen
Multi-Monitor Screen Savers
Monitor Fading
Window Snapping
Window Management
Mouse Management
Alt+Tab Handler
Window Position Profiles
Desktop Icon Profiles
Remote Control
Available in dozens of Languages
Easy Administration
Free vs Pro
Purchase
Screenshots
Languages
▼
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Scripted Functions (Macros)
Display
Fusion
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Toggle NVIDIA Surround and Load the Appropriate Monitor Profile
Return to DisplayFusion Scripted Functions (Macros)
Description
This script will toggle NVIDIA Surround mode, and then load the appropriate Monitor Profile, because when toggling Surround off, usually only one monitor ends up enabled. Before running this script, you need to save DisplayFusion Monitor Profiles for when Surround is enabled, and also when it's disabled, then update the names in the script to match the names of your Monitor Profiles. You also need to make sure to enable the Ctrl + Alt + S hotkey for toggling Surround in the NVIDIA Control Panel.
Language
C# (.Net)
Minimum Version
8.1.2+
Created By
Thomas Malloch (BFS)
Contributors
-
Date Created
Jun 13, 2017
Date Last Modified
Jun 13, 2017
Scripted Function (Macro) Code
Copy
Select All
Toggle Line Wrapping
using System; using System.Drawing; using System.Runtime.InteropServices; 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) { //set these to the names of your extended and surround Monitor Profiles string surroundProfile = "NVidia Surround Profile"; string extendedProfile = "Extended Profile"; //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(10000); //unmute the computer BFS.Input.SendKeys("{VK_173}"); //load a monitor profile if(IsSurroundEnabled()) BFS.DisplayFusion.LoadMonitorProfileHideErrors(surroundProfile); else BFS.DisplayFusion.LoadMonitorProfileHideErrors(extendedProfile); } private static bool IsSurroundEnabled() { return (BFS.Monitor.GetPrimaryMonitorBounds().Width / (double)BFS.Monitor.GetPrimaryMonitorBounds().Height > 1.8d); } }
Copyright © 2007-2021 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get DisplayFusion Merch