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 DisplayFusion Taskbar on Specific Monitor

Description
This script will toggle the DisplayFusion taskbar on a specific monitor between enabled and disabled.
Language
VB.net
Minimum Version
Created By
iiDivine
Contributors
-
Date Created
11d ago
Date Last Modified
11d ago

Scripted Function (Macro) Code

Imports System
Imports 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 Class DisplayFusionFunction

	Public Shared Sub Run(ByVal windowHandle As IntPtr)
     Dim monitorID As Integer = 1
        Dim toggleVarName As String = "TaskbarToggle_M" & monitorID.ToString()

        ' Ophalen huidige toggle-status, standaard naar "on"
        Dim isHidden As Boolean = BFS.ScriptSettings.ReadValue(toggleVarName) = "true"

        If isHidden Then
            ' Taakbalk was verborgen → zet weer aan
            BFS.DisplayFusion.EnableTaskbar(monitorID)
            BFS.ScriptSettings.WriteValue(toggleVarName, "false")
        Else
            ' Taakbalk was aan → verberg hem
            BFS.DisplayFusion.DisableTaskbar(monitorID)
            BFS.ScriptSettings.WriteValue(toggleVarName, "true")
        End If
	End Sub

End Class