library
DynHelp;
uses
ShareMem,
SysUtils,
Classes,
StdCtrls,
AppEvnts,
ComCtrls,
Forms,
Windows,
Controls,
Messages;
var
CMemo: TCustomMemo;
HandleHook: HHOOK =
0
;
{$R *.res}
procedure
Hook(Code:
integer
; wParam:
integer
; lParam:
integer
); stdcall;
begin
CallNextHookEx(HandleHook, Code, wParam, lParam);
if
Code = HC_ACTION
then
if
TMSg(
Pointer
(lParam)^).message = WM_LBUTTONDOWN
then
if
(TMSg(
Pointer
(lParam)^).wParam
and
MK_CONTROL) = MK_CONTROL
then
begin
MessageBox(TMSg(
Pointer
(lParam)^).hwnd,
PChar
(IntToStr(lParam)),
'!!!'
, mb_iconhand);
end
;
end
;
procedure
DynHelpConnection(CustomMemo: TCustomMemo; ThreadID:
Cardinal
);
stdcall; export;
begin
if
(CustomMemo
.
ClassName =
'TMemo'
)
then
begin
CMemo := CustomMemo;
HandleHook := SetWindowsHookEx(WH_GETMESSAGE, @Hook, HInstance,
0
);
end
;
end
;
procedure
DynHelpDisconnection; stdcall; export;
begin
UnhookWindowsHookEx(HandleHook);
HandleHook :=
0
;
CMemo :=
nil
;
end
;
exports
DynHelpConnection,
DynHelpDisconnection;
begin
end
.