Since posting the last query, I found a bit of a hack to get a hwnd for a
subform, so if you place an unbound subform on your form (this case called
subfrmMap), and use the api call apisetfocus and the functio below to get
its hwnd, and then parent your map to this, it works....

Yip Yah.

Would be interested still in any better solutions.

    Dim cntl As Control
    Dim CntlHwnd As Long


    Set cntl = Me.subfrmMap
    CntlHwnd = fhWnd(cntl)
    Set oMI = CreateObject("MapInfo.application")

'
    With oMI
        .do "Set Window MapInfo Front"
        .do "Set Application Window " & CntlHwnd
        .do "Set Next Document Parent " & CntlHwnd & " Style 1"

Then this function to return the Hwnd

Function fhWnd(ctl As Control) As Long
    On Error Resume Next
    ctl.SetFocus
    If Err Then
        fhWnd = 0
    Else
        fhWnd = apiGetFocus
    End If
    On Error GoTo 0
End Function

And This declare:
Declare Function apiGetFocus Lib "user32" Alias "GetFocus" () As Long
-----------------------------------
Robert Crossley
Robert Crossley and Associates
10 Trinity Street
Parramatta Park
CAIRNS 4870
AUSTRALIA
LAT:16.928569S LONG:145.769107E

Ph 07 40314877
F  07 40314810
M  0419 718642
E  [EMAIL PROTECTED]
-----------------------------------



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to