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
Show List of Functions (One-Click)
Return to DisplayFusion Scripted Functions (Macros)
Description
This script will show a pop-up menu with a pre-defined set of Functions. You can modify the list of Functions by editing the entries in the "functions" array. When you choose a Function from the list, it will immediately be run on the active window.
Language
C# (.Net)
Minimum Version
7.2.0+
Created By
Thomas Malloch (BFS)
Contributors
-
Date Created
Jun 12, 2015
Date Last Modified
Jun 12, 2015
Scripted Function (Macro) Code
Copy
Select All
Toggle Line Wrapping
using System; using System.Drawing; using System.Windows.Forms; // 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) { //these are all of the functions from the "Window Management" functions list //the function are just called by their namess. to find their names, you can copy them //from the context menus, or type "BFS.DisplayFusion.RunFunction(" and a window will come up //with all of the available functions string[] functions = { "Highlight Window", "Highlight Window: Disable All Highlights", "Maximize Window", "Maximize Window (ignore monitor splits)", "Minimize Window", "Minimize Window To System Tray", "Prevent Window Deactivation (keeps game windows focused)", "Restore Window", "Restore Window Positions From Last Save", "Rollup Window to Hat", "Rollup Window to Icon", "Rollup Window to TitleBar", "Save Window Positions", "Send Window to Back", "Send Windows Store (Metro) app to desktop window", "Toggle Window Always on Top", "Toggle Window Transparency", }; //create a new ContextMenuStrip to show the items using(ContextMenuStrip menu = new ContextMenuStrip()) { //dont show the padding on the left of the menu menu.ShowCheckMargin = false; menu.ShowImageMargin = false; //add items to the menu, and use our custom function when a user clicks on the items foreach(string function in functions) { menu.Items.Add(function); menu.Items[menu.Items.Count - 1].Click += MenuItem_Click; } //if the menu will show on the screen, show it. otherwise, show it above the mouse if(BFS.Monitor.GetMonitorBoundsByMouseCursor().Contains(new Point(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY() + menu.Height))) menu.Show(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY()); else menu.Show(new Point(BFS.Input.GetMousePositionX(), BFS.Input.GetMousePositionY()), ToolStripDropDownDirection.AboveRight); //wait for the menu to close while(menu.Visible) Application.DoEvents(); } } //this function will get the text of the item and try to run it as a DisplayFusion function private static void MenuItem_Click(object sender, EventArgs e) { ToolStripItem item = sender as ToolStripItem; if (item == null) return; BFS.DisplayFusion.RunFunction(item.Text); } }
Copyright © 2007-2021 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get DisplayFusion Merch