Solved

shell external program

Posted on 1998-09-19
4
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

690 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