Article View: borland.public.cppbuilder.nativeapi
Article #5087ShellExecute
From: Pat Clancy
Date: Sat, 01 Oct 2005 20:29
Date: Sat, 01 Oct 2005 20:29
35 lines
1675 bytes
1675 bytes
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:
<433ef0b7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!mpls-transit-01.news.qwest.net!38.119.100.82.MISMATCH!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c6ee0d9dc1746791,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Pat Clancy" <pclancy@sasktel.net> Newsgroups: borland.public.cppbuilder.nativeapi Subject: ShellExecute Date: Sat, 1 Oct 2005 14:29:50 -0600 Lines: 37 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; Original NNTP-Posting-Host: 64.110.227.117 Message-ID: <433ef0b7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1128198327 64.110.227.117 (1 Oct 2005 13:25:27 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!mpls-transit-01.news.qwest.net!38.119.100.82.MISMATCH!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail