Solved

running outside applications

Posted on 1998-12-14
8
122 Views
Last Modified: 2010-04-04
I'm trying to set up an auto-run program for a cd that I'm creating for a friend.  I'd like to be able to access outside applications, ie Windows Explorer off of buttons.  I'm not sure how to do this, seeing as how I haven't been programming in Delphi very long.
0
Comment
Question by:Franker
8 Comments
 
LVL 4

Expert Comment

by:dwwang
ID: 1350907
You can use WinExec('c:\...\ExeName',SW_SHOW);
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1350908
Or CreateProcess or ShellExecute or ShellExecuteEx...
0
 
LVL 3

Accepted Solution

by:
philipleighs earned 50 total points
ID: 1350909
This code will open windows explorer starting in Program Files. Change explore to open if you want views like the ones that appear when you double click My Computer on the desktop.

ShellExecute(Application.Handle,
                        PChar('explore'),
                        PChar('c:\program files'),
                        PChar(''),
                        PChar(''),
                        SW_SHOWDEFAULT);
0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1350910
Don't forget to add ShellApi to your uses clause.

Cheers,
Phil.

0
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.

 
LVL 4

Expert Comment

by:dwwang
ID: 1350911
???
0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1350912
Hi dwwang,
What's up?
0
 

Author Comment

by:Franker
ID: 1350913
my other question with this is how can I detect where it's running from, for example I know in Java (the last language I was programming in) there's the command getDocumentBase() where you can retrieve the directory where the .java file is located.
0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1350914
Do you mean that you want to extract 'c:\mydir\' from 'c:\mydir\javafile.java'?
If so, use ExtractFilePath and add SysUtils to the uses clause.
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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 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