There is a WPF application.
i want to log when the application is closed.
but i cannot modify the application (some restriction, just because business).
So i create an invisible form component live inside the existing application, add as a dll library, so the existing application do not need to be modified.
but the issue is, how can my invisible component know the application is shutting down?
is there some function or event handler i can use?
Solution:
there are some event can do that,
UnLoaded Closing Closed
all these three events will be fired when the main windows is going to be closed.
Problem solved