Purpose
A reserved procedure name, called automatically when MapInfo Pro receives the focus (becoming the active application) or loses the focus (another application becomes active).
Syntax
Declare Sub ForegroundTaskSwitchHandler
Sub ForegroundTaskSwitchHandler
statement_list
End Sub
statement_list is a list of statements.
Description
If the user runs an application containing a procedure named ForegroundTaskSwitchHandler, MapInfo Pro calls the procedure automatically whenever MapInfo Pro receives or loses the focus. Within the procedure, call the CommandInfo() function to determine whether MapInfo Pro received or lost the focus.
Example
Sub ForegroundTaskSwitchHandler
If CommandInfo(CMD_INFO_TASK_SWITCH)
= SWITCHING_INTO_MAPINFO Then
' ... then MapInfo just became active
Else
' ... another app just became active
End If
End Sub
See Also:
CommandInfo() function