Class WindowsTaskbar
Provides helper methods and API calls specific to the Windows 7 or newer taskbar.
public static class WindowsTaskbar
- Inheritance
-
objectWindowsTaskbar
Methods
AddTaskLinks(string, IEnumerable<ShellLink>)
Adds user-task links to the taskbar jumplist. Any existing task links are removed.
public static void AddTaskLinks(string appID, IEnumerable<WindowsTaskbar.ShellLink> links)
Parameters
appID
stringThe application ID of the jumplist to add the task to.
links
IEnumerable<WindowsTaskbar.ShellLink>The links to add to the jumplist.
PreventPinning(IntPtr)
Prevents a specific window from being pinned to the taskbar.
public static void PreventPinning(IntPtr hwnd)
Parameters
hwnd
IntPtrA handle to the window to prevent from being pinned.
SetProgressState(IntPtr, ProgressBarState)
Sets the state of the taskbar progress indicator.
public static void SetProgressState(IntPtr handle, WindowsTaskbar.ProgressBarState state)
Parameters
handle
IntPtrThe handle of the window whose taskbar button contains the progress indicator.
state
WindowsTaskbar.ProgressBarStateThe state of the progress indicator.
SetProgressValue(IntPtr, int, int)
Sets the value of the taskbar progress indicator.
public static void SetProgressValue(IntPtr handle, int currentValue, int maximumValue)
Parameters
handle
IntPtrThe handle of the window whose taskbar button contains the progress indicator.
currentValue
intThe current value of the progress indicator.
maximumValue
intThe value
currentValue
will have when the operation is complete.
SetWindowAppID(IntPtr, string, string?, string?, string?)
Sets a specific window's explicit application user model ID.
public static void SetWindowAppID(IntPtr hwnd, string appID, string? relaunchCommand = null, string? relaunchIcon = null, string? relaunchName = null)
Parameters
hwnd
IntPtrA handle to the window to set the ID for.
appID
stringThe application ID to set.
relaunchCommand
stringThe command to use for relaunching this specific window if it was pinned to the taskbar; can be
null
.relaunchIcon
stringThe icon to use for pinning this specific window to the taskbar (written as Path,ResourceIndex); can be
null
.relaunchName
stringThe user-friendly name to associate with
relaunchCommand
; can benull
.
Remarks
The application ID is used to group related windows in the taskbar.