Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

Toggle Windows Taskbar

Description
This script will disable or enable the Windows taskbar by setting its opacity to 0.
Language
C#.net
Minimum Version
Created By
XTheocharis
Contributors
-
Date Created
11d ago
Date Last Modified
11d ago

Scripted Function (Macro) Code

using System;

// When the Windows Taskbar transparency is set to 0 not only does it become invisible
// but it also stops capturing input / existing at all.
// As a result the Taskbar is effectively disabled.

// Note1: I've confirmed this behavior in Windows 10 and Windows 11 but haven't tested older versions.

// Note2: Pairs well with the advanced option "Show DisplayFusion taskbar on Windows taskbar monitor" being set to "Taskbar is shown on Windows taskbar monitor".
// Note2: Effectively allows complete replacement of the Windows taskbar.

public static class DisplayFusionFunction
{
	public static void Run(IntPtr windowHandle)
	{
		var taskbarHandle = BFS.Window.GetWindowByClass("Shell_TrayWnd");
		if (taskbarHandle != IntPtr.Zero)
			BFS.Window.SetTransparency(taskbarHandle,
				BFS.Window.GetTransparency(taskbarHandle) > 0 ? 0 : 100);
	}
}