Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

ElektroStudios/DWM-Desktop-Window-Manager-Thumbnail-User-Control-for-.NET

ElektroDwmThumbnail

An user control for .NET providing DWM (Desktop Window Manager) thumbnail functionalities.

Warning

This repository is archived in a read-only state and is no longer maintained.

This project is no longer updated or supported, but remains available for reference and educational use.


Forks  Contributors  Followers  Watchers Sponsors  Stars

SonarCloud Quality Gate Latest Release Language License Repo size Total Downloads
Last commit Pull Requests Open IssuesClosed Issues Maintenance

Made in Spain


👋 Introduction

ElektroDwmThumbnail is a .NET user-control written in VB.NET that enables the creation of dynamic real-time preview thumbnails for any window. It utilizes various DWM API functions and is provided as a user-control for easy and user-friendly implementation.

💡 Motivation

When building desktop tools for Windows, you might want to display a live preview of another window (like a video player, a game, or a browser window) directly inside your own application.

Doing this manually by taking screenshots or capturing the screen over and over is bad for performance, uses too much CPU, and lags. Windows already has a built-in feature called DWM (Desktop Window Manager) that handles these thumbnails using hardware acceleration, but using it in .NET requires writing complex Win32 P/Invoke code, managing unmanaged memory, and dealing with window handles (HWND).

ElektroDwmThumbnail solves this by turning all that low-level code into a standard, reusable .NET User Control. You can just drag and drop it onto your form in Visual Studio and control everything through its properties, making it simple to show smooth, real-time window previews without the performance headache.

⚡ The Real Question
Why waste hours debugging unstable P/Invoke interop structures and burning CPU cycles on archaic GDI+ screenshots, when you can drop a native, hardware-accelerated DWM rendering surface into your .NET application with a single line of code?.

🎦 Videos

ElektroDwmThumbnail.Demo.mp4

📝 Requirements

  • Visual Studio.

🚀 Getting Started

  1. Navigate to the Releases page.
  2. Download the latest .zip archive.

Usage example in C#:

// Register a DWM thumbnail for the main window of Notepad process.
Process pr = Process.GetProcessesByName("Notepad").SingleOrDefault();
IntPtr? hWnd = pr?.MainWindowHandle;
ElektroDwmThumbnail1.RegisterThumbnail(hWnd);

// Unregister the DWM thumbnail.
ElektroDwmThumbnail1.UnregisterThumbnail();

Usage example in VB.NET:

' Register a DWM thumbnail for the main window of Notepad process.
Dim pr As Process = Process.GetProcessesByName("Notepad").SingleOrDefault()
Dim hWnd As IntPtr? = pr?.MainWindowHandle
ElektroDwmThumbnail1.RegisterThumbnail(hWnd)

' Unregister the DWM thumbnail.
ElektroDwmThumbnail1.UnregisterThumbnail()

Available properties in the control's property grid:

[properties


💪 Contributing

Your contribution is highly appreciated!. If you have any ideas, suggestions, or encounter issues, feel free to open an issue by clicking here.

Your input helps make this Work better for everyone. Thank you for your support! 🚀

💰 Beyond Contribution

This work is distributed for educational purposes and without any profit motive. However, if you find value in my efforts and wish to support and motivate my ongoing work, you may consider contributing financially through the following options:

Platform How to Support
Become my sponsor on GitHub
Contribute any amount you prefer and unlock rewards!
Support me on Ko-fi
Buy me a coffee!
Become a Patron on Patreon
Support my open-source work regularly!
Make a PayPal Donation
Donate any amount you like via PayPal!
Purchase my software at Envato's CodeCanyon
Discover my desktop tools and DevCase Class Library for .NET, an extensive API suite.

Your support means the world to me! Thank you for considering it! 🤗💗

⚠️ Disclaimer

This software and its associated repository are provided strictly on an "as is" basis, without warranties of any kind, whether express or implied. This includes, but is not limited to, any implied warranties of merchantability, reliability, or fitness for a particular purpose.

The authors and copyright holders assume no liability for any direct, indirect, incidental, or consequential damages—including data loss or system errors—arising from the use, misuse, or inability to use this software. You are solely responsible for determining the appropriateness of using this tool and assume all associated risks.

Furthermore, this project operates entirely independently. The utilization of any third-party libraries or components within this software does not imply any affiliation with, or endorsement or approval by, their respective original authors.

This project is licensed under the Apache License, Version 2.0. See the License file for details.