Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

button click by code

Status
Not open for further replies.

jmathishd436

Programmer
Jan 14, 2006
3
US
how do you make a program create a virtual button click somewhere outside the actual program,

ex. a program that clicks an icon on the desktop or start menu

PS im using Borland Delphi 3
 
by button click i mean mouse click sry bout that if it was confusing
 
From the SDK:

"The mouse_event function synthesizes mouse motion and button clicks.

Windows NT/2000/XP: This function has been superseded. Use SendInput instead."

Play around with them, I know they exists but never used them.

The sure way of making what you want is getting the element's handle and sending messages to it (but getting the handle can be difficult, depending on the element nature).

HTH.
buho (A).

 
can u give an example of the code, i cant figure out how to use those commands

thanks
 
Sorry, I never used them, all I know is they exists.

buho (A).
 
Here is an example of using mouse_event to simulate mouse clicks (page found with a google search for "delphi mouse_event"):

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top