Solved

running outside applications

Posted on 1998-12-14
8
125 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
[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
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
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!

 
LVL 3

Expert Comment

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

Cheers,
Phil.

0
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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