>I can call a www page from MapInfo. I have added a button to our
application
>HELP with a button that calls the following.
>
>Run Program "C:\Program Files\Netscape\Communicator\Program\netscape.exe
>www.mapinfo.com"
>will work, however its poor code.
>
>I don't want to ask the user the location of the browser.
>
>If I knew how NT/Win9x used the START -> RUN (try it, just type in the URL
>and it works) then I may be able to call that method.
>
>I even had a go at calling shortcuts to the browser / page .....
>
>I don't want to write code to find the default browser.

This is how I did it:

Sub LaunchURL(URLFileName As String)

  OnError Goto ErrHandler

  Dim rc As Integer
  Dim ihwnd As Integer
  Dim sOp As String
  Dim sFile As String
  Dim sParams As Integer
  Dim sDir As String
  Dim iShowCmd As Integer
  Dim Null As Integer

  ihwnd = WindowInfo(WIN_MAPINFO, WIN_INFO_WND)
  sOp = "open"
  sFile = URLFileName
  sParams = "" + Chr$(0)
  sDir = ApplicationDirectory$()
  iShowCmd = 0
  Null = 0

  rc = ShellExecute(ihwnd, sOp, sFile, Null, sDir, iShowCmd)
  If rc <= 32 Then
    Note "Unable to launch" + rc
  End If

  Exit Sub

ErrHandler:
  Resume Next

End Sub


----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to