Note: I tested this rather quickly in AutoCAD 2006.
Thank's MP
I thought the same, the event is the same, only started by the button in the window's corner.
You are right, the code works in R2006, but not in R2002. So i will find out when our company makes the move to Acad 2006 (I have it already for development reasons, i'm considered as the one eyed in the "Kingdom of the blind" known as the Company I'm working for ). If it is in the near future, I'll be fine, otherwise I will try something with closing the last open drawing (a sign you wanna quit acad, too, i guess)
Thanks for the help, MP