Preventing Screen Capture

This is a discussion on Preventing Screen Capture within the Windows Programming forums, part of the Platform Specific Boards category; Is it possible for a window to prevent itself from being copied by a screen capture operation?...

  1. #1
    Davros
    Guest

    Cool Preventing Screen Capture

    Is it possible for a window to prevent itself from being copied by a screen capture operation?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Not really.........You can do some nasty things like hooking APIs......but that's a nasty approach and hardly practical

    Better to solve the problem from the other end.....Why is the data so in need of protection?
    Can I stop certain people veiwing it?

  3. #3
    Davros
    Guest
    Hey, thanks for the reply.

    My thinking is - does a window receive a specific message requesting it to draw itself on a clipboard canvas? If this is the case, I can make the window intercept the message and draw a black square instead. Or are things done at a lower level? In this case, you are right - things would be difficult & nasty.

    > Can I stop certain people veiwing it?

    Unfortunately, this would make my application pointless.

  4. #4
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    You could always try making your program black it's window fr a few ms when the print screen key is pressed.

    This seems like a strange operation, a program to be veiwable but not printscreenable. You might get a few better suggestions if you tell us your problem, rather then beating a solution out of thin air.

  5. #5
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    Whenever someone tries using the printscreen key, just have it restart the computer.

  6. #6
    Registered User Liam Battle's Avatar
    Join Date
    Jan 2002
    Posts
    114
    haha i like the last guys suggestion,
    he is right just make it reboot...
    the guy wont do it again
    LB0: * Life once school is done
    LB1: N <- WakeUp;
    LB2: N <- C++_Code;
    LB3: N >= Tired : N <- Sleep;
    LB4: JMP*-3;

  7. #7
    Davros
    Guest
    > Whenever someone tries using the printscreen key, just have it restart the computer

    That's a bit harsh for my purposes. I want to write software, not crashware. Besides, it's not a crime to press the Print Screen key (well not yet anyway).

    If anyone out there knows how I implement this robustly, let me know. Thanks for the replies in anycase.

  8. #8
    Registered User
    Join Date
    Dec 2001
    Posts
    8
    You could just try overridding the OnPrintScreen() or OnPreparePrinting() function in the Message_Map(), that is if you are using MFC, and put your code inside one of these functions.

  9. #9
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    Freeware versions of Alienskin plugins for Photoshop prevent you from printscreening (so you can't actually apply the effects). It just gives you a preview of what your image would look like if the effects were applied.

    Every 5 or so seconds it clears the clipboard, therefore, if you press printscreen, itt'l be cleared before anyone can use it. I know this because I opened up another program (paint) and quickly pasted it. This, I think is a very good method and will stop most people.

  10. #10
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    Intercept the VK_SNAPSHOT message and return if you get it.

    /*EDIT*/ A different program can still do it though. /*EDIT*/

  11. #11
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,267
    in truth there is always a way to capture the screen, no stopping it! you can kill print screen, but not screen capturing.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  12. #12
    Davros
    Guest
    > Intercept the VK_SNAPSHOT message

    Cheers. I'll give this a try.

  13. #13
    Registered User
    Join Date
    May 2002
    Posts
    132
    Its true, there is no TRUE way to stop screen capturing. There are programs out there that take exact copies of the screen output from your video card's memory and then turns it into a bitmap or some such graphics format so you can view it at will.

    My suggestion would be to implement all possible solutions to try and stop screen capturing but there are still other ways. As for the VK_SNAPSHOT message, not sure if this will work. But if it does, it will most likely just stop you from pressing the Print Screen button. Another solution is to, as suggested above, every so many seconds clear the clipboard because some screen capture software may use the clipboard as a "middle ground" between capturing and saving. I don't see the point in doing that, but hey! You never know what kind of coding you'll find out there. Another method will be to use some what like a keylogger code to find if the Print Screen key has been pressed. But you'll have to do more then just use keylogger code. You'll need more of a keyboard intercept code. This will allow you to intercept keys, allow those through that your not stopping, and kill those that you want to stop. This way you will guarantee that the Print Screen key could not be pressed, and to make sure that it cannot do its job. Another method... find out all the class names of as many screen capture programs out there. Once you know these, have your program check every five seconds for these programs being active. When they are, kill them immediately. This wont guarantee anything because I'm sure new programs for screen capturing come out almost every day and so you'll have to try and keep a "to date" list of them all. That would probably be the biggest project out of all of them. And most involved.

    But good luck to you! If I come up with any more ideas, I'll let you know!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Block/Prevent Screen Capture
    By chaitanya619 in forum C++ Programming
    Replies: 3
    Last Post: 04-16-2008, 11:41 AM
  2. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 03:56 PM
  3. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 09:18 PM
  4. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  5. Screen capture problem....my code!(PLEASE READ!)
    By SyntaxBubble in forum Windows Programming
    Replies: 0
    Last Post: 05-02-2002, 05:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21