|Products Purchase Publishing Articles Support Company Contact|
support > Product FAQ > SpyWorks > Hooks
Event Log Toolkit
NT Service Toolkit
Frequently Asked Questions - Hooks
1. I cannot trap certain Windows messages using the SpyWorks windows hook control.
Change the HookType property to something else. Depending on the message, one of the other HookType values should work. Refer to the hook control's HookType property in the help file or manual for a description of each type. Different hook types are designed to intercept different types of messages at different times. If you are detecting mouse messages, use the MouseProc HookType, otherwise, try the GetMessage HookType first, if GetMessage does not work, try the CallWndProc HookType.
2. Whenever I press a key, the event is fired twice. (COM)
If the hook control's KeyboardEvent is set to 1, you are using the KbdHook event in which case it will be triggered when the key is pressed and when it is released. In the KbdHook event, check the keystate parameter to see what state the key is in, or set the KeyboardEvent property to 0 and work with the KeyDownHook and KeyUpHook events instead.
3. I am using the keyboard hook. I no longer get events or the shift state is switched if the Caps Lock key is down.
The Caps Lock key toggles the shift state of alpha keys being pressed. You can use the keyboard hook's KeyIgnoreCapsLock property (IgnoreCapLocks property in .NET) to ignore the Caps Lock key altogether. You need to detect the keys with and without a shift in the Select Keys dialog box. When you get the hook event, you can detect the state of the Caps Lock key with the GetKeyboardState API call.
|Products Purchase Articles Support Company Contact