Neither works, not at least in the desired way
Procedure tform1.hacerclick(xpunto,ypunto: integer);
var
Coordinates: TSmallPoint;
aPt: POINT;
aWnd: HWND;
aRect: TRect;
begin
aPt.x := 124; //<--- provide the correct values
aPt.y := 214;
aWnd := WindowFromPoint(aPt);
GetWindowRect(aWnd, aRect);
Coordinates.X := (aRect.Left+aRect.Right) div 2;
Coordinates.Y := (aRect.Top+aRect.Bottom) div 2;
SendMessage(aWnd, WM_LBUTTONDOWN, 0, LParam(Coordinates));
SendMessage(aWnd, WM_LBUTTONUP, 0, LParam(Coordinates));
end;
if at selected point there is a banner in a web page, the navigator window brings to font, but nothing else (the link do not open at all) and even sometimes it have an unpredictable result (produces the same effect that a click over the windows desktop, even if there is a window there)
Looks like moving the cursor there is the only way.