J'aimerais faire ça sans devoir passer par une DLL externe (est-ce que c'est possible ?).
Le code que j'ai actuellement me fait planter le notepad.
Code : Tout sélectionner
#include <WinAPI.au3>
#include <WindowsConstants.au3>
Global $hKeyProc = DllCallbackRegister("KeyProc", "long", "int;wparam;lparam")
Global $hMod = _WinAPI_GetModuleHandle(0)
Global $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD, DllCallbackGetPtr($hKeyProc), $hMod, 1540)
While 1
Sleep(10)
WEnd
Func KeyProc($nCode, $wParam, $lParam)
MsgBox(0, "", $nCode)
Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
EndFunc ;==>KeyProc
Func OnAutoItExit()
_WinAPI_UnhookWindowsHookEx($hHook)
DllCallbackFree($hKeyProc)
EndFunc ;==>OnAutoItExit


