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?