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
Rollup window when not in focus
Return to DisplayFusion Scripted Functions (Macros)
Description
This script will roll up the specified window when not in focus. Set the window text you want to look for on line 15.
Language
C#.net
Minimum Version
9.8+
Created By
Keith Lammers (BFS)
Contributors
-
Date Created
Jul 2, 2021
Date Last Modified
Jul 2, 2021
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 part of the Window Text to look for in the window title here string targetWindowText = "*Notepad*"; // Loop forever while (true) { // Get the focused window and the target window IntPtr focusedWindow = BFS.Window.GetFocusedWindow(); IntPtr targetWindow = BFS.Window.GetWindowByText(targetWindowText); // If the target window isn't focused and isn't already rolled up, roll it up if (focusedWindow != targetWindow && !BFS.Window.IsWindowRolledUpToIcon(targetWindow)) { BFS.Window.RollupWindowToIcon(targetWindow); } // Wait 250ms before looping to avoid running up the CPU BFS.General.ThreadWait(250); } } }