|
-
Feb 18th, 2001, 05:27 AM
#1
Thread Starter
PowerPoster
Is there any way to trap "Print Screen" and "Alt" Keys.
-
Feb 18th, 2001, 08:49 PM
#2
Not sure what you mean by "trapping" the alt and print screen keys. But here is how you can tell if they are pressed by using the GetAsyncKeyState API function.
Code:
Private Declare Function GetAsyncKeyState _
Lib "user32.dll" (ByVal vKey As Long) As Integer
Private Const VK_MENU = &H12 'either alt key
Private Const VK_SNAPSHOT = &H2C 'print screen
Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_MENU) Then
Msgbox "Alt key pressed"
ElseIf GetAsyncKeyState(VK_SNAPSHOT) Then
Msgbox "Print screen key pressed"
End If
End Sub
-
Feb 23rd, 2001, 10:01 PM
#3
Hyperactive Member
Thanks!! I was asked to add this as a feature to a program I am creating. The user wants to prevent people from capturing the screen of employees photographs displayed on an index.
-
Feb 24th, 2001, 10:32 AM
#4
GetAsyncKeyState will not prevent this from happening. If you want to prevent it, you'd need to create a systemwide hook.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|