<DllImport("User32", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
Friend Shared Function SetParent(ByVal hWndChild As IntPtr, ByVal hWndParent As IntPtr) As IntPtr
End Function
''Sets window attributes
<DllImport("USER32.DLL")> _
Public Shared Function SetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer
End Function
'Gets window attributes
<DllImport("USER32.DLL")> _
Public Shared Function GetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer) As Integer
End Function
'assorted constants needed
Public Shared GWL_STYLE As Integer = -16
Public Shared WS_CHILD As Integer = &H40000000
'child window
Public Shared WS_BORDER As Integer = &H800000
'window with border
Public Shared WS_DLGFRAME As Integer = &H400000
'window with double border but no title
Public Shared WS_CAPTION As Integer = WS_BORDER Or WS_DLGFRAME
'window with a title bar
Public Shared WS_MAXIMIZE As Integer = &H1000000
Public mapinfo As MapInfo.MapInfoApplication
Private Sub MapWindow_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
mapinfo = New MapInfo.MapInfoApplication
Dim handle As String = mapinfo.Eval("SystemInfo(9)")
Dim oldhandle As New IntPtr(Convert.ToInt32(handle))
mapinfo.Visible = True
' SetParent(oldhandle, Me.Panel1.Handle)
SetParent(oldhandle, Me.ToolStripContainer1.ContentPanel.Handle)
mapinfo.Do("Set Window 1011 Max")
End Sub