Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

Make Window Translucent and Enable Click-Through

Description
This script will make the focused window translucent (50% opacity) and enable click-through on the window, so that mouse clicks will pass through to the windows behind it. This script will work best when run using a key combination, as once it's been run on a window, it won't have TitleBar Buttons any more, so reverting back will require alt-tabbing to the window and then pressing the key combination.
Language
C#.net
Minimum Version
Created By
Sharkman43570
Contributors
-
Date Created
Jul 7, 2016
Date Last Modified
Jul 7, 2016

Scripted Function (Macro) Code

using System;
using System.Drawing;

// In order to disable this on the target window, you have to run this script via keyboard shortcut!

public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {	
        if (windowHandle == IntPtr.Zero)
            return;

        if (BFS.Window.HasWindowStyleEx(BFS.WindowEnum.WindowStyleEx.WS_EX_LAYERED | BFS.WindowEnum.WindowStyleEx.WS_EX_TRANSPARENT, windowHandle))
            {
                BFS.Window.SetTransparency(windowHandle, 100m);
                BFS.Window.SetWindowStyleEx(BFS.Window.GetWindowStyleEx(windowHandle) & ~BFS.WindowEnum.WindowStyleEx.WS_EX_LAYERED & ~BFS.WindowEnum.WindowStyleEx.WS_EX_TRANSPARENT, windowHandle);
            }
        else
            {
                BFS.Window.SetWindowStyleEx(BFS.Window.GetWindowStyleEx(windowHandle) | BFS.WindowEnum.WindowStyleEx.WS_EX_LAYERED | BFS.WindowEnum.WindowStyleEx.WS_EX_TRANSPARENT, windowHandle);
                BFS.Window.SetTransparency(windowHandle, 50m);
            }
    }
}