Hi
You can loop through the open windows, detects the map windows and finally see if it's the FrontWindow() or not.
Something along these lines:
Dim nWIn, nFirstMID, nSecondMID As Integer
For nWin = 1 To NumWindows()
If WindowInfo(WindowID(nWin), WIN_INFO_TYPE) = WIN_MAPPER Then
If WindowID(nWID) = FrontWindow() Then
'Ah, we found the front map window
nFirstMID = WindowID(nWin)
Else
'Ah, we found the other map window
nSecondMID = WindowID(nWin)
End If
End If
Next
Now you have the ID of the two windows stored in two Integer variables
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------
Original Message:
Sent: 06-30-2022 11:07
From: A Oliver
Subject: Selecting Map Window using Mapbasic
Hallo, all
I hope someone can help me.
We have a Mapbasic program that works its way down a MapInfo Table and re-centers the map window based on values in each record in the table. It then saves a new named workspace after each record.
The program opens a template Workspace with a Map Window as the Front Window
It then sets the centre easting and northing and zoom width based on values in the table
set map window frontwindow() center (iCOP_east, iCOP_north)
set Map window frontwindow() zoom iWidth Units "m"
We are then trying to centre and size a second Map Window in the same Workspace which is not the Front Window.
How do we write the Mapbasic to specify that we want to Change View for that second Map Window?
We are using Mapbasic 15 and MapInfo Pro 15.0.3.
Thank you,
Alan.
------------------------------
A Oliver
West Midland Police
BIRMINGHAM
------------------------------