Solved

shell external program

Posted on 1998-09-19
4
201 Views
Last Modified: 2010-04-06
i want to execute an external .EXE program during runing time any body please Help...

thanks
   Girsu
0
Comment
Question by:girsu
  • 2
4 Comments
 
LVL 2

Expert Comment

by:kjteng
ID: 1340223
use shellExec, execwin for win16 or
use CreateProcess for Win32
Look up the API help for more details
0
 

Author Comment

by:girsu
ID: 1340224
sorry, i'm a VB programmer this is the first time i write a program by Delphi could ypu please send an example... i'll be thanks


thanks
0
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 100 total points
ID: 1340225
Hi Girsu

A good way is to use the ShellExecute API.  (Add ShellApi to your form's "uses" clause.)

E.g. to run notepad:
ShellExecute(Self.Handle, 'open', PChar('C:\Windows\Notepad.exe'), nil, nil, SW_NORMAL);

You can change the nils to PChar('Some string') if you want to pass in a parameter (first nil) or set the working folder (second nil).

The great thing about ShellExecute is that you don't have to use a EXE program.  You can ShellExecute any file, e.g. MyWordDoc.doc, etc.

Cheers,
JB
0
 

Author Comment

by:girsu
ID: 1340226
thanks JimBob good answer...
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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