Share via

IGraphicsCaptureItemInterop::CreateForMonitor fails on Windows 11 build 26100 update .7623 but works on .3775

Cohen, Benny [BWIIL] 0 Reputation points
2026-02-12T07:31:27.9+00:00

I have a Win32 app using Windows.Graphics.Capture to capture both monitors and individual windows. On my dev machine (Windows 11 build 26100 update .3775) everything works fine, but on the target machine (Windows 11 build 26100 update .7623) calls to IGraphicsCaptureItemInterop::CreateForMonitor fail.

Observed behavior:

Dev: CreateForMonitor succeeds and returns valid GraphicsCaptureItem.

Target: CreateForMonitor returns E_INVALIDARG.

Questions:

Were there any changes to CreateForMonitor between build .3775 and build .7623 that might require different permissions or handling?

Can GraphicsCaptureItem.TryCreateFromDisplayId(DisplayId) be used instead of CreateForMonitor together with Microsoft.UI.Interop::GetDisplayIdFromMonitor in a regular Win32 .exe (non-UWP) application?

Windows development | Windows API - Win32
{count} votes

1 answer

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 15,205 Reputation points Microsoft External Staff Moderator
    2026-02-12T08:39:51.4233333+00:00

    Hi @Cohen, Benny [BWIIL],

    Thanks for reaching out.

    There are no publicly documented breaking changes to IGraphicsCaptureItemInterop::CreateForMonitor between build 26100.3775 and .7623. However, since CreateForMonitor relies on a raw HMONITOR, stricter validation in newer builds could potentially result in E_INVALIDARG if the handle is considered invalid or not aligned with the current display topology.

    As a supported alternative, you can use the ID-based approach with GraphicsCaptureItem.TryCreateFromDisplayId(DisplayId) (https://learn.microsoft.com/en-us/uwp/api/windows.graphics.capture.graphicscaptureitem.trycreatefromdisplayid?view=winrt-26100) together with Microsoft.UI.Interop::GetDisplayIdFromMonitor (https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/win32/microsoft.ui.interop/nf-microsoft-ui-interop-getdisplayidfrommonitor), or the .NET wrapper Microsoft.UI.Win32Interop.GetDisplayIdFromMonitor (https://learn.microsoft.com/en-au/windows/apps/api-reference/cs-interop-apis/microsoft.ui/microsoft.ui.win32interop). These APIs are officially documented and supported for Win32 applications.

    While the documentation does not state that this replaces CreateForMonitor, using DisplayId avoids relying directly on HMONITOR and aligns with the newer display identification model.

    Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.