0

I'm trying to get the display of each open window beneath my app as an image, I can't hide my app and then take screenshots because it's causing a flickering of the app.

Is it possible to get a stream of images from each window?

the app is c# winforms.

I tried to find a solution using WinAPI calls, but couldn't find what I'm looking for.

Thanks in advance for all the helpers

tamir1020
  • 1
  • 2
  • [Screen capture](https://learn.microsoft.com/en-us/windows/uwp/audio-video-camera/screen-capture). Alternatively you can use [`SetWindowDisplayAffinity`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity) with the `WDA_EXCLUDEFROMCAPTURE` flag (available starting with Windows 10 2004) on your application, and go ahead and use any of the screen capture solutions that capture the entire desktop. – IInspectable Dec 21 '21 at 12:15
  • Possible duplicate of [SetWindowDisplayAffinity backcolor image/transparent](https://stackoverflow.com/q/70336544/1889329). – IInspectable Dec 21 '21 at 12:35
  • This is actually progress for me, I still need to check if I can filter other windows because The window must belong to the current process. @IInspectable – tamir1020 Dec 21 '21 at 13:32
  • The question doesn't ask how to hide other, foreign windows, though. If that is what you want, you should update the question with more detail. – IInspectable Dec 21 '21 at 13:40
  • @IInspectable Actually I asked for a stream of images of each open window, but like I said its a progress in other direction than I thought from the beginning. So thank you for your answer – tamir1020 Dec 23 '21 at 07:23
  • *"can't hide my app"* - I took that to mean that you are the author of this program. Changing the display affinity should thus be possible. However, if you want a screen capture of all windows, even when they are partially occluded by other windows, you would have to look into [screen capture](https://learn.microsoft.com/en-us/windows/uwp/audio-video-camera/screen-capture). – IInspectable Dec 23 '21 at 08:43

0 Answers0