Solved

Disable Print/Screen etc.

Posted on 1997-04-28
5
290 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now