This sample demonstrates how to use the Windows.Graphics.Capture APIs in a Win32 application.
NOTE: Minimized windows are enumerated, but not captured.
This sample requires:
- Visual Studio 2022 or later - Get a free copy of Visual Studio
- Windows 10 version 1903 or later
- Windows 10 SDK 18362 or later - Get the SDK
This sample uses new APIs available in Windows 10, version 1903 (SDK 18362) or later.
CreateForWindow
(HMON) APIs are in the Windows.Graphics.Capture.Interop.h header.
For the most part, using the API is the same between Win32 and UWP. However, there are some small differences.
- The
GraphicsCapturePicker
won't be able to infer your window in Win32, so you'll have to provide your window's HWND. Direct3D11CaptureFramePool
requires aDispatcherQueue
much like the Composition APIs. You'll need to create a dispatcher for your thread.