• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

shell external program

i want to execute an external .EXE program during runing time any body please Help...

thanks
   Girsu
0
girsu
Asked:
girsu
  • 2
1 Solution
 
kjtengCommented:
use shellExec, execwin for win16 or
use CreateProcess for Win32
Look up the API help for more details
0
 
girsuAuthor Commented:
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
 
JimBob091197Commented:
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
 
girsuAuthor Commented:
thanks JimBob good answer...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now