Solved

running outside applications

Posted on 1998-12-14
8
121 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
Comment Utility
You can use WinExec('c:\...\ExeName',SW_SHOW);
0
 
LVL 20

Expert Comment

by:Madshi
Comment Utility
Or CreateProcess or ShellExecute or ShellExecuteEx...
0
 
LVL 3

Accepted Solution

by:
philipleighs earned 50 total points
Comment Utility
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
Comment Utility
Don't forget to add ShellApi to your uses clause.

Cheers,
Phil.

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 4

Expert Comment

by:dwwang
Comment Utility
???
0
 
LVL 3

Expert Comment

by:philipleighs
Comment Utility
Hi dwwang,
What's up?
0
 

Author Comment

by:Franker
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

12 Experts available now in Live!

Get 1:1 Help Now