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
Make Window Translucent and Enable Click-Through then Return Window to Previous State
Return to DisplayFusion Scripted Functions (Macros)
Description
This script makes the focused window translucent and allows clicks to pass through it on the first run. On the second run, it reverts it back to its previous state.
Language
C#.net
Minimum Version
9.9+
Created By
pl0x55036
Contributors
Sharkman43570
Date Created
Jan 19, 2022
Date Last Modified
Jan 19, 2022
Scripted Function (Macro) Code
Copy
Select All
using System; using System.Drawing; // In order to disable this on the target window, you have to run this script via keyboard shortcut or with the "One Click List" entry public static class DisplayFusionFunction { public static void Run(IntPtr windowHandle) { if (windowHandle == IntPtr.Zero) return; // Get the status of the current wintow, is already set to always on top, what is its current transparency and get a string version of the pointer to this window bool isWindowAlwaysOnTop = BFS.Window.GetAlwaysOnTop(windowHandle); decimal windowOriginalTransparency = BFS.Window.GetTransparency(windowHandle); string thisWindowHandleAsString = windowHandle.ToString(); string[] ScriptSettingsValueNames = BFS.ScriptSettings.GetValueNames(); bool indexPresent = Array.IndexOf<string>(ScriptSettingsValueNames, thisWindowHandleAsString) != -1; // If there are no values set to persist betwern executions of any function, or this function's windowHandleToString isn't present then write them all if (ScriptSettingsValueNames.Length == 0 | !indexPresent) { BFS.ScriptSettings.WriteValue(thisWindowHandleAsString, thisWindowHandleAsString); BFS.ScriptSettings.WriteValueBool(thisWindowHandleAsString + "-WindowAlwaysOnTop", isWindowAlwaysOnTop); BFS.ScriptSettings.WriteValueInt(thisWindowHandleAsString + "-WindowOriginalTransparencyInt", Convert.ToInt32(windowOriginalTransparency)); } // If Window has been made Click-Through (WS_EX_LAYERED | WS_WX_TRANSPARENT) Check for the stored variables and use those if (BFS.Window.HasWindowStyleEx(BFS.WindowEnum.WindowStyleEx.WS_EX_LAYERED | BFS.WindowEnum.WindowStyleEx.WS_EX_TRANSPARENT, windowHandle)) { if (indexPresent) { // If present set local variables to ScriptSetting ones we made in another execution else use default values isWindowAlwaysOnTop = BFS.ScriptSettings.ReadValueBool(thisWindowHandleAsString + "-WindowAlwaysOnTop") | false; windowOriginalTransparency = Convert.ToDecimal(BFS.ScriptSettings.ReadValueInt(thisWindowHandleAsString + "WindowOriginalTransparencyInt") | 100); // And now that we are about to restore the window to its former state, we delete the variables we saved BFS.ScriptSettings.DeleteValue(thisWindowHandleAsString); BFS.ScriptSettings.DeleteValue(thisWindowHandleAsString + "-WindowAlwaysOnTop"); BFS.ScriptSettings.DeleteValue(thisWindowHandleAsString + "-WindowOriginalTransparencyInt"); } BFS.Window.SetTransparency(windowHandle, windowOriginalTransparency); BFS.Window.SetWindowStyleEx(BFS.Window.GetWindowStyleEx(windowHandle) & ~BFS.WindowEnum.WindowStyleEx.WS_EX_LAYERED & ~BFS.WindowEnum.WindowStyleEx.WS_EX_TRANSPARENT, windowHandle); BFS.Window.SetAlwaysOnTop(windowHandle, isWindowAlwaysOnTop); } else { // If the window is already transparent, maintain that level, else set it to 75% BFS.Window.SetTransparency(windowHandle, windowOriginalTransparency < 100m ? windowOriginalTransparency : 75m); BFS.Window.SetWindowStyleEx(BFS.Window.GetWindowStyleEx(windowHandle) | BFS.WindowEnum.WindowStyleEx.WS_EX_LAYERED | BFS.WindowEnum.WindowStyleEx.WS_EX_TRANSPARENT, windowHandle); BFS.Window.SetAlwaysOnTop(windowHandle, true); } } }