![]() |
Problem mit globalem Keyboard/Mouse-Hook
Ich hab mir nen Keyboard und Mouse-Hook zusammengebastelt, was auch funktioniert.
Jedoch funktioniert es nur solange meine Form den Fokus hat. Jetzt wollte ich das ganze somachen, dass es aber immer funktioniert. Dazu habe ich in der function installhook WH_KEYBOARD durch WH_KEYBOARD_LL ersetzt.
Delphi-Quellcode:
Es kommt zwar jetzt immer bei meiner Form was an, auch wenn sie minimiert ist z.B.
const
WH_KEYBOARD_LL = 13; WH_MOUSE_LL = 14; //...\\ function InstallHook(Hwnd: Cardinal): Boolean; stdcall; var mouseh, keybh: boolean; begin keybh := false; mouseh := false; case Mouse_HookHandle of 0: begin Mouse_HookHandle := SetWindowsHookEx(WH_Mouse_LL, @MouseHookProc, HInstance, 0); mouseh := true; end; end; case Keyboard_HookHandle of 0: begin Keyboard_HookHandle := SetWindowsHookEx(WH_KEYBOARD_LL, @KeyboardHookProc, HInstance, 0); keybh := true; end; end; WindowHandle := Hwnd; Result := keybh and mouseh; end; Jedoch kommt immer das selbe an, egal welche taste ich drücke. lParam: 1244868 wParam(keydown):256 wParam(keyup):257 Habe ich irgendwas vergessen, was man noch ändern muss um nen hook global hinzubekommen??? mfg 1ceman |
Re: Problem mit globalem Keyboard/Mouse-Hook
hast du dir das Tutorial schonmal durchgelesen?
![]() Ich nicht, kann dir folglich auch nicht sagen, ob dein Problem dort geklärt wird, aber ich nehme es an :wink: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:26 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz