[WPF] Customize or Disable the image preview, which displays when a user hovers over an app's icon on the taskbar and switch to Task View (Windows + Tab)?

Md. Niaz Mahmud 171 Reputation points
2023-10-23T06:05:11.6533333+00:00

How can I Customize or Disable the image preview , which displays when a user hovers over an app's icon on the taskbar? And, Switch to Task View (Windows + Tab) programmatically in WPF code? I need this to hide content of app when user hover over app icon or go to taskview. Please help. :)

Task-View

download

Developer technologies Windows Presentation Foundation
Developer technologies C#
0 comments No comments
{count} votes

Accepted answer
  1. Hui Liu-MSFT 48,676 Reputation points Microsoft External Staff
    2023-10-23T10:12:36.47+00:00

    Hi,@Md. Niaz Mahmud. Welcome to Microsoft Q&A Forum.

    You could try to interact with the Windows Desktop Window Manager (DWM) API to capture and manipulate thumbnail previews of specific applications. For specific code, you can refer to the solution https://stackoverflow.com/a/17486560 and the links therein.

    This code registers a thumbnail for a specified window and updates the thumbnail properties. You also seem to be trying to capture the content of a specified window.

    Registering Thumbnail: The code registers a thumbnail of a specified window successfully using the DwmRegisterThumbnail method. This is the first step in creating a live thumbnail of the window.

    Updating Thumbnail: The UpdateThumb method updates the properties of the thumbnail, making it visible and specifying its destination. It also specifies the opacity of the thumbnail. These are crucial steps for controlling how the thumbnail appears.

    Please note that working with the DWM API is complex, and the code represents only a part of what would be needed to create a full-featured application with live previews. Additionally, this kind of low-level interaction with the system can have unexpected behavior and might not be appropriate for all use cases. Always consider the user experience and the impact on system stability when implementing such functionality.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Castorix31 90,521 Reputation points
    2023-10-23T13:50:05.69+00:00

    You can delete or change it with ITaskbarList3

    (I tested by changing the thumbnail with ITaskbarList3::SetThumbnailClip but it only changes it in the Taskbar)

    (deleting it removes the Taskbar button and also the image in Task View)

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.