Launch a webpage in the default browser

Share your advanced PureBasic knowledge/code with the community.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Launch a webpage in the default browser

Post by Mistrel »

This code is Windows only and works fine in Windows 7:

Code: Select all

RunProgram("rundll32.exe","url.dll,FileProtocolHandler "+#DQUOTE$+"http://google.com"+#DQUOTE$,"")
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Launch a webpage in the default browser

Post by ts-soft »

What is the difference to:

Code: Select all

RunProgram("http://google.com") 
I have the same result.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
rudz
User
User
Posts: 35
Joined: Sun Mar 21, 2010 6:59 am
Location: Denmark
Contact:

Re: Launch a webpage in the default browser

Post by rudz »

A 3rd way, exactly the same result.

Code: Select all

ShellExecute_(0,"open","http://www.google.com","","",1)
AMD FX-8350 @ ~4.8GHz | 8GB Corsair DDR3-SDRAM @ 1800Mhz | 7even Ult & Manjaro 0.8.7.1 | PB 5.3
Web: rudz.dk
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: Launch a webpage in the default browser

Post by Psychophanta »

The difference is that the ts-soft one is more readable and functional in allOS.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Post Reply