so ich befor alle denken ich will nen keylogger machen sage ich schonmal vorweg ich will nicht überprüfen welche taste gedrückt wurde...
ich habe volgendes schon ausprobirt...
1.
WaitAnyKey()
Func WaitAnyKey()
While 1
For $i = 0 To 255
If _IsPressed(Hex($i,2)) Then
MsgBox(0,"Test","Taste " & Hex($i,2) & " gedrückt!")
; ConsoleWrite("Taste " & Hex($i,2) & " gedrückt!" & @CRLF)
ExitLoop 2
EndIf
Next
Sleep(50)
hat funkrtionirt aber macht eine zu große cpu auslastung und die zeit höher stellen will ich auch nicht...
2.
ToolTip("Drücke irgendeine Taste")
$pKeyPress = DllCallbackRegister("_KeyPress", "lparam", "int;wparam;lparam")
$hMod = DllCall("kernel32.dll", "ptr", "GetModuleHandle", "ptr", 0x00)
$hKeyboardLL = DllCall("user32.dll", "ptr", "SetWindowsHookEx", "int", 0x0D, "ptr", DllCallbackGetPtr($pKeyPress), "ptr", $hMod[0], "dword", 0)
While Not $KeyPressed
Sleep(100)
WEnd
ToolTip("")
MsgBox(0, "", "Danke :)")
;Wenn eine Taste gedürckt wurde und
Func _KeyPress($iCode, $wParam, $lParam)
If $iCode = 0 Then $KeyPressed = True
Return _NextHook($hKeyboardLL[0], $iCode, $wParam, $lParam)
EndFunc ;==>_KeyPress
Func _NextHook($hKLL, $iCode, $wParam, $lParam)
Local $aRet = DllCall("user32.dll", "lparam", "CallNextHookEx", "ptr", $hKLL, "int", $iCode, "wparam", $wParam, "lparam", $lParam)
Return $aRet[0]
EndFunc ;==>_NextHook
hat ebenfals funktionirt und die cpu asulastung war sehr wenig aber wen man das an hat und irgentwas schnell schreibt kommen die buchstaben verzögert...
habt ihr irgent eine idea was man machen könnte?
mfg holy