Valhalla Legends Archive

Programming => General Programming => Topic started by: haZe on February 19, 2003, 02:07 PM

Title: Simple VB Keylogger
Post by: haZe on February 19, 2003, 02:07 PM
How would I write a simple VB keylogger? I was thinking maybe on text1_keypress..but I can't figure out how to send all the keys pressed to my program. A little help please?
Title: Re: Simple VB Keylogger
Post by: Banana fanna fo fanna on February 19, 2003, 03:16 PM
Have fun hooking the windows API in VB.

Not too hard to do from C...I've done it a million times.
Title: Re: Simple VB Keylogger
Post by: haZe on February 19, 2003, 03:54 PM
..? explain deeper please
Title: Re: Simple VB Keylogger
Post by: iago on February 19, 2003, 05:07 PM
you have to use a system hook, look up SetHookEx or SetWindowsHookEx or something like that
Title: Re: Simple VB Keylogger
Post by: haZe on February 20, 2003, 01:08 AM
OK I got it

Public Declare Function SetWindowsHook Lib "user32" Alias "SetWindowsHookA" (ByVal nFilterType As Long, ByVal pfnFilterProc As Long) As Long
Now...How would I use that =/
Title: Re: Simple VB Keylogger
Post by: Skywing on February 20, 2003, 07:59 AM
QuoteOK I got it

Public Declare Function SetWindowsHook Lib "user32" Alias "SetWindowsHookA" (ByVal nFilterType As Long, ByVal pfnFilterProc As Long) As Long
Now...How would I use that =/
I'd suggest you look it up on MSDN Online (http://msdn.microsoft.com/library/default.asp).
Title: Re: Simple VB Keylogger
Post by: Etheran on February 21, 2003, 11:50 AM
Or the win32 help file will explain everything (there's a whole section in there about hooks).
Title: Re: Simple VB Keylogger
Post by: haZe on February 22, 2003, 01:43 AM
Nevermind, I found a very nice example on pscode.com, but thx ne ways
Title: Re: Simple VB Keylogger
Post by: n00blar on February 22, 2003, 05:48 AM
Hmm i noticed a nice little api function called 'GetAsyncKeyState' and i have code to make it work just as good if not better than a hook. you may also try a few of these other API functions (search msdn)

GetKeyboardState, SetKeyboardState
GetKeyState
Title: Re: Simple VB Keylogger
Post by: haZe on February 22, 2003, 06:10 AM
ya thats what the thing on pscodE used.