Thumbnail Windows 7 任务栏开发之缩略图预览( 二 )


通过RemoveThumbnailPreview 方法将指定的缩略图、窗口句柄、Form控件、WPF控件从任务栏缩略图中删除:
public void RemoveThumbnailPreview(TabbedThumbnail preview){… …} 
public void RemoveThumbnailPreview(IntPtr windowHandle){… …} 
public void RemoveThumbnailPreview(Control control){… …} 
public void RemoveThumbnailPreview(UIElement windowsControl){… …}
TabbedThumbnailManager.IsThumbnailPrevIEwAdded 方法
通过IsThumbnailPreviewAdded 方法判断的缩略图、窗口句柄、Form控件、WPF控件是否已添加,并返回Bool 值:
public bool IsThumbnailPreviewAdded(TabbedThumbnail preview){… …} 
public bool IsThumbnailPreviewAdded(IntPtr windowHandle){… …} 
public bool IsThumbnailPreviewAdded(Control control){… …} 
public bool IsThumbnailPreviewAdded(UIElement control){… …}
TabbedThumbnailManager.SetTabOrder 方法
通过SetTabOrder 方法调换两个TabbedThumbnail 前后位置,注意第一个TabbedThumbnail 将调换到第二个TabbedThumbnail 的前面 。
public void SetTabOrder(TabbedThumbnail previewToChange, 
TabbedThumbnail insertBeforePreview){… …}
效果演示
通过以上方法就能够随心所欲的设定缩略图了,下面就将上面示意图中的缩略图改为Windows Logo 图标,其中ui 即为XAML 代码中控件的名称(x:Name):
TabbedThumbnail newPreview = new TabbedThumbnail(Application.Current.MainWindow, ui, peekOffect); 
TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(newPreview); 
TaskbarManager.Instance.TabbedThumbnail.SetActiveTab(newPreview);
点击“Set this image as thumbnail 前后对比,缩略图变为了 控件:
修改前
修改后
点击“Add another thumbnail 后,可将