Close Dockable Window BEFORE close application

Discussion created by afmaps on Sep 8, 2011
Latest reply on Sep 8, 2011 by afmaps
Good afternoon/morning to all,

I want to be able to close my dockable window (opened via a toolbar button) every time the application (not document) is closed. At the moment, if the dockable window is open when arcmap is closed , when arcmap is re-opened the dockable window loads itself again. This is rather irritating for my client.

I was wishing to do this through my event listening extension i have created in my add-in project, which is persistent. I have been able to handle an ondocumentclose() and onshutdown() event in this, however only the onshutdown() will fire when the application is closed (i would have thought that since its closing the document before closing the application it would do the ondocumentclose() event first?). Alas i cannot figure out how to access the document before the application is closed.

I cant imagine that no-one else has not wanted to do this, so it would be great if someone had the answer!

Thank You