A few people have asked about how I was able to make a game in a Notepad window, as seen in Notepad Weekend. I dug out the source code and cleaned it up into a framework of sorts, which I’m posting here in case any of you would find it interesting!
The code is pretty simple, but will only work on Windows due to the extensive use of the Windows API. It uses FindWindowEx() to find an open Notepad window, SetWindowsHookEx() to set a keyboard hook so that we can catch keyboard events, and SendMessage(WM_SETTEXT) to set the text in the main text box in the Notepad window. If you wanted to launch an instance of Notepad instead of requiring the player to do it, you could presumably use ShellExecute().