🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: ShellExecute

#5089
From: Pat Clancy
Date: Sat, 01 Oct 2005 22:01
42 lines
2000 bytes
I actually found the solution in CreateProcess.
Thanks

"Pat Clancy" <pclancy@sasktel.net> wrote in message 
news:433ef0b7$1@newsgroups.borland.com...
> Hello,
>
> I am trying to run a program using ShellExecute but I don't know wwhich 
> drive the user is going to be using.  I can get that information using 
> something like:
>
> char Drive[4];
> strcpy(Drive, "D:\\");
> AnsiString xxx= "FindMe.txt";
> bool notFound = true;
>
> while((Drive[0]<='Z')&&(notFound))
> {
>  if(GetDriveType(Drive) == DRIVE_CDROM)
>   {
>    if(FileExists((AnsiString)Drive + xxx))
>     notFound = false;
>    else
>     Drive[0]++;
>    }
>   else
>    Drive[0]++;
>  }
>
> on the ShellExecute end of things I would like to be able to put the Drive 
> into my execute line something like
>
> ShellExecute(NULL, "open",
>    Drive + ".\\myProg.exe",
>    "", "" ,
>    SW_SHOWDEFAULT);
>
> I am on the right track?
>
> Thanks for any help you cna send me.
>
> 
Technical Details
Message-ID: <433f0643@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!atl-c02.usenetserver.com!news.usenetserver.com!atl-c07.usenetserver.com!news.usenetserver.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <433ef0b7$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c6ee0d9dc1746791
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Pat Clancy" <pclancy@sasktel.net>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <433ef0b7$1@newsgroups.borland.com>
Subject: Re: ShellExecute
Date: Sat, 1 Oct 2005 16:01:43 -0600
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 64.110.227.117
Message-ID: <433f0643@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1128203843 64.110.227.117 (1 Oct 2005 14:57:23 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!atl-c02.usenetserver.com!news.usenetserver.com!atl-c07.usenetserver.com!news.usenetserver.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail