[python-win32] catching the "close" event

Mark Hammond skippy.hammond at gmail.com
Thu Feb 12 21:59:16 CET 2009


On 13/02/2009 5:59 AM, Pollack, Steven K wrote:
> I am trying to write a python based glue to orchestrate interaction
> between Access, Excel and Outlook.
>
> I understand events reasonably well, can DispatchWithEvents an instance
> of excel and catch worksheet and file save related events. but can’t
> figure out if there is an event I can catch associated with the “close”
> button (the little ole red x) that I can trap and or cancel before the
> application dies. I want to force a file save first.

Each application defines its own events - so I'm afraid this depends on 
exactly what object you are talking about.  There is no generic 
mechanism triggered when a COM object, or its window is closed.

Mark


More information about the python-win32 mailing list