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?
# 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 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.
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.
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 .
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.
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.