Add lazmouseandkeyinput to the required packages, then:

uses MouseAndKeyInput;

procedure TForm1.Button1Click(Sender: TObject);
begin
  MouseInput.Move([], 200, 75);
  MouseInput.Click(mbLeft,[], 200, 75);
end;

On Wed, Oct 26, 2016 at 6:40 PM, Larry Dalton via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> I am running Lazarus 1.6 on Windows 7. I have one application where I need
> to move the mouse to a certain point on the screen and then do a mouseclick
> from the program.
>
> When I run the following procedure,
>
> procedure TMain_Form.Button1Click(Sender: TObject);
> var MousePos:Tpoint;
> MyMouse:TMouseInput;
> begin
> MyMouse:=TMouseInput.Create;
> MousePos:=Mouse.CursorPos;
> MousePos.x:=200;
> MousePos.y:=75;
> Mouse.CursorPos:=MousePos;
> MyMouse.Click(mbLeft,[]);
> MyMouse.Destroy;
>
> end;
>
> I get the following error code : Abstract Method Called. Click OK to
> ignore and risk data corruption or Cancel to kill the program.
>
> I know the problem is in the MyMouse.Click procedure. How do I make this
> work?
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus@lists.lazarus-ide.org
> http://lists.lazarus-ide.org/listinfo/lazarus
>
>
-- 
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to