Question:
Is it possible to re-parent a cartographic legend in an Integrated Mapping Application? Reading the
 MapBasic Help there is a topic on "Re-parenting Legends and Other Special Windows" but it refers to 
a standard Legend Window only (which works fine) not a cartographic legend.

Answer:

There is a problem in MapInfo Professional relating to this but it does not completely prevent the
 cartographic legend window from being re-parented. The window is created, but it is created invisible.
 The workaround is to obtain the hWnd of the cartographic legend window and use this value in a call
to ShowWindow. 

Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, 
ByVal nCmdShow As Long) As Long
Public Const SHOW_FULLSCREEN = 3
Public Const SHOW_ICONWINDOW = 2
Public Const SHOW_OPENNOACTIVATE = 4
Public Const SHOW_OPENWINDOW = 1

The sequence of calls would look something like this:

mapinfo.Do "Set Next Document Parent " & Picture1.hWnd & " Style 1"
mapinfo.Do "Create Cartographic Legend From Window " & mapwinid & " Frame From Layer 1"
hWnd = mapinfo.Eval("WindowInfo(0,12)")
rc = ShowWindow(hWnd, SHOW_OPENNOACTIVATE)
