• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 130
  • Last Modified:

running outside applications

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
Franker
Asked:
Franker
1 Solution
 
dwwangCommented:
You can use WinExec('c:\...\ExeName',SW_SHOW);
0
 
MadshiCommented:
Or CreateProcess or ShellExecute or ShellExecuteEx...
0
 
philipleighsCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
philipleighsCommented:
Don't forget to add ShellApi to your uses clause.

Cheers,
Phil.

0
 
dwwangCommented:
???
0
 
philipleighsCommented:
Hi dwwang,
What's up?
0
 
FrankerAuthor Commented:
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
 
philipleighsCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now