Solved

open file...

Posted on 2000-03-25
2
151 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 100 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

757 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

23 Experts available now in Live!

Get 1:1 Help Now