Basically, the windows procedure needs to be a static method to work correctly, but this is rather inconvenient as a static method has no this pointer. It also means you can only call static member variables of your class.

To get around this, you need to have a static message router. Basically a static version of the windows procedure that will route messages to a non-static version of your windows procedure.