Article View: borland.public.cppbuilder.nativeapi
Article #6295Re: shellExecute and Notepad wierdness..
From: Ali
Date: Tue, 24 May 2005 12:00
Date: Tue, 24 May 2005 12:00
42 lines
2143 bytes
2143 bytes
AnsiString MyStr;
MyStr="NOTEPAD.EXE";
ShellExecute(NULL,
NULL,
MyStr.c_str(),
NULL,
NULL,
SW_SHOW
);
----------------------------------------
"Roddy Pratt" <roddy at spam fritter dot com> wrote in message
news:4292fa85$1@newsgroups.borland.com...
> I'm using ShellExecute to open a document specified by the user, from BCB5
> on XP SP2
>
> It works fine for most file types (eg spreadsheets, PDFs) and URLs.
>
> But, when I try it with a .txt file, 'nothing obvious happens'.
ShellExecute
> returns 42 which is not an error code.
>
> When I check in the task manager, there's a now a notepad.exe *process*
> shown, but NOT a notepad application!
>
> .txt files open fine with notepad from the desktop, either by
doubleclicking
> or selecting 'open'.
>
> I'm confused!
>
> - Roddy
>
>
> int err = (int)
> ShellExecute(Application->MainForm->Handle,"open",docname.c_str(),(params
==
> "")? NULL:params.c_str(), NULL,0);
> if (err <= 32)
> ...
>
>
Technical Details
Message-ID:
<42931759@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4292fa85$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ca680fb605a9512 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Ali" <ali_info@hotpop.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4292fa85$1@newsgroups.borland.com> Subject: Re: shellExecute and Notepad wierdness.. Date: Tue, 24 May 2005 16:30:24 +0430 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 80.191.126.112 Message-ID: <42931759@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1116936025 80.191.126.112 (24 May 2005 05:00:25 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail