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
appIDstringThe application ID of the jumplist to add the task to.
linksIEnumerable<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
hwndIntPtrA 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
handleIntPtrThe handle of the window whose taskbar button contains the progress indicator.
stateWindowsTaskbar.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
handleIntPtrThe handle of the window whose taskbar button contains the progress indicator.
currentValueintThe current value of the progress indicator.
maximumValueintThe value
currentValuewill 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
hwndIntPtrA handle to the window to set the ID for.
appIDstringThe application ID to set.
relaunchCommandstringThe command to use for relaunching this specific window if it was pinned to the taskbar; can be
null.relaunchIconstringThe icon to use for pinning this specific window to the taskbar (written as Path,ResourceIndex); can be
null.relaunchNamestringThe user-friendly name to associate with
relaunchCommand; can benull.
Remarks
The application ID is used to group related windows in the taskbar.