I do include windows.h, and I believe I'm using SendMessage from the global namespace. Make sure you're linking with user32.lib. A default windows project should already link to this, but this is the only library that MSDN says to import for SendMessage.