🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: URL Offsets Prevent URLs from being passed to a browser

#9137
From: Randall Parker
Date: Tue, 27 Jul 2004 21:50
40 lines
2780 bytes
I think I know why the Parameters argument doesn't help.

See thisn MSKB article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;224816
Excerpt:
ShellExecute parses the string that is passed to it so that ShellExecute can extract 
either a protocol specifier or an extension. Next, ShellExecute looks in the registry 
and then uses either the protocol specifier or the extension to determine which 
application to start. If you pass http://www.microsoft.com to ShellExecute, 
ShellExecute recognizes the http://  sub-string as a protocol, which causes 
ShellExecute to view HKEY_CLASSES_ROOT\http\shell\open for information about how to 
run. If you pass myfile.htm to ShellExecute, ShellExecute recognizes the ".htm" 
sub-string as an extension. This causes ShellExecute to view HKEY_CLASSES_ROOT\.htm, 
which leads to HKEY_CLASSES_ROOT\htmlfile\shell\open.


Well, I'm using "file://" rather than "http://" and I'm not ending the string with 
".htm" and so the two ways it uses to choose the 
HKEY_CLASSES_ROOT\htmlfile\shell\open are both not working.

Anyone have any ideas on how to open a local file in a browser when the URL includes 
a #OffsetLink into the HTML page?


Bob Gonder wrote:

> Have you tried using the parameters value?
>  AnsiString UrlStr=
> 	"file://"+ExtractFilePath(Application->ExeName)+"myfile.htm";
>  AnsiString Param = UrlStr+"#HotKeys";
> 
> ShellExecute(NULL,"open",UrlStr.c_str(),Param.c_str(),0,SW_SHOWDEFAULT);
> 
> Don't forget to put extra quotes around the path to account for spaces
> and other nasties that are allowed in paths, but look a lot like
> zwhitespace.
> 
> Param = "\""+Param+"\"";
> 
> 
Technical Details
Message-ID: <4106cdf8$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41048d77$1@newsgroups.borland.com> <2mtag0ha1q4e2uj39svnoruuib3k80s5cu@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,80cfdee9a8d50af3
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 27 Jul 2004 14:50:01 -0700
From: Randall Parker <STOPtechiepundit@EVILfuturePOXpunditSPAM.com>
User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: URL Offsets Prevent URLs from being passed to a browser
References: <41048d77$1@newsgroups.borland.com> <2mtag0ha1q4e2uj39svnoruuib3k80s5cu@4ax.com>
In-Reply-To: <2mtag0ha1q4e2uj39svnoruuib3k80s5cu@4ax.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 4.40.49.194
Message-ID: <4106cdf8$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090964984 4.40.49.194 (27 Jul 2004 14:49:44 -0700)
Lines: 40
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail