DLL and components are written in a modular fashion so it is very easy
to add support for another hook type.
TGpSysHook is written for Delphi 5. It should compile with Delphi 6.
Components only should compile with previous Delphi versions, too. Just
don't try to compile the DLL in any Delphi prior to version 5. It just
Released under the BSD
- (optional) Compile the GpSysHookDLL.dpr to get the system hook DLL.
You can also use the precompiled DLL from the archive below.
- Rename this DLL. Use a name specific to the project you are working
on so that you wan't cause any name-clash. GpSysHookDLL can peacefully
coexist with another GpSysHookDLL as long as they don't have the same
- Compile and install the components (GpSysHookPkg_D5.dpk).
- Drop the hook component onto a form.
- Set the HookDLL propert of the component to pointo to the renamed
DLL. You can use the full path or file name only (in that case, Windows
will look for the DLL in the common locations).
- Set the event handlers of the component.
- In the code, call <component>.Start to enable the hook and <component>.Stop
to disable the hook.
- Examine the demonstration program (included in the archive below)
to discover other features.
- Bug fixed: parameters for some event handlers in the demo program
were incorrectly defined as cardinal instead of longint.
- Bug fixed: parameters for some events were incorrectly defined as
DWORD instead of longint.