Solved

open file...

Posted on 2000-03-25
2
156 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
[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
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

740 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