Hello,
>I create forms with VB 6.0 for use as child windows of MI-Map windows. The
>problem is that when I want to drag the VB-Form, as soon as I click on it it
>moves down : distance beetween mouse-pointer and top of form equivalent to the
>distance beetween top of map window and top of screen.
>Here is an example with a blank form: VB project consists of a module, a form
>and must reference the MI OLE automation type library : the above code has to
>be pasted into a module (start-up module), and a form (here named EmptyForm)
>has to be added to the project. It creates a MI-Application, which opens a
>map-table, and a child-form is added to this map.
>Public Mi As MapInfoApplication
>Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal
>hWndNewParent As Long) As Long
>Sub Main()
> Dim MIHandler As Long
> Dim X As Long
> Dim MIAppHandler As Long
> Set Mi = CreateObject("MapInfo.Application")
> Mi.Visible = True
> Mi.Do ("Open Table ""{Path of a MI-Table}"" Interactive")
> Mi.Do ("Map From {Name of table}")
> EmptyForm.Visible = True
> MIHandler = Mi.Eval("WindowID(1)")
> MIAppHandler = Mi.Eval("WindowInfo(" & CStr(MIHandler) & ", 12)")
> X = SetParent(EmptyForm.hwnd, MIAppHandler)
>End Sub
>How is it possible to prevent this problem ?
MapInfo has special set of commands used to reparent its windows - you don't have to
use
API SetParent. To reparent document window (such as map in you case), issue:
Mi.Do("Set Next Document Parent " & EmptyForm.hwnd & " Style 1")
Mi.Do("Map From {YourTable}")
Read MapBasic help, Set Next Document statement, to learn more about its syntax and
possible values of Style parameter.
Dmitry
Dmitry Bogdanov
GIS Department Manager
Kiev Software Factory Ltd.
room 46 9/12 Baumana St, Kiev, Ukraine 252190
Tel: (380 44) 442-6077; (380 44) 443-7925
Fax: (380 44) 443-7925
Internet: http://www.ksf.kiev.ua
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]