Class WindowsTaskbar
Provides helper methods and API calls specific to the Windows 7 or newer taskbar.
Namespace: NanoByte.Common.Native
Assembly: NanoByte.Common.dll
Syntax
public static class WindowsTaskbar : Object
Methods
AddTaskLinks(String, IEnumerable<WindowsTaskbar.ShellLink>)
Adds user-task links to the taskbar jumplist. Any existing task links are removed.
Declaration
public static void AddTaskLinks(string appID, IEnumerable<WindowsTaskbar.ShellLink> links)
Parameters
Type | Name | Description |
---|---|---|
String | appID | The application ID of the jumplist to add the task to. |
IEnumerable<WindowsTaskbar.ShellLink> | links | The links to add to the jumplist. |
PreventPinning(IntPtr)
Prevents a specific window from being pinned to the taskbar.
Declaration
public static void PreventPinning(IntPtr hwnd)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hwnd | A handle to the window to prevent from being pinned. |
SetProgressState(IntPtr, WindowsTaskbar.ProgressBarState)
Sets the state of the taskbar progress indicator.
Declaration
public static void SetProgressState(IntPtr handle, WindowsTaskbar.ProgressBarState state)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | handle | The handle of the window whose taskbar button contains the progress indicator. |
WindowsTaskbar.ProgressBarState | state | The state of the progress indicator. |
SetProgressValue(IntPtr, Int32, Int32)
Sets the value of the taskbar progress indicator.
Declaration
public static void SetProgressValue(IntPtr handle, int currentValue, int maximumValue)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | handle | The handle of the window whose taskbar button contains the progress indicator. |
Int32 | currentValue | The current value of the progress indicator. |
Int32 | maximumValue | The value |
SetWindowAppID(IntPtr, String, String, String, String)
Sets a specific window's explicit application user model ID.
Declaration
public static void SetWindowAppID(IntPtr hwnd, string appID, string relaunchCommand = null, string relaunchIcon = null, string relaunchName = null)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | hwnd | A handle to the window to set the ID for. |
String | appID | The application ID to set. |
String | relaunchCommand | The command to use for relaunching this specific window if it was pinned to the taskbar; can be |
String | relaunchIcon | The icon to use for pinning this specific window to the taskbar (written as Path,ResourceIndex); can be |
String | relaunchName | The user-friendly name to associate with |
Remarks
The application ID is used to group related windows in the taskbar.