MapInfo Pro Developers User Group

Welcome to the MapInfo Pro Developers community!  We are a group dedicated to the discussion and understanding of MapBasic and .Net MapInfoPro AddIn development. Bring your questions and ideas here. This group includes several members of the Pro development team from around the world.

Please feel free to start a discussion in the discussion tab or join in a conversation.

Product Information  Ideas Portal  MapInfo Community Downloads

Discussions

Members

Resources

Events

 View Only
  • 1.  Open a web page from a dialog box

    Posted 11-11-2017 20:58

    I search the best method to link a web page (Help File, informations about the data) with a button in a dialog box. Any idea or exemple.

    Thanks

    Germain



  • 2.  RE: Open a web page from a dialog box

    Employee
    Posted 11-13-2017 03:50

    Hi Germain,

    You can assignn a handler to a button on your dialogbox and in the handler do something along these lines:

    Sub ButtonHandler

    Dim rc As Integer

    rc = WAPIShellExecute(0, "open", sFileOrURL, "", "", SW_RESTORE)

    End Sub

    Make sure to also include a declare statement for the WAPISHellExecute function and a define for SW_RESTORE:

    Declare Function WAPIShellExecute Lib "shell32.dll" Alias "ShellExecuteA"

    ( ByVal hwnd As Integer 'Can be zero or a pointer to the MapInfo Window

    , ByVal sOperation As String 'Operation to perform on the file

    , ByVal sFile As String 'File to perform the operation on

    , ByVal sParameters As String 'Parameters to send to the file

    , ByVal sDirectory As String 'Default working directory

    , ByVal nShowCmd As Integer 'How to display the application ) As Integer

     

    'http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx

     

    Define SW_RESTORE 9

     



  • 3.  RE: Open a web page from a dialog box

    Posted 11-14-2017 14:56
    Hi Peter, like all of you touch it perfects, this code work like a breeze. Thank you, Germain Bélanger