PDA

Click to See Complete Forum and Search --> : how can i make a keylogger


Darkangel
Feb 14th, 2001, 10:22 PM
hey i can make my proggy listen t o anykey stroke on windows bu t i need my msgbox to show upon others i mean on top of all others

need help

Bios
Feb 15th, 2001, 02:19 PM
don't use a message box use a form with a label, and use topmostwindow api to make it on top, or use find window using the message box title, and find the message box, and use topmostwindow api to make it on top of the other windows.

PS vb key loggers suck they can't keep up with my typing...if your subclassing the keyboard please let me know and tell me how. Most people just use a timer or a loop with get keystate


well either way...

:D Hope this helped,

Lord Orwell
Feb 16th, 2001, 04:45 AM
getkeystate (muffled laughter)
calling the windows api once for each key? (sigh)
use the getkeyboardstate. It stores every key at once in an indexed array. Simply compare one capture to the next, and if different, then you can determine which key.
There have been so many posts asking about this, i will probably just write the routine and get it over with...

Alan777
Feb 17th, 2001, 06:15 AM
Yes Lord (muffled laughter), you should do that and enlighten us.

Here's another 2 cents worth for Bios.

Option Explicit

Private Declare Function CallWindowProc Lib "user32.dll" Alias "CallWindowProcA" ( _
ByVal lpPrevWndFunc As Long, _
ByVal hwnd As Long, _
ByVal Msg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long

Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" ( _
ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_WNDPROC = -4
Private Const WM_KEYDOWN = &H100
Private Const WM_KEYUP = &H101


Private hControl As Long
Private lPrevWndProc As Long
Private ArrPos As Long

Public KeyArray(10000) As Byte

'*************************************************************
'WindowProc
'*************************************************************
Private Function WindowProc(ByVal lWnd As Long, ByVal lMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long

Select Case lMsg

Case WM_KEYDOWN
KeyArray(ArrPos) = CByte(wParam)
ArrPos = ArrPos + 1

Case WM_KEYUP
'Code for 'key up' event

End Select

WindowProc = CallWindowProc(lPrevWndProc, lWnd, lMsg, wParam, lParam)

End Function
'***********************************************************


Public Sub Hook(ByVal hControl_ As Long)

hControl = hControl_
lPrevWndProc = SetWindowLong(hControl, GWL_WNDPROC, AddressOf WindowProc)

End Sub

Public Sub Unhook()

Call SetWindowLong(hControl, GWL_WNDPROC, lPrevWndProc)

End Sub

Lord Orwell
Feb 17th, 2001, 08:43 PM
(sniff) i wrote the subroutine last night, and was so tired when i was done, i clicked the cancel button instead of the ok button when i closed vb. (sob)
It kept up with my typing too. Oh well. If anyone knows of a built-in vb command (or api command) that will compare two arrays, please post it. P.S. Call me Orwell. Lord is my real name. (see profile)

Lethal
Feb 17th, 2001, 11:49 PM
There has been a keylogger prog written using subclassing, search for it, i believe it was written by Aaron Young.