Table of Contents

Class TabbedThumbnailManager

Namespace
Microsoft.WindowsAPICodePack.Taskbar
Assembly
Microsoft.WindowsAPICodePack.Shell.dll

Represents the main class for adding and removing tabbed thumbnails on the Taskbar for child windows and controls.

public class TabbedThumbnailManager
Inheritance
TabbedThumbnailManager
Inherited Members

Methods

AddThumbnailPreview(TabbedThumbnail)

Adds a new tabbed thumbnail to the taskbar.

public void AddThumbnailPreview(TabbedThumbnail preview)

Parameters

preview TabbedThumbnail

Thumbnail preview for a specific window handle or control. The preview object can be initialized with specific properties for the title, bitmap, and tooltip.

Exceptions

ArgumentException

If the tabbed thumbnail has already been added

ClearThumbnailClip(nint)

Clear a clip that is already in place and return to the default display of the thumbnail.

public static void ClearThumbnailClip(nint windowHandle)

Parameters

windowHandle nint

The handle to a window represented in the taskbar. This has to be a top-level window.

GetThumbnailPreview(nint)

Gets the TabbedThumbnail object associated with the given window handle

public TabbedThumbnail GetThumbnailPreview(nint windowHandle)

Parameters

windowHandle nint

Window handle for the control/window

Returns

TabbedThumbnail

TabbedThumbnail associated with the given window handle

GetThumbnailPreview(Control)

Gets the TabbedThumbnail object associated with the given control

public TabbedThumbnail GetThumbnailPreview(Control control)

Parameters

control Control

Specific control for which the preview object is requested

Returns

TabbedThumbnail

TabbedThumbnail associated with the given control

GetThumbnailPreview(UIElement)

Gets the TabbedThumbnail object associated with the given WPF Window

public TabbedThumbnail GetThumbnailPreview(UIElement windowsControl)

Parameters

windowsControl UIElement

WPF Control (UIElement) for which the preview object is requested

Returns

TabbedThumbnail

TabbedThumbnail associated with the given WPF Window

InvalidateThumbnails()

Invalidates all the tabbed thumbnails. This will force the Desktop Window Manager to not use the cached thumbnail or preview or aero peek and request a new one next time.

public void InvalidateThumbnails()

Remarks

This method should not be called frequently. Doing so can lead to poor performance as new bitmaps are created and retrieved.

IsThumbnailPreviewAdded(TabbedThumbnail)

Determines whether the given preview has been added to the taskbar's tabbed thumbnail list.

public bool IsThumbnailPreviewAdded(TabbedThumbnail preview)

Parameters

preview TabbedThumbnail

The preview to locate on the taskbar's tabbed thumbnail list

Returns

bool

true if the tab is already added on the taskbar; otherwise, false.

IsThumbnailPreviewAdded(nint)

Determines whether the given window has been added to the taskbar's tabbed thumbnail list.

public bool IsThumbnailPreviewAdded(nint windowHandle)

Parameters

windowHandle nint

The window to locate on the taskbar's tabbed thumbnail list

Returns

bool

true if the tab is already added on the taskbar; otherwise, false.

IsThumbnailPreviewAdded(Control)

Determines whether the given control has been added to the taskbar's tabbed thumbnail list.

public bool IsThumbnailPreviewAdded(Control control)

Parameters

control Control

The preview to locate on the taskbar's tabbed thumbnail list

Returns

bool

true if the tab is already added on the taskbar; otherwise, false.

IsThumbnailPreviewAdded(UIElement)

Determines whether the given control has been added to the taskbar's tabbed thumbnail list.

public bool IsThumbnailPreviewAdded(UIElement control)

Parameters

control UIElement

The preview to locate on the taskbar's tabbed thumbnail list

Returns

bool

true if the tab is already added on the taskbar; otherwise, false.

RemoveThumbnailPreview(TabbedThumbnail)

Remove the tabbed thumbnail from the taskbar.

