one problem is that you're passing the virtual wndProc function into the RegisterClass. You can not pass a C++ virtual function into a windows API. It must be a C style function (global or static). Yes, unfortunately this means you do not have a "this" pointer inside that Wndproc but that can be obtained from the hwnd. SetWindowLongPtr and GetWindowLongPtr allow you to store a pointer in the HWND. Look up the GWLP_USERDATA variable. You can store the pointer to your class in that.

edit:
beat me to it.

Well I explained it a little bit anyway.