🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Launch URL w/ anchor

#15267
From: Daniel
Date: Mon, 14 Jul 2003 19:26
23 lines
1828 bytes
Hey,

I've found lots of posts regarding how to launch a URL in the default
browser (in Windows) using the ShellExecute() method. The problem with this
is if you secify a URL with an anchor (ie.
www.mySite.com/somePage.htm#anchorInPage), it doesn't work - the anchor
confuses ShellExecute() since it appears to be part of the file name.

How can I get around this? I tried the FindExecutable() method to get the
path of the default browser and then explicitly launch the default browser
with the URL. This works fine, except FindExecutable() requires a valid
filename which, because of the anchor, I don't have (I'd prefer not to strip
off the anchor if I can avoid it).

Is there another way to get the default browser direclty (with using a
file)? Better yet, is there a function that does everything for me - a sort
of "LaunchURL()" method that handles anchors already?

I'm open to suggestions -

  Thx,

       D.
Technical Details
Message-ID: <3f13032d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,66610d8c50569439,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-14 12:40:26 PST
From: "Daniel" <dukryn@microcommander.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Launch URL w/ anchor
Date: Mon, 14 Jul 2003 12:26:04 -0700
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4922.1500
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800
NNTP-Posting-Host: 24.80.166.52
Message-ID: <3f13032d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1058210605 24.80.166.52 (14 Jul 2003 12:23:25 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail