Solved

Running an exe file

Posted on 2000-02-19
5
166 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

919 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

16 Experts available now in Live!

Get 1:1 Help Now