Dear All,

My post is at the bottom of this mail but basically I wanted to tell MapInfo
the 'name' of a window I was interested in and get it to return the ID of
that window...

Thanks to all of you who replied and special thanks to Peter Horsb�ll M�ller
who provided me with a very neat little function to do exactly what I was
after. Thanks Peter! Its copied below for anyone who missed it the first
time:

***********

Function WINGetWindowID(ByVal szWinName As String) As Integer

Dim     i, nWID As Integer

OnError GoTo ErrorOccured

        WINGetWindowID = 0
        
        If szWinName = "" Then
                Exit Function
        End If
        
        For i = 1 To NumWindows()
                nWID    = WindowID(i)
                If WindowInfo(nWID, WIN_INFO_NAME) = szWinName Then
                        WINGetWindowID = nWID
                        Exit Function
                End If
        Next

        Exit Function
'-------------------------
ErrorOccured:
        Note "Some error happend: " & Error$()

End Function

Original Post:
***********
Listers,

Can anyone tell me if the following is possible?

In MapBasic I am opening a map window and naming it "Main" a second window
also opens which I call "Overview". Is it possible to get the WindowID of
the "Main" window and save it to a variable? Obviously each time I open the
window it has a different WindowID. I have done this before but I'd like to
know how others get the result so I'm trying not to be too leading with my
question.

Basically in plain English can I ask MapInfo "Hey MapInfo, what's the Window
ID of the Map Window I've named Main?"

Any help greatly appreciated...

Thanks, Dave


This email and any attached files are confidential and copyright protected.
If you are not the addressee, any dissemination of this communication is
strictly prohibited. Unless otherwise expressly agreed in writing, nothing
stated in this communication shall be legally binding.



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 10917

Reply via email to