Purpose
A reserved procedure, called automatically when a Map, Browse, Graph, Layout, Redistricting, Legend, MapBasic window is closed.
Syntax
Declare Sub WinClosedHandler
Sub WinClosedHandler
statement_list
End Sub
statement_list is a list of statements to execute when a window is closed.
Description
WinClosedHandler is a special-purpose MapBasic sub procedure name. If the user runs an application containing a procedure named WinClosedHandler, the application "goes to sleep" when the Main procedure runs out of statements to execute. As long as the sleeping application remains in memory, MapBasic automatically calls the WinClosedHandler procedure whenever a window is closed.
Within the WinClosedHandler procedure, you can use issue the function call:
CommandInfo( CMD_INFO_WIN )
to determine the window identifier of the closed window.
Multiple MapBasic applications can be "sleeping" at the same time. When a window is closed, MapBasic automatically calls all sleeping WinClosedHandler procedures, one after another.
See Also:
CommandInfo() function, EndHandler procedure, RemoteMsgHandler procedure, SelChangedHandler procedure, ToolHandler procedure, WinChangedHandler procedure