Table of Contents

Class WindowsTaskbar

Namespace
NanoByte.Common.Native
Assembly
NanoByte.Common.dll

Provides helper methods and API calls specific to the Windows 7 or newer taskbar.

public static class WindowsTaskbar
Inheritance
object
WindowsTaskbar

Methods

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 string

The 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 IntPtr

A 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 IntPtr

The handle of the window whose taskbar button contains the progress indicator.

state WindowsTaskbar.ProgressBarState

The 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 IntPtr

The handle of the window whose taskbar button contains the progress indicator.

currentValue int

The current value of the progress indicator.

maximumValue int

The 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 IntPtr

A handle to the window to set the ID for.

appID string

The application ID to set.

relaunchCommand string

The command to use for relaunching this specific window if it was pinned to the taskbar; can be null.

relaunchIcon string

The icon to use for pinning this specific window to the taskbar (written as Path,ResourceIndex); can be null.

relaunchName string

The user-friendly name to associate with relaunchCommand; can be null.

Remarks

The application ID is used to group related windows in the taskbar.