Делай так:
#pas
function hook(code,w,l:integer):Lresult; stdcall;
var str:string;
ll:tagMSLLHOOKSTRUCT;
d: LongWord;
begin
ll := tagMSLLHOOKSTRUCT(pointer(l)^);
d := ll.mouseData shr 16;
if d and $8000 <> 0 then d := d or $FFFF0000;
str := Int2Str(w)+Int2Str(d);
_hi_OnEvent(hac.ev,str);
result := CallNextHookEx(H,code,w,l);
end;