假設一component是button1;
procedure Tform1.mousemove(sender:tobject;shift:tshiftstate;x,y:integer);
with button1 do
if x>left and x<(left+width) and y>top and y<(top+height) then do (what you want)
............
var
location :tpoint;
produce form.formmousemove(...)
begin
win32check(GetCursorPos(location));
if location.x = ... and location.y = ... then
begin
...
...
end;
end;