object Form1: TForm1 

   Left = 192 

   Top = 115 

   Width = 696 

   Height = 479 

   Caption = 'Form1' 

   Color = clBtnFace 

   Font.Charset = DEFAULT_CHARSET 

   Font.Color = clWindowText 

   Font.Height = -11 

   Font.Name = 'MS Sans Serif' 

   Font.Style = [] 

   OldCreateOrder = False 

   PixelsPerInch = 96 

   TextHeight = 13 

   object Button1: TButton 

     Left = 280 

     Top = 248 

     Width = 73 

     Height = 41 

     Caption = 'Button1' 

     TabOrder = 0 

     OnClick = Button1Click 

   end 

   object WebBrowser1: TWebBrowser 

     Left = 384 

     Top = 64 

     Width = 593 

     Height = 201 

     TabOrder = 1 

     ControlData = { 

       4C0000004A3D0000C61400000000000000000000000000000000000000000000 

       000000004C000000000000000000000001000000E0D057007335CF11AE690800 

       2B2E126208000000000000004C0000000114020000000000C000000000000046 

       8000000000000000000000000000000000000000000000000000000000000000 

       00000000000000000100000000000000000000000000000000000000} 

   end 

   object Button2: TButton 

     Left = 264 

     Top = 312 

     Width = 137 

     Height = 33 

     Caption = 'Button2' 

     TabOrder = 2 

     OnMouseDown = Button2MouseDown 

     OnMouseUp = Button2MouseUp 

   end 
end


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, OleCtrls, SHDocVw;

type
  TForm1 = class(TForm)
    Button1: TButton;
    WebBrowser1: TWebBrowser;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure Button2MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
    x,y:integer;
begin
x:=form1.Left+webbrowser1.Left+570;
y:=form1.Top+webbrowser1.Top+210;
SetCursorPos(x,y);
Mouse_Event(MOUSEEVENTF_LEFTDOWN,X,Y,0,0);
Mouse_Event(MOUSEEVENTF_LEFTUP,X,Y,0,0);
end;

procedure TForm1.Button2MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
PostMessage(Button2.Handle,WM_LBUTTONDOWN,0,(y shl 16)+x);
end;

procedure TForm1.Button2MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
PostMessage(Button2.Handle,WM_LBUTTONUP,0,(y shl 16)+x);
end;

end.