Can I prevent a user from taking screenshots in a Mac application?

I have an application for images and I want to publish it if unregistered users can view files, but cannot save them until they are registered.

I'm looking for a way to prevent the user from using the built-in screenshot function, so I donโ€™t need to watermark the images. How can i do this?

- Change below -

I decided to stroke the images. I tried to avoid watermarks as the images are stereoscopic, but I'm pretty happy with how the watermark looks. I put the logo in a corner and move it enough in each image so that it appears in the foreground.

Whether people agree with this in practice or not, my question is still valid. The Apple DVD Player hides the video on its screenshots, which does not stop the user from taking screenshots at all, but fulfills my original purpose.

I would really like to know how to do this. (DVD player method)

+6
cocoa macos
source share
5 answers

DVD Player does this (the user can still take a screenshot, but the playerโ€™s window does not appear in it), so I'm sure there is a way. Perhaps setting the type of window sharing to NSWindowSharingNone ?

+3
source share

You can try to run the application in full screen mode, and then capture all keystrokes. But please listen to Syrid.

+2
source share

One option, which is a very hostile user, is to change the folder in which screen captures are stored in the /dev/null style /dev/null changing the com.apple.screencapture parameter.

The huge disadvantage of this is that you can spoil the user settings and can not restore them if the exit from the application is not clean.


Another option is to keep track of the files created in the location screen capture, if they match the template for name , and then delete them.

This method is still quite hostile.


I also investigated whether it was possible to kill a process that handles screen capture, unfortunately the process that handles it, SystemUIServer just reboots after it is killed.


SystemUIServer seems to refuse to take screenshots if the DVD player is currently playing the DVD. I donโ€™t know how DVD playback detection works, but this can prevent screenshots.


References


Disclaimer before people start ranting: I have a legitimate reason to solve this problem, but will not use the com.apple.screencapture -> /dev/null method due to its shortcomings.

+2
source share

Based on the search for characters through the DVD player, he most likely uses the private API CGSSetWindowCaptureExcludeShape . Richard Heard was kind enough to redesign it and wrap it up for ease of use.

Being closed, it can stop working (or already stop working) at any time.

But in the end, the answer to your question is "yes, but not publicly documented." Some other excerpts from this long stream :

  • The task of this question inevitably causes a lot of myopic moral indignation.
  • If there is no public method, a reverse engineering DVD player is a useful way to continue.
  • Requesting an Apple DTS may be the only reliable method for finding an answer.
+2
source share

Not; what is the function of the system.

-3
source share

All Articles