Verify that the WPF taskbar window preview is up to date

How can I make sure the hower preview of my WPF application (.net 4) is updated when the user hovers over the taskbar icon.
I have an application that visualizes some status values. If the application window is minimized and the user hovers over the taskbar button, the last window view in which the window was active is displayed in the preview window. However, I would like to have an updated view.
Is there any way to achieve this?

+6
source share
2 answers

I believe that you need to configure the preview as described here (in the Preview Custom Settings section). What uses the Windows API Code Code for the Microsoftยฎ .NET Framework .

An example can be found here , but it looks like this:

TabbedThumbnail preview = new TabbedThumbnail(parentForm.Handle, childForm.Handle); TaskbarManager.Instance.TabbedThumbnail.AddThumbnailPreview(preview); preview.TabbedThumbnailBitmapRequested += (o, e) => { Bitmap bmp = new Bitmap(width, height); // draw custom bitmap... e.SetImage(bmp); e.Handled = true; }; 

Another example: here , which says:

The CustomWindowsManager class provides abstracts for previewing custom thumbnails and real-time previews (peeks), including tools for receiving notifications when the preview bitmap is requested by the Desktop Window Manager (DWM) and automatically capture the preview bitmap window.

The download link for this code is here , which includes the CustomWindowsManager class. This seems to provide a live preview.

+6
source

You probably can't. Windows 7 translates the graphics of an open window into a preview from the taskbar. He cannot know how the window looks while it is minimized, because it is not drawn at all.

I think itโ€™s not impossible to make custom thumbnails. Besides the CodeNaked answer, I also found this article , which even includes several thumbnails from the same application.

+1
source

Source: https://habr.com/ru/post/890183/


All Articles