I’ve written a console application that basically fires one BackgroundWorker that supports ReportProgress and Cancel.
How can I make sure that before a window is closed (by pressing the close button or pressing ctrl+c) the cancel operation is triggered on my thread and the window only closes after the cancel is completed?
See the question “How do I trap ctrl-c in a C# console app.”