Link to home
Start Free TrialLog in
Avatar of okemo
okemo

asked on

Starting and closing an application using Delphi

How can I use delphi 2.0 to start and close down an application. Can you provide some code to do this?
Avatar of ronit051397
ronit051397

Example for starting the Notepad:
Winexec('c:\winNT\Notepad',SW_SHOW);

Example for closing the Notepad:
SendMessage(Findwindow('notepad',nil), WM_Close, 0, 0);

Avatar of okemo

ASKER

This may be the case for applications whose executable name is the same as the window name. How do you do this if the two are different because not applications open windows with the same name as the executable.
Try this component,

I use it a lot : It's easy, great, well documented, with source, freeware,..., what else do you need?

http://SunSite.icm.edu.pl/delphi/ftp/d10free/execfl32.zip

http://SunSite.icm.edu.pl/delphi/ftp/d10free/execfile.zip (D1)

Have fun,
c.u. ZifNab;
ASKER CERTIFIED SOLUTION
Avatar of mshaer
mshaer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial