Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppressing PRINT SCREEN KEY 4

Status
Not open for further replies.

castor2003

Programmer
Jul 5, 2003
115
LC
I have an Application that displays Signature images. With PrtScreen the users can copy the client's signatures to Windows Clipboard which I want to stop. I tried catching a KEYPRESS method but the PrtScreen Keys return no value to KEYPRESS. I have searched everywhere and found no help. Could someone share with me....??
 
Well, I haven't got a solution for you...but I do have something you may want to think about. There are tons of screen capture programs and most of them allow the user to set up their own hotkeys to capture the screen, a window, an object, or whatever. So even if you succeed in stopping the Print Screen key your signatures will still not be secure. Better to look for a solution that will somehow make your signatures come up as blanks or scrambled when the screen is captured. I haven't the foggiest how you would go about that though.

Slighthaze = NULL
 
There is certainly no way of doing this in VFP directly. That particular key is never available in VFP - the OS controls it. I suppose there is an API call that allows you to hook into that keyboard event (that's obviously what the 3rd party apps must do), but I'm sure it would require a callback, and that's again not possible in native FoxPro. I'd expect you might be able to create a custom .FLL that might be able to do what you are requesting, but it's certainly beyond my capabilities.

Rick
 
not sure if this would help but the system var _CLIPTEXT is the clipboard, could you not timer _CLIPTEXT="" to empty the clipboard on a rapid interval during signature display

Steve Bowman
steve.bowman@ultraex.com

 
Thanks Guys. In light of what you share Slighhaze, I think that I will have to go the draconian way of blocking keyboard input for a few seconds so the user can view the signature and then unblock keyboard input with this API.


I will set a timer on the form to control the blocking and unblocking.


Castor.
 
Hmmm Steveb7

That can work I guess if I set the timer at an interval that makes it impossible to switch between screens. BUT can't a TSR capture it?

What do you think?

 
After reading about the blocking and unblocking keyboard input, (I would like to keep this trick up my sleeve). The information I read indicates that the block will supress keyboard events fired for current (Form) application but does not indicate that it will block the OS as in me having another capture program loaded and pressing hotkey for that. I did a quick test and though my form did not respond my capture did. After capture I could past my form image into anything, I did then set _CLIPTEXT="You can not do this" and sure enough that is what pasted. Interesting thread I will have to keep this in mind for my next signature application.

Steve Bowman
steve.bowman@ultraex.com

 
yea a TSR can, that is what I used (Corel Capture) but I can still empty the _CLIPTEXT and wipe the contents of the clipboard. The interval would have to be short but you could go short enough to make it very hard to paste before the empty.

Steve Bowman
steve.bowman@ultraex.com

 
Steve,

I like your idea of emptying _CLIPTEXT, but that wouldn't stop the user using a third-party screen capture utility. For example, Paintshop Pro doesn't capture the clipboard -- it copies the image to its own client area.

Mike


Mike Lewis
Edinburgh, Scotland
 
Another slant on this would be look into running processes for the most common capture programs and deny signature viewing if any of the process are present or just kill them if needed. I guess it all depends on the applications security risk. If this was used in a bank I would think you would want to use several methods to insure that a capture does not happen. If you are presenting data to the SCREEN I guess it is fair game for many to exploit

Steve Bowman
steve.bowman@ultraex.com

 
You should use the EmptyClipboard function when you receive the message of minimised window or closing.
Is more extreme and you can destroy all the possibilities to extract any information from your application. Also, you can empty the clippboard when you find that your window is not active anymore.
Is better than trying to block the input. I tried in app. After 5 moths the operator came to me and told me that he lost a whole day of work. My app blocked the input while an operation was executing. The OS gaved a message and stopped the app, waiting for a response. The app couldn't triger the unblocking process because it didn't finished the operation yet. Now you can imagine that after I restarted that computer the operator looked at me in a special way.
You could even verify the clipboard formats and delete only the pictures.
I shall look it further!
Regards

As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
 
STEVEB7 is right :-( The Blockit API is no good for my purpose. After I tried it, I hit the PRINT SCREEN key then I used CTRL+ALT+DEL; which it did not block, killed the VFP Session from the Task List. Opened my Photo Editor and there I was able to paste the image of the screen which was captured while the Block Keyboard input was in effect.

However, the clearing of the clipboard in quick successions worked. I will have to set it to the shortest intervals permitted by the TIMER in VFP with the hope that there is not a another program that can capture and store at a fast rate that does not require the use of a key input.

 
There is another draconian way: use Timer event to clean clipboard like this:

_CLIPTEXT = ' '

Sending any data to the Windows clipboard automatically removes its previous content.
 
Cleaning the clipboard doesn't solve the problem...even coupled with turning off the entire keyboard it will only keep those who are making a half-hearted attempt to copy the signatures out. For instance, I would just start a screen capture program that actively recorded the desktop and then bring up the screen containing the sensitive information. A Voila, I have an AVI or MPEG file with frame after frame in it of your signatures. Then I can cut-n-paste them at my leisure.

What needs to be concentrated on is some type of security device to keep the user from seeing anything except the signature(s) that him/her have rights to access. I would go with some sort of security login and tie certain signatures to that login, so when they go to pic one it will only bring up those they made.

Another idea, distort the images to the point where though they are still readible they could never be mistaken for the original signature image if they were copied. this could include multiple areas of distortion on each image so they would be next to impossible to undistort and also maybe a word like "VOID" or "SAMPLE" written across them so though they can still see them. This may be overkill, depends on how sensitive this data is. It may be enough to just bring up a low grade thumbnail of the signatures so that were they to be copied and then resized back to normal they would lose enough to make obvious for the copies they are.

If I think of anything else I'll let you know...I feel like I am out of ideas for now.


Slighthaze = NULL
 
We guys I must that you for your assistance here. In the final analysis I have decided to implement the following which is a pot pouri of ideas that you good people have given. I have realized that the openness and proliferation of technology sometimes presents challenges on that nature. I was leaning to using Windows screen hooking APIs but then again someone else can running a screen capture program that records a movie as SLIGHTHAZE mentioned. This is what I am going to do.

I will modify the quality of the image so it becomes clear that it is a copy while I the same time being indentifiable or recognizable.

Also, I will implement the _clipboard clearing routine to make life difficult for the not-too-savvy users.

Many thanks to all..
[cheers]
 
Hi all

Looking through the keyword search for an answer to disabling the print screen button and found this.

Steveb7: you posted - "After capture I could past my form image into anything, I did then set _CLIPTEXT="You can not do this" and sure enough that is what pasted."

Could you please explain where you put this code and what else do I need to do.

My problem is that I have a form with an edit field and whilst I am able to use a suggestion from Ramani about disabling CTRL+C etc this does not cure the problem of someone hitting that old print screen button when the form is displayed.

Look foward to any replies
Many thanks
Lee (KB)

Alone we can do so little, together we can do so much
 
Put a timer on the form and set the timer.interval= some value
then in the timer.timer (event)
_CLIPTEXT="You can not do this"

every time the timer fires based on interval the clipboard will be replaced with the message


Steve Bowman
steve.bowman@ultraex.com

 
Keepingbusy

That does not prevent a program running on your computer other than your own program to be storing the clipboard each time the Print Screen Key is pressed.

The solution lies in finding a way to prevent windows itself from recognizing the use of that key or key combination. I too have not found a way around it. If you do send me an email or post it for all to see.

------------------------------------->

"I have sought your assistance on this matter because I have exhausted all the help that I can find. You are free to direct me to other source of help"
 
OUCH! I'd hate to be the user of an application like that. So there I am running the application and decide to switch over to word for a moment, I copy some text and go to paste it and it says "You cannot do this".

I wish I had another alternative to offer. I have tried on many occasions (spare time allowing) to figure out a way to do a Global Keyboard Hook from within VFP, even used an external COM dll (freeware 3rd party) that should have allowed me instantiate a class and use an eventhandler to psuedo-hook the keyboard events, but VFP would crash every time. There just is no way to do this that I can find, and I haven't seen anyone else anywhere who has been able to do it. (For those that would point out the keypress event and the On Key Label commands please note that I said Global Keyboard Hook.)

I would think that the application for this would be more for pictures/images than for text...I mean the user could just sit down with pen and paper and copy the necessary information. I say this because of the reference to an Editbox in above post. Even with a picture the user could still get it if they were determined enough, I mean there are so many screen capture programs out there, and also other ways of reproducing images that are seen on the screen. There is really no reliable way to stop a user from taking a picture of the screen that I know of. However, the ability to do Global Keyboard Hooking from within VFP would be useful to the foxpro community in a general way, limitations excepted.

Slighthaze = NULL
[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
steveb7

Many thanks for that and what you've suggested is really what we're looking for. I take on board what slighthaze is saying but in our scenario, there is no need or in fact, a requirement for anyone to have any other app open such as MS Word. Our application is a "Questions and Answers" database that simply allows users to do as it says (Answer questions). We were able to stop the user CTRL+C and CTRL+V using code from Tek-Tips users but of course this didn't stop someone simply hitting the print screen button.

Trucode: Will do, if there is another way!

Thanks again to those who contributed (Thanks again to steveb7)

Lee (KB)

Alone we can do so little, together we can do so much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top