right so I'm new to creating windows applications as I have mostly used console up until this point. I'm confident with the ideas and understand OOP and have been using MSDN to create a simple window.
As you can see the characters used are not the same. Using MSDN I've found that the character set for LPCSTR is ANSI and I'm fairly sure VS uses Unicode so I'm not sure if that is the issue or not
If anyone can tell me why that would be great!


You are explicitly using the
Aversion of functions when registering and creating your window (RegisterClassExA()andCreateWindowExA(), respectively), but you are using theTCHAR-basedDefWindowProc()macro when specifying your window procedure. You are likely compiling your project withUNICODEdefined, thus theDefWindowProc()macro would map to theDefWindowProcW()function instead ofDefWindowProcA().This mismatch will cause the behavior you are seeing, as explained in Raymond Chen's blog article:
Why am I getting mojibake when I try to create a window?
The solution is to use
DefWindowProcA()explicitly instead, to match with the rest of your code logic: