Link to home
Start Free TrialLog in
Avatar of smile_tbw
smile_tbw

asked on

open and close an application

may i know what is the command (and how to used it) in Delphi 3 that can run(open) and exit(close) an application?
Avatar of Matvey
Matvey

post your email and a cool component is on it's way...

bosism@netvision.net.il
Use CreateProcess... and ExitProcess...
You can also use the simpler WinExec to start apps.

/// John
Hi.
examples

var
S: TStartupInfo;
P: TProcessInformation;
const
EXE = 'c:\windows\explore.exe';

begin
GetStartupInfo(S);
CreateProcess(nil,EXE,nil,nil,false,0,nil,nil,S,P);

end;

Now you can start another program.

sakya

The component has lot's of other functions...
Avatar of smile_tbw

ASKER

i need the answer online and not to mail to you. sorry.
OK, sorry too. You can also download some components for executing apps:

  http://torry.rimini.com/vcl/system/appexec.zip
"A component that allows you to execute applications easily"

  http://torry.rimini.com/vcl/system/aapexec.zip
"This component provides easy way to run and close another applications from your. Allow to wait results of application job"

  http://torry.rimini.com/vcl/system/texec.zip
"Component to run another Windows application."

  http://torry.rimini.com/vcl/system/sfexec.zip
"This is a component for calling other applications in your application. You can get application's Exit Code if you wait for application exit before continuing. It's very important if you run some MSDOS application."

  http://torry.rimini.com/vcl/system/execproc.zip
"TExecuteProcess allows you to launch a process from your Delphi application and wait or not for its completion. Those applications can be launched and followed by the component either synchronously or asynchronously: Synchronous wait is achieved by blocking your application as long as the launched application hasn’t finished. It means your program won’t receive any message from the system (it won’t repaint). Asynchronous wait is achieved by starting a thread from the component, that thread waiting for completion. Once the process has terminated the thread warns the component giving back all information normally available in synchronous mode. In asynchronous wait your application can still process messages and won’t be blocked at all (the window will be repainted).The component can launch either a EXE or COM file as well as a BAT file thus allowing to synchronize execution of external programs."

  http://torry.rimini.com/vcl/system/runapp.zip
"TRunApp component helps to run applications and also it can hooks standard input, output and error streams of running (DOS) application."

Tell me if you find any of them useful. Sorry for posting a silly answere in the beginning... c u, Matvey
Matvey,

thanks to your suggestion. i will find out later.
ASKER CERTIFIED SOLUTION
Avatar of Mariner080498
Mariner080498

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