question

AdamBajac-1332 avatar image
0 Votes"
AdamBajac-1332 asked JeanineZhang-MSFT edited

LogonUI, PowerShell and Command Prompt windows invisible when using GetDC to capture a screenshot in Hyper-V Server

Hi all,

As the title says, I am capturing screenshots of the desktop using GdiPlus through examples found pretty commonly on the internet (GetDC, BitBlt, etc). Combining this with the OpenInputDesktop and SetDesktopThread API even allows me to capture the secure desktop, which is exactly what I want. However, I've noticed that with Hyper-V Server 2016 and above, the logon UI, and any cmd or powershell Windows are not included in my screencap. I'm assuming it's a permissions thing, but my application taking the screenshots is already running as local system.

This does not happen outside of Hyper-V Server, and applications such as teamviewer are still able to capture those windows. Can anyone illuminate me as to why this behavior occurs in Hyper-V Server?

windows-apic++windows-server-hyper-v
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.

0 Answers