For motivational purposes, let's start with
a program that displays a DWM thumbnail.
Start with
the scratch program
and add the following:
#include <dwmapi.h>
HWND g_hwndThumbnail;
HTHUMBNAIL g_hthumb;
void UpdateThumbnail(HWND hwndFrame, HWND hwndTarget)
{
if (g_hwndThumbnail != hwndTarget) {
g_hwndThumbnail = hwndTarget;
...