|Products Purchase Publishing Articles Support Company Contact|
support > Product FAQ > SpyWorks > General
Event Log Toolkit
NT Service Toolkit
Frequently Asked Questions - General
If you are using an older version of SpyWorks (older than 7.1) or issues relating to auto-update or upgrade of older versions of SpyWorks, visit our legacy FAQ page for additional suggestions.
1. I am using the subclass, windows hook or keyboard hook control. I am trying to get events while a VB Message Box is displayed, but it does not work. (COM only)
The Visual Basic MsgBox command disables all incoming events. To avoid this problem you can either create a modal form to use in place of a message box, or use the MessageBox API function. If you are using the ATL edition of these controls, you can also use the DirectInterface feature of these controls to be notified even when a VB MsgBox is displayed.
2. I am using the subclass, windows hook or keyboard hook control. Whenever the control gets a message or key and triggers the event, I have problems. There might be GPF's, crashes, or even a systemwide failure. Or the problem might be more subtle, such as getting the message only once even though I know it is being sent more often. It might work on a different computer. It might work some times and not other times.
The events in the subclass, windows hook and keyboard hook control are very time dependent. All these controls stop the normal Windows message proccessing when a message is received and do not let Windows continue until the event is done. If the code in the event takes too long, then the messages in Window's queue can back up until it overflows, causing unpredictable behavior.
This delay might be caused by such things as putting a breakpoint inside an event, putting up message boxes or other forms, calling DoEvents, or performing complex arithmetic. If you do not need to return a value after getting a message, or you do not need to delete the message or keystroke, then for the COM controls you can set the Type property to "Posted" for the subclass control or the Notify property to "1 - Posted" in the windows hook and keyboard hook. For .NET controls use asynchronous message processing.
Another way around this problem is to split the code in the event into two parts -- put the quick code that is involved with changing or deleting a message or keypress in the event as before. In .NET, set up an async operation for the rest of the task. In COM, move the time intensive code or the code that is causing the problem into the DelayedEvent event. Then set the PostEvent property to any integer value. Setting the PostEvent property will cause the DelayedEvent event to be triggered at some time after the message has been processed.
Run the NT Service Toolkit or SpyWorks Files Auto Update utility to download the latest Control Panel Applet Wizard (CPLWizardNET.exe) and the VS 2003 control panel applet template file (dwcplNet11.svt) to the same folder as your current Control Panel Applet Wizard. The new Control Panel Applet Wizard includes an option to compile the applet for either .NET VS 2002 or VS 2003.
|Products Purchase Articles Support Company Contact