Solved

Disable Print/Screen etc.

Posted on 1997-04-28
5
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

752 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