Login / Register
▼
Binary Fortress
Binary Fortress Software
ASP.NET ViewState Helper
CheckCentral
ClipboardFusion
CloudShow
DisplayFusion
FileSeek
HashTools
iTunesFusion
JigsawMania
LogFusion
Notepad Replacer
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
Precise Monitor Controls
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)
DisplayFusion
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Toggle TitleBar Buttons Based on Number of Monitors
Return to DisplayFusion Scripted Functions (Macros)
Description
This script will check if there are 1 or 2 monitors connected. If there's only 1, it will disable the TitleBar Buttons. If there are 2, it will enable them.
Language
C#
Minimum Version
9.5+
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Oct 16, 2019
Date Last Modified
Oct 16, 2019
Scripted Function (Macro) Code
Copy
Select All
Toggle Line Wrapping
using System; using System.Drawing; using Microsoft.Win32; public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { // Gets the number of monitors attached to the system int numberOfMonitors = BFS.Monitor.GetMonitorCountEnabledNoSplits(); // If there are 2, enable the titlebar buttons if (numberOfMonitors == 2) { if (!TitleBarButtonsEnabled()) BFS.DisplayFusion.RunFunction("Toggle TitleBar Buttons"); } // If there's only 1, disable the titlebar buttons else if (numberOfMonitors == 1) { if (TitleBarButtonsEnabled()) BFS.DisplayFusion.RunFunction("Toggle TitleBar Buttons"); } } private static bool TitleBarButtonsEnabled() { // Check the registry to see if titlebar buttons are enabled, and return a true or false using (RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Binary Fortress Software\\DisplayFusion")) { if (key != null) { Object TitleBarButtonsEnabledValue = key.GetValue("TitleBarButtonsEnabled"); if (TitleBarButtonsEnabledValue.ToString() == "1") return true; else return false; } else { return false; } } } }
Copyright © 2007-2019 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get DisplayFusion Merch