Solved

Disable Print/Screen etc.

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month6 days, 18 hours left to enroll

623 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