microsoft / Windows.UI.Composition-Win32-Samples

Windows.UI.Composition Win32 Samples
MIT License
459 stars 186 forks source link

CreateForWindow 0x80070057 #133

Closed zhaokaixs closed 2 months ago

zhaokaixs commented 2 months ago

ScreenCaptureforHWND.exe is running on new desktop (CreateDesktop and SwitchDesktop),CreateForWindow return 0x80070057 CreateForMonitor work well

image

robmikh commented 2 months ago

What window are you trying to capture?

The issue is that not all windows are supported by Windows.Graphics.Capture at this time. The general rule of thumb is that if you can see it in the Alt+Tab interface, you can capture it. Child windows are not supported.

zhaokaixs commented 2 months ago

I just tested a method that terminated explorer..exe process, and CreatForMonitor will return (0x800706be), My usage scenario is to have a clean desktop

robmikh commented 2 months ago

Sorry, the explorer process must be running. Explorer facilitates the initial linkage of the capture pipeline.

robmikh commented 2 months ago

I'm going to close this issue since capturing without explorer is not supported with Windows.Graphics.Capture.

zhaokaixs commented 2 months ago

我将关闭此问题,因为 Windows.Graphics.Capture 不支持不使用资源管理器进行捕获。

Thank you for your reminder. Then I will think of other ways to hide desktop icons, right-click menus, and taskbars.

zhaokaixs commented 2 months ago

抱歉,explorer 进程必须正在运行。explorer 有助于捕获管道的初始链接。

I tested the new solution, CreateDesktop(L"new_hdesk"), and CreateProces explorer.exe on new_hdesk, CreateForWindow still returns 0x80070057