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 Chris Miller 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....??
 
hi castor
are you think in the posibility of NOT display the signature en preview mode, but when select PRINT the report then print the signature file???

i hope it works

Jorge
 
Hi,
Not sure whether this is any help.
You might want to check up the article on steganograpy in
Foxite.com.
Using this you can scramble the signature bitmap.
Provide the users a button to copy it to the clipboard. You can code in the button to unscramble and fix the bitmap.
This way, the signature is not original unless the user goes through the button code.

Cheers,
Rajesh
 
steveb7

Just had the chance to try out what you suggested and unfortunately its not working.

This is what I've done

Placed a timer on the form
In the timer.interval I've set this to 30000 (5 minutes)
In the timer.event - _CLIPTEXT="You can not do this"

I've also placed the following in the load procedure of the form as suggested by Mike Mgagnon:

ON KEY LABEL CTRL+V *
ON KEY LABEL CTRL+C *
ON KEY LABEL CTRL+X *

This has still not stopped the print screen button from being used, a word document being opened and the CTRL+V being used to paste the image

Have I missed something here?

Look forward to any replies
Lee (KB)

Alone we can do so little, together we can do so much
 
Hi keepingbusy,

Here is one workaround. This code doesn't prevent other application from using PrintScreen key or Capture the screen

--------------------
** Declare DLLs
Declare Short GetKeyState in User32 Integer KeyCode
Declare Long OpenClipboard in User32 Long nhWnd
Declare Long CloseClipboard in User32
Declare Long EmptyClipboard in User32


** Timer event, set interval between 40 - 60
#Define VK_SNAPSHOT 0x02C
If (GetKeyState(VK_SNAPSHOT) < 0)
If (OpenClipboard(0) != 0)
EmptyClipboard()
CloseClipboard()
endif
endif
---------------------

Hope it helps a little

-- AirCon --
 
keepingbusy

if the timer only fires every 5 min you have that much time to copy/paste, it is the _CLIPTEXT= that clears the clipboard if it is cleared at 5 min intervals you have alot of time to capture

I messed around with several other methods to do this and am going to try the AirCon method it looks promising!

Steve Bowman
steve.bowman@ultraex.com

 
Hi aircon

Thank you for that, I'll give it a try in the next few days.

Hi steveb7

Yes, my mistake, I read it the other way around and that was the longer you set, the longer the Print Screen would be inactive! Now it makes sense, but like you, I'm going to give aircon's code a shot and see how it goes (But thanks again for your time)

Kindest regards to all
Lee

Alone we can do so little, together we can do so much
 
I am not sure if this helps for sure, but worth a try...

1. Whenever the form gets out of focus, it should be destroed. Call the ThisForm.Relese in the deactive event.
This is to avoid using another application to interface and capture signature.

2. When the Signature is shown... in that control and just before it is showm..
cFile = SYS(3)+&quot;.txt&quot;
SET PRINTER TO (cFile)
ON KEY LABEL CTRL+C *
ON KEY LABEL CTRL+X *

Then show the signature. When it is over and gets out of focus..
SET PRINTER TO whatever..
ERASE FILE (cFile)
ON KEY LABEL CTRL+C
ON KEY LABEL CTRL+X

The concept is that you redirect the printer ports.

3. If (2) does not work, (I am not sure if Printscreen obeys VFP commands), then still, the concept is the same. The windows default printer can be redirected to some unknown printfile and then set back, when the operation is over.

:)


____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
just a thought:

you could also on the form diaplaying the signature image
start with the

imageControl.visable=.f.
imageControl.MouseEnter EVENT this.visable=.t.
During this MouseEnterEvent you would start the
timer clearing the _CLIPTEXT
imageControl.MouseExit EVENT this.visable=.f.
During this MouseExitEvent you would stop the
timer clearing the _CLIPTEXT


This would reduce the load on the system running the timer fulltime.


Steve Bowman
steve.bowman@ultraex.com

 
Our problem has been solved by doing the following:

Placed a timer on the form
In the timer.interval I've set this to 5 (Milliseconds)
In the timer.event - _CLIPTEXT=&quot;A Copyright Message etc&quot;

I also placed the following in the load procedure of the form as suggested by Mike Mgagnon:

ON KEY LABEL CTRL+V *
ON KEY LABEL CTRL+C *
ON KEY LABEL CTRL+X *

Placed the following the destroy procedure

ON KEY LABEL CTRL+V
ON KEY LABEL CTRL+C
ON KEY LABEL CTRL+X

If you have another app open such as word, when you ALT & TAB into it and try and paste, you only get the copyright message.

This is perfect as there is no reason for someone to have any other app open when using our VisFox app so I hope this helps anyone who has a similar problem (or ex problem) to ours!

Lee

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