Skip to Content

HyperlinkToURL not working correctly

Dec 27, 2016 at 03:35 AM


avatar image

I am using HyperlinkToURL and it is not bringing up the default browser, instead it is using Internet Explorer.

I am using PB 10.5 and on Windows 10 it uses IE rather than the default browser which is Chrome. On Windows 7 it is using Chrome.

The URL i am passing is:

ls_SearchURL = '"? ' + ls_SearchValue + '"'

Passing "? searchterm" is a standard way to tell the browser to pass searchterm to the default search website.

It has been suggested to do this:

Run("rundll32.exe url.dll,FileProtocolHandler")

The problem with this method is that I have to know the URL of the default search website.

Any suggestions would be appreciated.


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Dan Cooperstock Jan 31, 2017 at 10:59 PM

I have the same sort of problem - my default browser is IE, but any hyperlinks done from PB programs always open in Chrome. Somehow PB must have its own notion of what the default browser is, or uses some incorrect lookup.

10 |10000 characters needed characters left characters exceeded
Roland Smith Feb 01, 2017 at 04:10 PM

Add the below function to an object and then call it like this:

of_WebBrowse("? " + ls_SearchValue)

public subroutine of_webbrowse (string as_urlstring);String ls_regkey, ls_value, ls_command
Long ll_pos

// get the default browser
ls_regkey = "HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\" + &
RegistryGet(ls_regkey, "Progid", RegString!, ls_value)

// get the browser command line
ls_regkey = "HKEY_CLASSES_ROOT\" + ls_value + "\shell\open\command"
RegistryGet(ls_regkey, "", RegString!, ls_value)

// append the passed URL string to the browser exe
ll_pos = LastPos(ls_value, ".exe") + 4
ls_command = Left(ls_value, ll_pos) + ' "' + as_urlstring + '"'

end subroutine
10 |10000 characters needed characters left characters exceeded