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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable Print Screen Key At Startup

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
Is it possible to Disable the print screen key when the my app starts and enable it back once it closes??

if so, can someone give me an example of how..

I have tryed by using
If KeyCode = 44 Or KeyCode = 106 then clear the clipboard but this does not work..

any help would be appreciated
thanks

 
There are many solutions out there. But, if your application ends abnormally, you may not be able to reverse your action on Print Screen.

Short of writing an assembler program to intercept system interupts - a mostly bad idea - disabling Print Screen consists of disabling the clipboard function. These are some of your options:

1. You can purchase a Clipboard control. here is one of many vendors:
This vendor implementation looks like this in .NET:
Code:
Private Sub GridControl1_ClipboardCanPaste(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCutPasteEventArgs) Handles GridControl1.ClipboardCanPaste
  e.Handled = True
  e.Result = False
End Sub

2. You can modify the registry - not a very good idea, but if you must - this way:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft
entry: Terminal Server Client
value: DisableClipRedirection

Why do you want to do this, pray tell?

Dimandja
 
My application is a laboratory based app. which has NO print function built for ceratin screens that customers etc.. should not see. well Customer service reps have been taking it upon themselfs to hit the print screen button, then go into Paint and paste the screen shot into paint. This Needs to STOP. There is a reason for not showing a printed copy of our laboratory data to Non-Company people.

I dont care if the app ends abnormally and the print screen button does not get active again..There has to be a way to do this in VB without buying a third party control.

 
dvannoy said:
There has to be a way to do this in VB without buying a third party control.
Of course! Try option 2, for example. All you need to do is write some code to edit the registry.

If it were mundane to do this, you would have easily found a quick VB solution by know, right? I am only trying to show you the options; you decide.

One thing you should know is that Print Screen was designed to be processed by the OS before it checks on your application. This is why your application can only react after the fact: (1) regularly clear the clipboard, or preempt the action: (2) disable the clipboard.

Dimandja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top