Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Disable Print/Screen etc.

Posted on 1997-04-28
5
Medium Priority
?
308 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 180 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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

886 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