3

How can I detect on Windows OS level when any of my desktop application window is screen shared by any screen sharing tool. I am sure any screen sharing tool can not do screen sharing to remote user without support from Windows OS. I want to know what is that "something" which is set/done when any desktop app window is screen shared. I am writing a desktop app and want to behave differently when my app window is screen shared. I am looking for a generic solution and not specific to screen sharing tool. Any pointer to detect it manually or code snippet around this will be of great help. Thank you.

  • 2
    what if a screen sharing tool just took captures of the Desktop DC to a bitmap and encoded to jpg to send over the wire? unless you dll injected and proxied those api calls like `GetDC`, i am not sure there is a reliable way – TheGeneral Sep 30 '20 at 06:04
  • Maybe [SetWindowDisplayAffinity](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity), be sure to read the remarks. – dxiv Sep 30 '20 at 06:10
  • The question is based on the false premise that there were *"something"* in the OS that would allow you to unambiguously identify a screen capture being in progress. Much like there is nothing in the OS that would allow you to tell whether the user is running a calculator application. Or a text editor. – IInspectable Sep 30 '20 at 06:39
  • @IInspectable - Thanks for replying. However, I can check at least in task manager that notepad.exe is running or not and that will ensure notepad is actually running. Similarly I am looking for traces (anything which I can check) which OS might be emitting once screen was shared if possible. – Divya Prakash Jha Sep 30 '20 at 11:24
  • The set of text editors is open. You cannot check for every text editor that is going to exist at some point. So, no, you cannot even do that. – IInspectable Sep 30 '20 at 11:29
  • @MichaelRandall - How can I dll inject and proxy those API calls? Right now I am running out of ideas and any solution (even if crude) would work for me. Any pointer would be really appreciated. Thanks. – Divya Prakash Jha Oct 01 '20 at 13:17

0 Answers0