I wrote:
> If you want to intercept map window closure BEFORE the prompt you need
> to do something along the lines of the code following this message.
That'll teach me to compose MapBasic in an email client without testing it!
The code below is a bettr example.
HTH
Spencer
----------------------------------------------------------------------------
------
include "mapbasic.def"
include "menu.def"
declare sub main
declare sub goodbye
declare sub CloseThisMap
declare sub WinFocusChangedHandler
declare sub EndHandler
declare sub CheckWinOff (ByVal w as integer)
declare sub CheckAllOn
sub main
dim nw, ww as smallint
alter menu "MapperShortcut" add "Close" calling CloseThisMap
create menu "Intercept" as "Exit" calling goodbye
alter menu bar remove "Help"
alter menu bar add "Intercept", "Help"
nw=NumWindows()
if nw > 0
then for ww = 1 to nw
call CheckWinOff (WindowID (ww))
next
end if
end sub
sub goodbye
call CheckAllOn
end program
end sub
sub WinFocusChangedHandler
dim w as integer
call CheckWinOff (CommandInfo (CMD_INFO_WIN))
end sub
sub CheckAllOn
dim nw, ww as smallint
dim w as integer
nw = NumWindows()
if nw > 0
then for ww = 1 to nw
w = WindowID (ww)
if WindowINfo (ww, WIN_INFO_TYPE) = WIN_MAPPER
then set window w SysMenuClose On
end if
next
end if
end sub
sub CheckWinOff (ByVal w as integer)
if WindowInfo (w, WIN_INFO_TYPE) = WIN_MAPPER
then set window w SysMenuClose Off
end if
end sub
sub CloseThisMap
dim m as integer
m = FrontWindow()
close window m ' <---- no prompt!
end sub
_______________________________________________________________________
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.