830f854128
* Update AdvancedColorImages (cpp) * Update HelloComposition (cpp) * Update HelloVectors (cpp) * Update ScreenCaptureforHWND (cpp) * Update VirtualSurfaces (cpp) * Fix null deref in VisualLayerIntegration (dotnet wpf) * Use "latest" SDK for cpp projects * Update cpp READMEs * Fix accidental move of header file * update to latest C++/WinRT version |
||
---|---|---|
.. | ||
ScreenCaptureforHWND | ||
.gitattributes | ||
.gitignore | ||
README.md | ||
ScreenCaptureforHWND.sln |
README.md
Screen capture for HWND
This sample demonstrates how to use the Windows.Graphics.Capture APIs in a Win32 application.
NOTE: Minimized windows are enumerated, but not captured.
Run the sample
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
Code at a glance
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.
Win32 vs UWP
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.