How to close all open resources if I need to abort the application with task manager

I am testing an application that is hanging and requires me to abort it using the task manager.
Is there anyway I can force the application that I am killing, to close all open resources.  It opens a copy of Word and Outlook as part of its processing.  They are left running and require me to manually stop them with Task Manager.

I am also not sure if the application  is closing the trace file.  I do have trace.autoflush = true.  So I think it is showing me the last trace message
castlegrpsfAsked:
Who is Participating?
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
you have to implement the Application.Exit event:
http://msdn2.microsoft.com/en-us/library/system.windows.application.exit.aspx
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
All Courses

From novice to tech pro — start learning today.