var NextHook:HHOOK; MessageHook:HHook; ShareData:PShareMem; HMapFilehandle: THandle;
function InstallMouseHook(Sender:HWND;MessageID:DWORD;x,y,width,height:integer):Boolean ;stdcall; function UnInstallMouseHook:Boolean ;stdcall; Function PauseMouseHook:boolean;stdcall; Function StartMouseHook:Boolean;stdcall; function CreateShareMemory:Boolean;stdcall; Procedure DestroySharememory;stdcall; Procedure EntryPointProc(dwReason:DWORD);
implementation
Procedure EntryPointProc(dwReason:DWORD); begin case dwReason of DLL_PROCESS_ATTACH:CreateShareMemory; DLL_PROCESS_DETACH:DestroySharememory; end; end;
function MouseHookCallBack(Code: integer; Msg: WPARAM; MouseHook: LPARAM): LRESULT; stdcall; export; begin Result := 0; if Code<0 then Result := CallNextHookEx(NextHook,Code,Msg,MouseHook); if ShareData^.PauseFlage then exit; case Msg of WM_LBUTTONDOWN: begin
end; WM_LBUTTONUP : begin
end; WM_LBUTTONDBLCLK: begin
end; WM_RBUTTONDOWN: begin
end; WM_MOUSEMOVE,WM_NCMOUSEMOVE: begin //if PMouseHookStruct(MouseHook)^.pt.X>800 then //SetCursorPos(800,PMouseHookStruct(MouseHook)^.pt.y); if ShareData=nil then begin Result := CallNextHookEx(NextHook,Code,Msg,MouseHook); exit; end; ShareData^.Data2 := PMouseHookStruct(MouseHook)^; SendMessage(ShareData^.Hwnd,Sharedata^.MessageID,Msg,Integer(@ShareData^.Data2)); end;