public void RemoveThumbnailPreview(TabbedThumbnail preview)

Parameters

preview TabbedThumbnail

TabbedThumbnail associated with the control/window that is to be removed from the taskbar

RemoveThumbnailPreview(nint)

Remove the tabbed thumbnail from the taskbar.

public void RemoveThumbnailPreview(nint windowHandle)

Parameters

windowHandle nint

TabbedThumbnail associated with the window handle that is to be removed from the taskbar

RemoveThumbnailPreview(Control)

Remove the tabbed thumbnail from the taskbar.

public void RemoveThumbnailPreview(Control control)

Parameters

control Control

TabbedThumbnail associated with the control that is to be removed from the taskbar

RemoveThumbnailPreview(UIElement)

Remove the tabbed thumbnail from the taskbar.

public void RemoveThumbnailPreview(UIElement windowsControl)

Parameters

windowsControl UIElement

TabbedThumbnail associated with the WPF Control (UIElement) that is to be removed from the taskbar

SetActiveTab(TabbedThumbnail)

Sets the given tabbed thumbnail preview object as being active on the taskbar tabbed thumbnails list. Call this method to keep the application and the taskbar in sync as to which window/control is currently active (or selected, in the case of tabbed application).

public void SetActiveTab(TabbedThumbnail preview)

Parameters

preview TabbedThumbnail

TabbedThumbnail for the specific control/indow that is currently active in the application

Exceptions

ArgumentException

If the control/window is not yet added to the tabbed thumbnails list

SetActiveTab(nint)

Sets the given window handle as being active on the taskbar tabbed thumbnails list. Call this method to keep the application and the taskbar in sync as to which window/control is currently active (or selected, in the case of tabbed application).

public void SetActiveTab(nint windowHandle)

Parameters

windowHandle nint

Window handle for the control/window that is currently active in the application

Exceptions

ArgumentException

If the control/window is not yet added to the tabbed thumbnails list

SetActiveTab(Control)

Sets the given Control/Form window as being active on the taskbar tabbed thumbnails list. Call this method to keep the application and the taskbar in sync as to which window/control is currently active (or selected, in the case of tabbed application).

public void SetActiveTab(Control control)

Parameters

control Control

Control/Form that is currently active in the application

Exceptions

ArgumentException

If the control/window is not yet added to the tabbed thumbnails list

SetActiveTab(UIElement)

Sets the given WPF window as being active on the taskbar tabbed thumbnails list. Call this method to keep the application and the taskbar in sync as to which window/control is currently active (or selected, in the case of tabbed application).

public void SetActiveTab(UIElement windowsControl)

Parameters

windowsControl UIElement

WPF control that is currently active in the application

Exceptions

ArgumentException

If the control/window is not yet added to the tabbed thumbnails list

SetTabOrder(TabbedThumbnail, TabbedThumbnail)

Moves an existing thumbnail to a new position in the application's group.

public static void SetTabOrder(TabbedThumbnail previewToChange, TabbedThumbnail insertBeforePreview)

Parameters

previewToChange TabbedThumbnail

Preview for the window whose order is being changed. This value is required, must already be added via AddThumbnailPreview method, and cannot be null.

insertBeforePreview TabbedThumbnail

The preview of the tab window whose thumbnail that previewToChange is inserted to the left of. This preview must already be added via AddThumbnailPreview. If this value is null, the previewToChange tab is added to the end of the list.

SetThumbnailClip(nint, Rectangle?)

Selects a portion of a window's client area to display as that window's thumbnail in the taskbar.

public void SetThumbnailClip(nint windowHandle, Rectangle? clippingRectangle)

Parameters

windowHandle nint

The handle to a window represented in the taskbar. This has to be a top-level window.

clippingRectangle Rectangle?

Rectangle structure that specifies a selection within the window's client area, relative to the upper-left corner of that client area.

If this parameter is null, the clipping area will be cleared and the default display of the thumbnail will be used instead.