function getscreenpoint(sender: Tcontrol): Tpoint;
var
clientpoint:Tpoint;
begin
clientpoint:=point(0,sender.Height);
while sender.Parent<>nil do
begin
clientpoint:=point(sender.Left+clientpoint.X,sender.Top+clientpoint.Y);
sender:=sender.Parent;
end;
clientpoint:=sender.ClientToScreen(clientpoint);
Result:=clientpoint;
end;
var
clientpoint:Tpoint;
begin
clientpoint:=point(0,sender.Height);
while sender.Parent<>nil do
begin
clientpoint:=point(sender.Left+clientpoint.X,sender.Top+clientpoint.Y);
sender:=sender.Parent;
end;
clientpoint:=sender.ClientToScreen(clientpoint);
Result:=clientpoint;
end;