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);
}
}
}