Hi George
You example of embedding a document window in a dialog needs a bit of change to work in 64-bit MapInfo Pro.
I have shared an example on how to do this on GitHub:
EmbedMapInDialog.
In the Load handler for the dialog, you need to run code like this:
Sub MENUEmbedBrowser_OnLoad
OnError GoTo ErrorOccured
Print Time(24) & ": Embedding window now "
mnWIDEmbedded = WINCreateForDocumentControl(CTRL_DOC_WINDOW, "Browse * From " & TableInfo(NumTables(), TAB_INFO_NAME))
Print Time(24) & ": Embedded Window ID: " & mnWIDEmbedded
If mnWIDEmbedded > 0 Then
Print Time(24) & ": Embedded Window Name: " & WindowInfo(mnWIDEmbedded, WIN_INFO_NAME)
End If
Exit Sub
'-------------------------
ErrorOccured:
Call ERRCreate(Err(), Error$(), "MENUEmbedBrowser_OnLoad")
Call ERRShow()
End Sub
The procedure
WINCreateForDocumentControl
is part of the
MapBasic Library that you also can find on GitHub. I assume you already are using this as you said you are using the RibbonLib.
Alternatively, you could use a .NET window with a control that could show your HTML page. I don't have an example of this at hand, unfortunately.
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------
Original Message:
Sent: 07-22-2021 18:58
From: George Corea
Subject: Access the Welcome Window OR Mapbasic Dialog with image
Based on https://groups.google.com/g/mapinfo-l/c/a1mVMwbrbH0 , I tried a couple of options but none of them do what I need. See comments in code for details on the issues.
Sub Splash 'based on https://groups.google.com/g/mapinfo-l/c/a1mVMwbrbH0
Dim iHwnd As Integer
iHwnd = ReadControlValue(2)
Set Next Document Parent iHwnd Style WIN_STYLE_CHILD
Map from Splash_Image
End Sub
SUB MAIN
'Alter ButtonPad "Tools" Destroy
'Run program "cmd /c start M:\System\MapBasic_64bit\splash\splash.html" 'Opens the html in the browser but then the dialog to choose a version of MI loads separately so it's not practical.
Open Table "M:\System\Logo\MMLogo 2020-01.TAB" as Splash_Image Interactive
Map From Splash_Image
'Max
Dim map_win_id as integer
map_win_id = WindowID(0)
Set window map_win_id title "Custom Mangoesmapping GIS"
Dim selection as integer
Close Table Splash_Image
Open Table "M:\System\Logo\MMLogo 2020-01.TAB" as Splash_Image Interactive
Map From Splash_Image 'Loads image only if choice dialog is closed.
'Max
'Add Map Layer Splash_Image
Note "Loading Dialog New" 'Unfortunately image doesn't display
Dialog Title "About" Calling Splash Width 800 Height 600
Control DocumentWindow ID 2 Position 140, 5 Width 80 Height 40
Control StaticText title "Author: me" Position 5,10
Control StaticText title "xxx" Position 5,20
Control StaticText title "E-Mail: xxxxxx" Position 5,30
Control OKButton Position 80,43
Close Table Splash_Image
Note "Loading Dialog Standard"
Dialog
Title "WELCOME!"
------------------------------
George Corea
Mangoesmapping
MOOMIN QLD
Original Message:
Sent: 07-20-2021 23:33
From: George Corea
Subject: Access the Welcome Window OR Mapbasic Dialog with image
Is it possible to access the Welcome window that we can trigger from the options menu?
![](https://higherlogicdownload.s3.amazonaws.com/PRECISELY/MessageImages/24fc61bac52249acbe47c02e56161fad.png)
For our users in Mapinfo Workgroup 2019, I would like to include the corporate logo and news that is relevant to the organisation as well as the Precisely information if the html is a local file.
Is this possible?
Failing that is there mapbasic that allows us to trigger a window with an image or a local html page? We currently use the following but I can't work out how to include an image in this.
Dialog
Title "WELCOME!"
Control GroupBox
Title "Select Mapping Application to Activate"
Width 137
Control RadioGroup
Title "& X Shire GIS;& Full MapInfo Application;& MapInfo Interface Manual"
Value 1
Into selection
Control OKButton
Title "OK"
If selection = 1 then
Close Table Splash_Image
Run Application "M:\System\MapBasic_64bit\x_GIS.mbx"
End If
...
------------------------------
George Corea
Mangoesmapping
MOOMIN QLD
------------------------------