For some reason GetWindowInfo is not in Windows unit, I feel lazy so I replaced Windows unit with JwaWinUser and JwaWinType units:
uses
JwaWinUser, JwaWinType{, Windows};
procedure TForm1.Timer1Timer(Sender: TObject);
var
Coordinates: TSmallPoint;
aPt: POINT;
aWnd: HWND;
aRect: TRect;
aInfo: TWindowInfo;
begin
aPt.x := 124; //<--- provide the correct values
aPt.y := 214;
aWnd := WindowFromPoint(aPt);
GetWindowInfo(aWnd, aInfo);
Coordinates.X := aPt.x - aInfo.rcClient.Left;
Coordinates.Y := aPt.y - aInfo.rcClient.Top;
SendMessage(aWnd, WM_LBUTTONDOWN, 0, LParam(Coordinates));
SendMessage(aWnd, WM_LBUTTONUP, 0, LParam(Coordinates));
end;
I tried it on FireFox and it worked.