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
Load Monitor Profile, Adjust Volume, Start Game, Switch Back on Exit
Return to DisplayFusion Scripted Functions (Macros)
Description
Loads a Monitor Profile, adjusts the volume, starts a game, and changes the Monitor Profile and volume level back on exit. Adjust the code with your preferred monitor profiles and volume levels.
Language
C#.net
Minimum Version
7.3.4+
Created By
Frode4
Contributors
-
Date Created
May 5, 2016
Date Last Modified
May 5, 2016
Scripted Function (Macro) Code
Copy
Select All
using System; using System.Drawing; // 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 { public static void Run(IntPtr windowHandle) { // set cs:go path string csgoPath = "E:\\Games\\Steam\\steamapps\\common\\Counter-Strike Global Offensive\\csgo.exe"; //set up nircmd path (http://www.nirsoft.net/utils/nircmd.html) string nircmdPath = "E:\\Applications\\nircmd\\nircmd.exe"; const int waitForever = 0; // load a monitor profile with the desired resolution settings BFS.DisplayFusion.LoadMonitorProfile("Gaming"); // set system volume to 70% (65535 = 100% volume for Windows 10) BFS.Application.Start(nircmdPath, "setsysvolume 45880"); // start cs:go via steam (required to get verified by VAC) BFS.Application.Start("steam://rungameid/730", ""); // wait 5 seconds, steam usually takes some seconds before cs:go is loaded bool ok = BFS.General.ThreadWait(5000); // return to work-mode when cs:go exits uint csgoAppId = BFS.Application.GetAppIDByFile(csgoPath); BFS.Application.WaitForExitByAppID(csgoAppId, waitForever); // set system volume to 30% (65535 = 100% volume for Windows 10) BFS.Application.Start(nircmdPath, "setsysvolume 19880"); // load work monitor profile BFS.DisplayFusion.LoadMonitorProfile("Work"); } }