home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 March
/
Chip_1998-03_cd.bin
/
zkuste
/
delphi
/
ruzkomp
/
WINHOOK.ZIP
/
Hookunit.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-05-19
|
1KB
|
45 lines
{ This is a simple DLL import unit to give us access to the functions in }
{ the HOOKDLL.PAS file. This is the unit your project will use. }
unit Hookunit;
interface
uses WinTypes;
function InstallSystemHook: boolean;
function InstallTaskHook: boolean;
function RemoveHook: boolean;
function IsHookSet: boolean;
{ Do not use InstallHook directly. Use InstallSystemHook or InstallTaskHook. }
function InstallHook(SystemHook: boolean; TaskHandle: THandle): boolean;
implementation
uses WinProcs;
const
HOOK_DLL = 'HOOKDLL.DLL';
function InstallHook(SystemHook: boolean; TaskHandle: THandle): boolean; external HOOK_DLL;
function RemoveHook: boolean; external HOOK_DLL;
function IsHookSet: boolean; external HOOK_DLL;
function InstallSystemHook: boolean;
begin
InstallHook(TRUE, 0);
end;
function InstallTaskHook: boolean;
begin
InstallHook(FALSE,
{$IFDEF WIN32}
GetCurrentThreadID
{$ELSE}
GetCurrentTask
{$ENDIF}
);
end;
end.