The problem is that you are sending the messages to the main Notepad window. That's the top-level window that has the caption bar. The messages will be processed by the EDIT control that is a child of the top level window. You can only make this work by sending the messages there.
However, I'm sure that your real problem is different from faking keyboard input to the Notepad program. And your real problem is most likely best solved a different way. Windows provides UIAutomation for the purpose of automating applications. That is most likely the right solution to your actual problem.