I'm not sure whether this might be the trick, but I have learned the hard
way that using any kind of windows or dialogs in the system handler
procedures can be fatal for you program.
Another thin with this WinClosedHandler is that as I remember it it isn't
called before this window actual is closed but after it has been closed.
That might also explain your problem asking questions on this window: It
doesn't exist anymore !
And what you are looking for here is detecting whether a certain window was
closed. This must mean that you know which windowid you are looking for ?
So try this:
'**This variable holds the ID of your window
Dim mnMyParticularWindow As integer
Sub WinClosedHandler
Dim iWinID As Integer
iWinID = CommandInfo( CMD_INFO_WIN )
if iWinID = mnMyParticularWindow Then
'**My window was closed
'**Why did you do that you .....
'**I'll show you, now you'll have to start all over again,
he he
End MapInfo
'**or whatever command you need to run
end if
End Sub
Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
COWI A/S
Rug�rdsvej 55
DK-5000 Odense
Denmark
Tel +45 6313 5013
Direct +45 6313 5008
Mob +45 5156 1045
Fax +45 6313 5090
E-mail [EMAIL PROTECTED]
http://www.cowi.dk
COWI GIS konference afvikles i dagene d. 2.-3. september.
Se yderligere oplysninger p� www.cowi.dk/Div04/Profiles/nyheder.asp
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 11, 2003 2:07 AM
> To: [EMAIL PROTECTED]
> Subject: MI-L Working with WinClosedHandler
>
>
> I want to detect if the user has closed a particular window, so I
>
> ...
> Set Handler WinClosedHandler On
> ...
>
> Sub WinClosedHandler
> Dim iWinID As Integer
> iWinID = CommandInfo( CMD_INFO_WIN )
> Print iWinID
> End Sub
>
> Which prints '4' to the message window. Now, I want to check
> the name of the
> window, but WindowID(iWinID) says the window is not defined.
>
> Is it too late to get the window name after it closes?
>
> Thanks,
>
> Mike
>
>
>
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine |
> www.directionsmag.com | To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> Message number: 7593
>
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 7596