Sample app for Windows.Graphics.Capture
.
https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/screen-capture
Visual Studio 2019 version 16.11.31 with Desktop development with C++ and Universal Windows Platform development workloads. Install Windows 10 SDK 10.0.18362.0.
Based on https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/tree/master/cpp/ScreenCaptureforHWND (also used by OBS).
Visual C++ Windows Desktop Application (Linker/System/SubSystem: Windows).
OBS: https://github.com/obsproject/obs-studio/tree/master/libobs-winrt