es gibt keine ausgabe im debugger und keine fehlermeldung !
ich habe inzwischen ein wenig rumgeschraubt und folgendes ist mir völlig unklar :
Code: Alles auswählen
Global hWindow,hook
Structure KBDLLHOOKSTRUCT
vkCode.l
scanCode.l
flags.l
time.l
dwExtraInfo.l
EndStructure
Procedure.l myKeyboardHook(nCode, wParam, *p.KBDLLHOOKSTRUCT)
If nCode = #HC_ACTION
If wParam = #WM_KEYDOWN Or wParam = #WM_SYSKEYDOWN Or wParam = #WM_KEYUP Or wParam = #WM_SYSKEYUP
#LLKHF_ALTDOWN = $20
If *p\vkCode => #VK_A And *p\vkCode <= #VK_Z
If *p\vkCode = #VK_A
Debug "A"
ElseIf *p\vkCode = #VK_B
Debug "B"
ElseIf *p\vkCode = #VK_C
Debug "C"
EndIf
ProcedureReturn 1
EndIf
EndIf
EndIf
ProcedureReturn CallNextHookEx_(0, nCode, wParam, *p)
EndProcedure
Procedure AskForExit()
If MessageRequester("EXIT", "End the KeyboardHook ??",#MB_YESNO) = #IDYES
UnhookWindowsHookEx_(hook) : End
EndIf
EndProcedure
#WH_KEYBOARD_LL = 13
hook = SetWindowsHookEx_(#WH_KEYBOARD_LL,@myKeyboardHook(),GetModuleHandle_(0),0)
If hook = 0: End: EndIf
hWindow = OpenWindow(1,0,0,10,10,"k8D h00K",#PB_Window_Invisible)
Repeat
WaitWindowEvent()
Delay(5)
ForEver
hier noch der veränderte code :
Code: Alles auswählen
#WH_KEYBOARD_LL = 13
hook = SetWindowsHookEx_(#WH_KEYBOARD_LL,@myKeyboardHook(),GetModuleHandle_(0),0)
If hook = 0: End: EndIf
Repeat
Delay(5)
ForEver
