[Lazarus] TMouseinput mouse click.

Larry Dalton larrydalton71 at gmail.com
Thu Oct 27 16:35:24 CEST 2016


Worked great! Thanks!

Sent from my iPhone

> On Oct 27, 2016, at 07:34, Balázs Székely via Lazarus <lazarus at lists.lazarus-ide.org> wrote:
> 
> 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 at 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 at lists.lazarus-ide.org
>> http://lists.lazarus-ide.org/listinfo/lazarus
>> 
> 
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus-ide.org
> http://lists.lazarus-ide.org/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161027/83a2ca95/attachment.html>


More information about the Lazarus mailing list