Link to Web page

BlitzMax Forums/BlitzMax Programming/Link to Web page

TartanTangerine (was Indiepath)(Posted 2005) [#1]
EDIT : I have written a function > See bottom of Thread.


TartanTangerine (was Indiepath)(Posted 2005) [#2]
Guess I'll have to write a function then :P


nawi(Posted 2005) [#3]
http://www.blitzbasic.com/Community/posts.php?topic=47845

This works on Windows


Gabriel(Posted 2005) [#4]
Actually it doesn't. At least not reliably on all machines. I just tried it and it doesn't do a thing. The beauty of the original ExecFile was that you could just give it the URL and it would open it in the default browser.

This is another one of those very basic features which BlitzMax lacks. At the moment, so much has to be coded with workarounds, module tweaks and CPP/PB dll's that it's hardly worth using BMax at all.


Dreamora(Posted 2005) [#5]
The alternative would be doing a OS check and just blocking pre-2k users (the ones with the insecure crap OS ;)) ... this would minimize the failure rate of most stuff by a quite large part ... *there is some reason why driver manufacturers aren't supporting them anymore in some cases*


nawi(Posted 2005) [#6]
It works for me. Sybixsus, are you using the http:// tag in the url?


TartanTangerine (was Indiepath)(Posted 2005) [#7]
This is another one of those very basic features which BlitzMax lacks. At the moment, so much has to be coded with workarounds, module tweaks and CPP/PB dll's that it's hardly worth using BMax at all.

I have to agree.

I'll post a workaround tomorrow... PB code again!


TartanTangerine (was Indiepath)(Posted 2005) [#8]
The code will be based off of :-
  iepath.s=Space(255)
              iepathsize.l=255

              nspath.s=Space(255)
              nspathsize.l=255

              url.s="http:\\www.morphlings.com"

              RegQueryValue_(#HKEY_LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE",@iepath,@iepathsize)
              RegQueryValue_(#HKEY_LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Netscape.exe",@nspath,@nspathsize)

              If iepath<>""
              WinExec_(iepath + " " + url,#SW_SHOWNORMAL)
              Else 
              If nspath<>""
              WinExec_(nspath + " " + url,#SW_SHOWNORMAL)
              Else
              ShellExecute_(0,"open",url,"","",#SW_SHOWNORMAL)
              EndIf
              EndIf 



bradford6(Posted 2005) [#9]
There should be a OpenURL(url) function in Bmax that will use the machines default browser. opening a web page from an app is very basic stuff


Gabriel(Posted 2005) [#10]
It works for me. Sybixsus, are you using the http:// tag in the url?


Yep.

There should be a OpenURL(url) function in Bmax that will use the machines default browser. opening a web page from an app is very basic stuff


I agree.


TartanTangerine (was Indiepath)(Posted 2005) [#11]
Here is a DLL that works 100% of the time and opens the URL in the default browser.

http://www.indiepath.com/downloads/OpenURL.zip

Simple to use in BMax
Global iPtr = LoadLibraryA("OpenURL.dll")
Global OpenURL(url:Byte Ptr)"win32"=GetProcAddress(iPtr,"OpenURL")
' ******************************8

OpenURL("www.indiepath.com")


Have Fun.


Who was John Galt?(Posted 2005) [#12]
Nice one, Tim. Thanks for sharing.