It IS possible in graphics mode, it's how I did it for Easter Bonus etc. You have to make windows API calls and use BlitzClose.dll to detect the close happening. I'm sure that it's easier with create window though.
Have a look at this:
http://www.blitzbasic.com/Community/posts.php?topic=58413#649712
Have a look at this:
http://www.blitzbasic.com/Community/posts.php?topic=58413#649712