The example that I provided you was only suggestion to bind to a class. With this, you could bind to all windows.
But it is strange because when you create one window you could bind an event to it in the moment of the creation.
Could you clarify it? It will be better if you could provide us with a simple example that demonstrates this case.