Hey,
I was wondering if WH_Keyboard_LL worked under windows 98, and if it doesn't, then why not? What other way (without using timers) can I make a decent key logger?
Printable View
Hey,
I was wondering if WH_Keyboard_LL worked under windows 98, and if it doesn't, then why not? What other way (without using timers) can I make a decent key logger?
From MSDN:
You may try using keybd_event api function instead.Quote:
Minimum operating systems Windows NT 4.0 SP3
Here is a quick sample from allapi.com:
VB Code:
Const VK_H = 72 Const VK_E = 69 Const VK_L = 76 Const VK_O = 79 Const KEYEVENTF_EXTENDEDKEY = &H1 Const KEYEVENTF_KEYUP = &H2 Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Private Sub Form_KeyPress(KeyAscii As Integer) 'Print the key on the form Me.Print Chr$(KeyAscii); End Sub Private Sub Form_Paint() 'KPD-Team 2000 'URL: [url]http://www.allapi.net/[/url] 'E-Mail: [email][email protected][/email] 'Clear the form Me.Cls keybd_event VK_H, 0, 0, 0 ' press H keybd_event VK_H, 0, KEYEVENTF_KEYUP, 0 ' release H keybd_event VK_E, 0, 0, 0 ' press E keybd_event VK_E, 0, KEYEVENTF_KEYUP, 0 ' release E keybd_event VK_L, 0, 0, 0 ' press L keybd_event VK_L, 0, KEYEVENTF_KEYUP, 0 ' release L keybd_event VK_L, 0, 0, 0 ' press L keybd_event VK_L, 0, KEYEVENTF_KEYUP, 0 ' release L keybd_event VK_O, 0, 0, 0 ' press O keybd_event VK_O, 0, KEYEVENTF_KEYUP, 0 ' release O End Sub
I want to listen for keyboard events, not simulate them.
There is code for this in Api Guide (www.allapi.net)
where? You can't search the site, so trying to find something like this is like trying to find a needle in a haystack.
the easiest way to make a keylogger is by using GetAsyncKeyState function :) good luck!
wow, thanx guys. Awesome code. I'll see what I can use. The API timer seems more promising than the VB timer :P.
Just a quick note to rhino bull, hooking doesn't seem to work because wh_keyboard only hooks input towards your application :S. wh_keyboard_LL is system wide, but only works in NT/2000/XP. That was my original dilema. thanx though, greatly appreciated!
Just making sure that you know that your efforts haven't gone forgotten!