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

泉 陈 1 Reputation point
2020-06-15T08:37:13.29+00:00

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

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Fay Wang - MSFT 5,191 Reputation points
    2020-06-15T09:44:30.197+00:00

    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.


  2. 泉 陈 1 Reputation point
    2020-06-15T14:49:46.87+00:00

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

    0 comments No comments