Event-handler for ToolWindow.Closed

Hi all,

I want to use an Event-handler to detect the closing of a ToolWindow.
See here an extract of my code:

public static void AddinMain()
{
(...)
this.tw = new ToolWindow("toolwindow");
this.tw.Closed += new EventHandler(toolwindow_close);
}

void toolwindow_close(object sender, EventArgs e)
{
Logger.AddMessage(new LogMessage("ToolWindow closed"));
}

But it does not work at all, the event method is not even called, it seems that RS does not detect the closing of the toolWindow at all.

(I hope I am right to say ‘Closing the ToolWindow’ when I click on the X in the top-right corner. That is what I want to detect.)

Can anybody help me?
Thanky you!