If you use MFC, the architecture takes care of routing your events as long as you use what are called Message Maps. You have to tell MFC what function to call when a certain event occurs, and the rest is done by MFC.
For instance, you map a function to an event like File --> Open through the Message Map. Then, when a user of your application triggers the File --> Open event by opening the File menu and choosing Open, the MFC architecture will call the function that you specified in the Map. Of course, the code inside your function can do what's required at that point and has nothing to do with messages anymore.
Here is the Message Map from the Application class (e.g., Lesson1.cpp) of our basic MFC program:
// Standard file based document commands
// Standard print setup command
You'll see that the File --> Open event is linked to the CWinApp function OnFileOpen() here:
You can map an event to any function you like in the Message Map.
Hope that helps. Let me know if you have more questions.