Solved it. A couple of LongPtrs missing. One on the return value of the DefWindowProc declaration and another on the lParam on the WndProc function.