Board index » delphi » Help with Mouse Click

Help with Mouse Click

Hi Sandy,

if you want to send a click to a button in your Delphi program, it's easy:

procedure TForm1.Button2Click(Sender: TObject);
begin
  Button1Click(Sender); // activate the OnClick event of Button1
end;

but, if you want to send a click message to an external program, you should
know the handle of the control you would like to send the click event to.
For example, go get the handle of the quit button and try a
SendMessage(HandleOfQuitButton, WM_MOUSEBTNCLICK (something else I can't
remember)... bla bla... You should check out the Help on SendMessage and the
exact constant WM_ something for the left mouse button click...

still questions?
Mail me!

--
Martijn Tonies
http://surf.to/seal97
sea...@dds.nl

<none of the text written above has got anything to do with Euro Partners
Informatici BV>

System Development
Euro Partners Informatici BV
http://www.euro-partners.nl

Sandy heeft geschreven in bericht <01bdafff$62aa6f60$a80b26cb@166>...

Quote
>How do you perform a mouse click event on a button
>in a external program.  For example
>The Quit button on The Microsoft Hearts Network game.
>I know the main windows handle is
>Wnd := FindWindow('#32770', nil );

>but what do I do after that please help.
>Thankyou
>Sandy

 

Re:Help with Mouse Click


How do you perform a mouse click event on a button
in a external program.  For example
The Quit button on The Microsoft Hearts Network game.
I know the main windows handle is
Wnd := FindWindow('#32770', nil );

but what do I do after that please help.
Thankyou
Sandy

Other Threads