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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem running another program automatically 1

Status
Not open for further replies.

nickio

IS-IT--Management
Sep 22, 2003
1
GB
I'm trying to create a small delphi app that launches another program and then closes itself. Basically I need an runme.exe to be on a CD that runs another program in a subfolder on the CD. I can create a button which uses WinAPI to launch the program, but cannot get it too work without the button.

Please help.

Nick
 
use you form.create event or a timer:

then you can use ShellExecute(); Close;
remember to put ShellAPI in youre uses list or it wont work.


I hope this helps,

[bobafett] BobbaFet [bobafett]

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
Instead of putting your code in the button's OnClick event try putting it in the application's OnActivate event. You should ensure that the program is launched only once by setting a suitable flag.

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top