Solved

shell external program

Posted on 1998-09-19
4
198 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
Comment Utility
use shellExec, execwin for win16 or
use CreateProcess for Win32
Look up the API help for more details
0
 

Author Comment

by:girsu
Comment Utility
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
Comment Utility
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
Comment Utility
thanks JimBob good answer...
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now