HI,

Last week, I ask the list a question (in French), now, this is the answer I
found (In a bad english).


I make this little program :

-----
Declare Sub WinChangedHandler
Declare Sub Main

Sub Main

End Sub

Sub WinChangedHandler
  Note "Agence de Lyon"
End Sub
-------

The problem was :

1, If I open a Map and I run the program, ther is no problem...

2, If I run the program without an open map,  and after, I open a map,
MapInfo crash... :-(


I found this solution :

-------------

Include "MapBasic.Def"
Declare Sub Main
Declare Sub WinChangedHandler
Declare Sub Winfocuschangedhandler 
Declare Sub WinClosedHandler 


Sub Main
    set handler Winchangedhandler off
End Sub


Sub WinChangedHandler
  Note "Agence de Lyon"
End Sub

Sub Winfocuschangedhandler
  Dim i_win_type As SmallInt 
  CLS
  i_win_type=WindowInfo(CommandInfo(CMD_INFO_WIN),WIN_INFO_TYPE)

  If i_win_type = WIN_MAPPER  Then 
       set handler Winchangedhandler on
   Print "ON"
  Else
       set handler Winchangedhandler off
  Print "OFF"
  End If 
End Sub


Sub WinClosedHandler 
  CLS
       set handler Winchangedhandler off
  Print "OFF"    
End Sub 
------------


That's not very "elegant" but it works !

Thank's for their messages :
- Eric [[EMAIL PROTECTED]]
- Franz-Josef Behr [[EMAIL PROTECTED]]
- Jacques Paris [[EMAIL PROTECTED]]
- Samuel SCHEMBRI[[EMAIL PROTECTED]]



Bruno Granger
The city Town planning Agency for the Lyon conurbation



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to