I found a couple of articles telling me how to make use of the WM_CLOSE message but never the less my application is the one who has to handle the WM_CLOSE message.
Is there a way to hook up the WM_CLOSE and handle it? Because the WM_CLOSE only closes the tray icon but does not terminate the process itself ...
Regards,
To do this you need to override the WndProc
method on the Form
which is the main tray icon and handle WM_CLOSE
private const int WM_CLOSE = 0x0010;
protected override void WndProc(ref Message m) {
if (m.Msg == WM_CLOSE) {
// Close everything
}
base.WndProc(ref m);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With