Ok took another look and the problem narrowed down to WndProc, when instead of you're WindProc DefWindowProc is used it works