I have never used Snapchat, but Im guessing they have the exact solution Im looking for. In my game it would be considered cheating if players took screenshots of the game in certain situations. I want to prevent that by giving penalties when that happens. Is there a nice, delicate solution for this?
No, you can’t detect this reliably. They also could make a photo with a digi cam. Furthermore there are endless ways to create a screenshot and the os has no “callback” to inform an application about that. You could try to detect the “print screen” key but as i said there are other screenshot / screen recording tools which could use any hotkey or no hotkey at all.
I’ve written an automatic screenshot tool years ago which will take a screen shot every second without any interaction.
I have never used Snapchat but it seems it’s not safe either.
btw: There are even monitors and video projectors which have a freeze mode to keep the current image. You could also run your browser in a virtual machine. There you can actually freeze the whole virtual PC or take screen shots from the virtual screen and an application running inside the VM has no way to even detect or prevent that.