It's kinda hard to read the text in your screenshot but as far as I can distinguish you are calling "CreateWindowEx" and the last parameter is "ObjPtr(Me)" for some reason. MSDN says that parameter must be a pointer to window-creation data. Pretty sure you should put zero in there and it will work correctly.