question

62139757 avatar image
0 Votes"
62139757 asked FayWang-MSFT edited

Build GraphicsCaptureItem from HWND in C++, for win10 1809

Hi guys,

I have a question on how to build a GraphicsCaptureItem from current window's HWND in Win10 1809. We want to use UWP's Windows.Graphics.Capture APIs, introduced in Win10 1803, to capture our own win32 C++ application to a video. The problem is that although we're all on Win10 1809, the API for creating a GraphicsCaptureItem object from a HWND, CreateForWindow to be specific, is added in Win10 1903. So it's a problem for use to get the GraphicsCaptureItem item for our window the capture. Any idea on how I can do this? Appreciated for any help or comment!

Thanks,

Quan

windows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

FayWang-MSFT avatar image
0 Votes"
FayWang-MSFT answered FayWang-MSFT edited

Hello,

Welcome to Microsoft Q&A!

The CreateForWindow method is a new API available in Windows 10, version 1903 (SDK 18362) or later, you can only use it in the Windows 10 1903 or later, it is not available in 1809.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yeah, you're right it's newly added in Win10 1903. So is there any way that I can implement it with the APIs in Win10 1809?
Ultimately what I need to do is to build a GraphicsCaptureItem for our Win32 C++ application's window. Is it possible?

0 Votes 0 ·
62139757 avatar image
0 Votes"
62139757 answered

Maybe CreateFromVisual can help here. I will look into it deeper.
Also, any more ideas/comments are welcome!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.