Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

open file...

Posted on 2000-03-25
2
Medium Priority
?
160 Views
Last Modified: 2010-04-04
Hi,
Is there a windows api that I can call from delphi that has the same effect as right clicking an icon and selecting "open"
By doing this I want to open a .vcf file without needing to know what the current application associated with it is.

Any sample code or directions to web site most appreciated.

Mal
0
Comment
Question by:malcx
  • 2
2 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 400 total points
ID: 2657199
hi,
sure you can use shellexecute() api from shellapi unit.
example:

uses shellapi;

shellExecute('handle,'open',pchar('c:\some.vcf'),nil,nil,sw_normal);


Regards Barry
0
 
LVL 17

Expert Comment

by:inthe
ID: 2657201
typo:

ShellExecute(handle,'open',pchar('c:\some.vcf'),nil,nil,sw_normal);


also for executable files you can just use
winexec('c:\excel.exe',sw_normal);
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Integration Management Part 2
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

927 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