views:

64

answers:

1

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?

+1  A: 

See the question "How do I trap ctrl-c in a C# console app."

Jacob
Damn, missed that one.
borisCallens
Does it solve your close-button problem though?
Jacob