Give you an very simple demo not using mouse hook, but can get your result.
var
P0: TPoint;
First: Boolean = True;
// Set Timer1.Interval := 50; or other value.
procedure TForm1.Timer1Timer(Sender: TObject);
var
P: TPoint;
DC: HDC;
begin
GetCursorPos(P);
DC := GetDC(0);
try
if (P0.X <> P.X) or (P0.Y <> P.Y) then
begin
if not First then
begin
DrawFocusRect(DC, Bounds(P0.X, P0.Y, 48, 48));
end
else First := False;
DrawFocusRect(DC, Bounds(P.X, P.Y, 48, 48));
P0 := P;
end;
finally
ReleaseDC(0, DC);
end;
end;