Solved

open and close an application

Posted on 1998-07-23
8
267 Views
Last Modified: 2010-04-04
may i know what is the command (and how to used it) in Delphi 3 that can run(open) and exit(close) an application?
0
Comment
Question by:smile_tbw
8 Comments
 
LVL 3

Expert Comment

by:Matvey
ID: 1358515
post your email and a cool component is on it's way...

bosism@netvision.net.il
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1358516
Use CreateProcess... and ExitProcess...
You can also use the simpler WinExec to start apps.

/// John
0
 

Expert Comment

by:sakya
ID: 1358517
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

0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 3

Expert Comment

by:Matvey
ID: 1358518
The component has lot's of other functions...
0
 

Author Comment

by:smile_tbw
ID: 1358519
i need the answer online and not to mail to you. sorry.
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1358520
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
0
 

Author Comment

by:smile_tbw
ID: 1358521
Matvey,

thanks to your suggestion. i will find out later.
0
 

Accepted Solution

by:
Mariner080498 earned 50 total points
ID: 1358522
You can open applicatiion with OLE object.
  Create OLE object and then use his functions like 'Open' and
'Quit' .  

For example :

 ExcelApp:= CreateOleObject('Excel.Application');
and
    ExcelApp.Quit;
 
You also may use 'WinExec()' procedure to start an Applications.
  Different way to do this is to use Process Handling like that :

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);
//DestroyProcess( nil,EXE,nil,nil,false,0,nil,nil,S,P) ;
end;
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
build html 5 client that connect to indy Tidtcpserver 3 397
Delphi XE10 Round Image 2 128
Strange behavior when a form is closed 6 57
Dev express lookupcombo 3 28
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question