recording c++ form with black screen

I don't want anyone should leak the paper by screen recording or by giving
remote using so many free applications for desktop sharing.
I searched for can I block such applications? But I don't think so, as there so many ways to record/share a screen.
please explain this link :
https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setwindowdisplayaffinity

How use it?
what do you think ? is it best way for all recorder software (when use this function all recording software records only black screen) and all windows (7 8 10) ?
You can't prevent someone from recording the screen, from software. Period. It's simply impossible.
Possible loopholes that software can't defend against:
* What if your software is running inside a virtual machine that sends its output to a window that can be recorded in the real machine?
* What if the graphics card output cable is connected to a device that can decode the signal and produce a video file?
* What if someone points a camera at the screen?
* What if your software is running inside a virtual machine that sends its output to a window that can be recorded in the real machine?
* What if the graphics card output cable is connected to a device that can decode the signal and produce a video file?

coding is done
* What if someone points a camera at the screen?

this is true but I want to do system protection . protection is not 100 percent .
I want to use this link :(I dont know a lot of c++ programming)
https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setwindowdisplayaffinity

# How use it?
# what do you think ? is it best way for all recorder software (when use this function all recording software records only black screen) and all windows (7 8 10) ?
Last edited on
You asked this before, and the issue is that nothing can really stop someone.

The website you linked to says:

It is important to note that unlike a security feature or an implementation of Digital Rights Management (DRM), there is no guarantee that using SetWindowDisplayAffinity and GetWindowDisplayAffinity, and other necessary functions such as DwmIsCompositionEnabled, will strictly protect windowed content, for example where someone takes a photograph of the screen.


Again, if someone really felt like recording it, there's not much you can do about it.
I know that using SetWindowDisplayAffinity and GetWindowDisplayAffinity is no guarantee ,
I have 2 question :

First : How use it? example code..
Second : this function supported win 7 8 10 ?
The function applies to Windows 7 forward.

You call it with a handle to the window and a word indicating the affinity setting.

It is even less secure than the Microsoft documentation suggests it is. A number of 3rd party capture apps bypass the setting entirely, by avoiding the request for a snapshot of the desktop through "standard" means.

Put another way, if you can see it, it doesn't take much to copy it, no camera required.


thank you.
I use this code "
 
BOOL SetWindowDisplayAffinity(hWnd, WDA_MONITOR);

but visual is show err :
error C2065: 'hWnd': undeclared identifier

It is even less secure than the Microsoft documentation suggests it is. A number of 3rd party capture apps bypass the setting entirely, by avoiding the request for a snapshot of the desktop through "standard" means.


you say this function (SetWindowDisplayAffinity) prevent some recorder and this not for all recording software , Did you mean this?( some recording software use this method to recording screen and when I use this code I prevent some recoding software)

this is important for me this code prevent all recording software or no ?

I know when user show my app , my app content will copy .
Last edited on
To call the function you must use the handle to the window you're trying to control (the window that shows the content you're protecting).

I have no way to see your code from here, so I have no idea what your code calls that handle or how you get it from your code.

Yes, I'm saying that this affinity will not stop all recording software. There are known ways of getting the content on display by working around this protection.

Such software does not USE this function, it works at a level that this function can't prevent.

I know of no way to block all recording software. If you can see it, they can get it.

This can prevent naive attempts, yes. Not the really good software, though.
thanks
hah yea I remember the first time something tried to block me from taking an alt printscreen image. It took about 30 seconds to work around that. The provided defenses won't even stop a computer literate 10 year old.
Registered users can post here. Sign in or register to post.