Solved

Disable Print/Screen etc.

Posted on 1997-04-28
5
295 Views
Last Modified: 2008-03-10
Hi.

I want to make a program that disables Copy/Cut and Paste. And also disables Printing and the Print/screen button on the Keyboard.
Need to do this to be able to display Very Sensitive and secret Information.

I want to have Code Description how to make this possible.

Thanks

//Jim
0
Comment
Question by:JRK
5 Comments
 
LVL 7

Expert Comment

by:tward
ID: 1425758
On a KeyDown event you can check:

if keycode=vbkeyprint then
  keycode=0
endif

For the Clipboard thing I can imagine you could try to do a CLIPBOARD.CLEAR every time there is a keypress or mouse down event....  That is the only way I can find to clear the clipboard...  Doing in on key/mouse events should cover anytime they could cut/paste/copy.
0
 

Author Comment

by:JRK
ID: 1425759
Well, that is okey, but the purpose is to lock Copy/Cut/paste
and printing possibilities. (Print Screen also) for other programs.
Like Internet Explorer and Excel. This is for Intranet solutions.
To view Sensitive Data with other CS applications.

//Jim
0
 
LVL 1

Expert Comment

by:advapp
ID: 1425760
If this is for eliminating print screen capability for other apps -- not for VB programming -- doesn't the question really belongs in another section?
0
 
LVL 3

Accepted Solution

by:
ChrisLewis earned 90 total points
ID: 1425761
To eliminate Cut/copy/paste, try this:Set the form's KeyPreview = TRUEPrivate Sub Form_KeyPress(KeyAscii As Integer)
  Select Case KeyAscii
    Case 3, 22, 24  ' Disable ctrl-C, ctrl-V & ctrl-X
      Beep
      KeyAscii = 0
    Case Else
  End Select
End Sub
This will suck up the ^C, ^X, & ^V keystrokes.The first answer, Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyPrint Then ' Disable PrintScreen
      KeyCode = 0
  End If
End Sub
Doesn't work.  It should, but the PrintScreen key does not fire a KeyDown event!  Going to have to check the KB on this one, since I think it did in VB3!Chris
0
 

Author Comment

by:JRK
ID: 1425762
Well I wanted to stop copy/cut/paste/print possibilities withinWindows by creating a VB application that are launched everytimeuser launches that 'protected software'. I hoped doing this with Windows API's//Jim
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question