Solved

Running an exe file

Posted on 2000-02-19
5
170 Views
Last Modified: 2010-04-04
I know how to do this with vb, but I'm new to delphi.  How do I run an application.  Also knowing how to open the defualt browser or mail program would be nice, but my question is about running an app.

In vb it would be:
Dim X
X = shell(c:\myapp.exe, vbhide)

I hope it's that simple in delphi.
0
Comment
Question by:fibdev
[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
  • 3
  • 2
5 Comments
 
LVL 3

Author Comment

by:fibdev
ID: 2538587
ooops:
X = shell("c:\myapp.exe", vbhide)

Didn't want vb programmers correcting me :)
0
 
LVL 1

Accepted Solution

by:
fulvio_brasil earned 50 total points
ID: 2538605
To run a simple app you can use:
WinExec("c:\myapp.exe", SW_HIDE)

To open a browse, e-mail, app for an extension, you can use:

ShellExecute(Handle,'open',pchar('http://www.experts-exchange.com'),'','',SW_SHOW);

I hope that it can help you,

Fulvio.
0
 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2538613
Please, pay attention:

The ShellExecute's 4 and 5 parameters are (I don't know the right english name, but) single quotes (like every string in Delphi), not (like in VB) double quotes.

And, to use this function, you need put 'ShellAPI' in your uses clause.
0
 
LVL 3

Author Comment

by:fibdev
ID: 2538643
I have not tested it, but I'll trust your answer.

Your english is correct, very good.

Thank you.
0
 
LVL 1

Expert Comment

by:fulvio_brasil
ID: 2538670
Thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

696 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