Article View: borland.public.cppbuilder.nativeapi
Article #3362Re: opening a Windows application
From: Hans Galema
Date: Mon, 03 Jul 2006 17:55
Date: Mon, 03 Jul 2006 17:55
28 lines
1521 bytes
1521 bytes
JB wrote:
> I have a file name stored in my application. I want to be able
> to use this file name to open the file using the appropriate
> Windows application.
AnsiString FileName = ..........;
if ( ! FileExists ( FileName ) )
{
ShowMessage ( FileName + "\n\nnot found.");
return;
}
HINSTANCE hinstance = ShellExecute (
NULL
, "open"
, FileName.c_str()
, NULL
, NULL
, SW_SHOWNORMAL
);
if ( (int)hinstance < 32 )
ShowMessage ( FileName + "\n\ncould not be shellexecuted");
Hans.
Technical Details
Message-ID:
<44a95b66$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<44a94ce4$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2ed92cf913ba2917 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 03 Jul 2006 19:55:52 +0200 From: Hans Galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: opening a Windows application References: <44a94ce4$1@newsgroups.borland.com> In-Reply-To: <44a94ce4$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 145.98.201.248 Message-ID: <44a95b66$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1151949670 145.98.201.248 (3 Jul 2006 11:01:10 -0700) Lines: 28 Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail