Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

capturing keypresses without a text box

Status
Not open for further replies.

SykoStokkrTim

Programmer
Jul 19, 2002
20
US
I'm working on a keylogger, and I figured VB6 would do the job. Is there any way to get the last key pressed into a variable?
 
yeah if you don't want a textbox just use the forms keydown or keypress event and you can capture the keys they press
----------------
Joe
 
Option Explicit

dim Char as string

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Char=chr(KeyCode)
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
Char=chr(KeyAscii)

End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Char=chr(KeyCode)
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top