Oct 6, 2004 #1 smayshar Programmer Aug 30, 2003 42 AU How do I create a keyboard hook that would reject the prnt scrn key??? thenks
Oct 6, 2004 #2 Zion7 IS-IT--Management May 2, 2003 1,276 CA This particular constant, doesn't work on my laptop, maybe a desktop? Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyPrint Then MsgBox "Yes" Else MsgBox "No" End Sub You must set the "KeyPreview" property of the form (in the Events tab), to yes. If vbKeyPrint doesn't work, try vbKeyShift, just to give you an idea of the potential. Setting the keycode to 0, disables the key press action, so the idea is something like... If KeyCode = vbKeyPrint Then KeyCode = 0 Hope this offers some direction. Good Luck either way! Upvote 0 Downvote
This particular constant, doesn't work on my laptop, maybe a desktop? Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyPrint Then MsgBox "Yes" Else MsgBox "No" End Sub You must set the "KeyPreview" property of the form (in the Events tab), to yes. If vbKeyPrint doesn't work, try vbKeyShift, just to give you an idea of the potential. Setting the keycode to 0, disables the key press action, so the idea is something like... If KeyCode = vbKeyPrint Then KeyCode = 0 Hope this offers some direction. Good Luck either way!