User Tools

Site Tools


hiding_20a_20window_20from_20a_20screenshot

Hiding a window from a screenshot

by Richard Russell, November 2014

Suppose your program displays something which you would prefer the user not to be able to capture in a screenshot (e.g. using the Print Screen key). You can do that as follows:

        WDA_MONITOR = 1
        SYS "SetWindowDisplayAffinity", @hwnd%, WDA_MONITOR

Once this code has been executed, the specified window (here the main output window) will appear black in a screenshot.

Of course you can't stop the user taking a photograph of the screen, but the above code will go some way to discouraging the capture of your program's output

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
hiding_20a_20window_20from_20a_20screenshot.txt · Last modified: 2024/01/05 00:22 by 127.0.0.1