1

Problem:

I am looking for a way to prevent snippingtool when using Solution program.

TRY :

ONE : I tried to prevent it by inserting "ScreenWings.exe" into the solution, but I can't use it normally due to program handling issues.

TWO : I used the "SetWindowDisplayAffinity" library but that didn't apply either. (C# Library)

IntPtr prHandle;
const uint WDA_NONE = 0;
const uint WDA_MONITOR = 1;

Process[] process = Process.GetProcesses();

foreach (Process aProc in process)
{
    if(aProc.ProcessName.ToString() == "remote-viewer")
    {
        aProc.Id.ToString();
        prHandle = aProc.MainWindowHandle;
        SetWindowDisplayAffinity(prHandle, WDA_MONITOR);
    }
}

I would be grateful if you could suggest freeware or a solution that has a command line (API) to prevent snippingtool.

SHO
  • 25
  • 8
  • You are talking about the snipping tool app, right? – Sean Mitchell Aug 13 '19 at 05:37
  • I assume, you've seen this question: https://stackoverflow.com/questions/50501280/prevent-screen-capturing-softwares-to-capture-an-application-screen Both questions (yours and Amogh's) suffer from the lack of code examples. Can you post an example using `SetWindowDisplayAffinity` that didn't work for you? – default locale Aug 13 '19 at 05:41
  • 2
    Next questions: (1) how to prevent users from taking a photo of the screen (2) how to prevent them from running your app in virtual machine and taking a screenshot from the host OS. :) – default locale Aug 13 '19 at 05:43
  • 1
    Your link has been verified. But my solution runs a specific exe program called remote-viewer. Snippingtool needs to control the remote-viewer. The handle value of the remote-viewer was not handled in SetWindowDisplayAffinity. – SHO Aug 13 '19 at 05:50
  • [`SetWindowDisplayAffinity`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity) only works for windows of your application. From the docs: "This feature enables applications to protect their **own** onscreen window content ... " Do you have any control over remote-viewer? – default locale Aug 13 '19 at 06:06
  • It can not be controlled. I've browsed all the APIs. So I was looking for a program like ScreenWings. – SHO Aug 13 '19 at 06:11
  • Here's a cool project that does what you want: https://github.com/flamencist/AntiScreenLogger As far as I can understand, the trick is to create a transparent click-through form on top of the screen and then set affinity for it. – default locale Aug 13 '19 at 06:23
  • 1
    The solution you sent us is perfect, but the same thing happens when we run ScreenWings. After running the solution you sent me, when I run the remote-viewer, I can't click the mouse inside the remote-viewer. – SHO Aug 13 '19 at 06:37

0 Answers0