🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3367

Re: opening a Windows application

#3367
From: JB
Date: Tue, 04 Jul 2006 10:04
34 lines
1726 bytes
Thanks, ShellExecute solves my problem. 
Do I assume that with the first parameter set to NULL the 
executed application is independent of my application?
Thanks again.  
JB

Hans Galema <notused@notused.nl> wrote:
>
>
>   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");

>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. 
Technical Details
Message-ID: <44aa3d1e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44a94ce4$1@newsgroups.borland.com> <44a95b66$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
From: "JB" <jo.bullock@tiscali.co.uk>
Sender: "JB" <jo.bullock@tiscali.co.uk>
Reply-To: "JB" <jo.bullock@tiscali.co.uk>
Subject: Re: opening a Windows application
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 88.107.115.213     
References: <44a94ce4$1@newsgroups.borland.com> <44a95b66$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <44aa3d1e$1@newsgroups.borland.com>
Date: 4 Jul 2006 03:04:14 -0700
X-Trace: newsgroups.borland.com 1152007454 207.105.83.66 (4 Jul 2006 03:04:14 -0700)
Lines: 35
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail