Q:
How can I veto quit in AutoCAD?
A:
There are two situations to consider:
1) Subclass the AutoCAD main frame and watch for WM_CLOSE message. This message is generated when user tries to quit AutoCAD using any of the possible methods. In the sample, we veto the quitting of AutoCAD, but this can be modified to make changes in the documents, save them and then allow AutoCAD to quit. This way you can avoid the save dialog while quitting AutoCAD.
2) Using the event AcApDocManagerReactor::documentLockModeChanged() to trap the EXIT command that the user can issue at command prompt.
The attached arx sample implements both approaches.

Leave a Reply