0

How can i capture image from specific window with SetWindowDisplayAffinity = 1? I know OBS Studio with "Game Capture" resource and NVIDIA ShadowPlay can do this, but i don't know how.

I already tried to capture the window image by BitBlt and PrintWindow and was unsuccessful. All those functions returns a black screen.

I think OBS uses DirectX driver, but I have no idea how to use.

Window with SetWindowDisplayAffinity = 0

Window with SetWindowDisplayAffinity = 1

  • 1
    The *whole point* of `SetWindowDisplayAffinity()` is to help prevent capturing of a window. [The documentation](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity) even says as much: "*This feature enables applications to **protect their own onscreen window content from being captured** or copied through a specific set of public operating system features and APIs.*" Tools like OBS Studio and NVIDIA ShadowPlay are likely using their own display drivers to capture raw monitor data – Remy Lebeau Dec 29 '19 at 17:20
  • Are you sure about OBS Studio? i think OBS doesn't use its own driver. – Pedro Duarte Dec 29 '19 at 19:55
  • I think it is possible to capture the window by some DirectX feature, I just have no idea how. – Pedro Duarte Dec 29 '19 at 19:56

0 Answers0