That .cpp/.c file where you entered that code, make sure you add it to the project. Right Click on the Solution Explorer and choose "Add". Once the file shows up there it should be compiled and linked.
Most important is that you pass ALL of them on to DefWindowProc unless you explicitely handle it and the docs say you can return a specific value from your WndProc.