Second, the conceptual model of MFC
We have studied the "domain model" of the WIN32 API, and have a more comprehensive understanding of it. Next, we focus on the research on the app framework for the study of the MFC conceptual model.
The message response/delivery mechanism in the app framework is the most important. The hook mechanism is closely related to the message response/transfer mechanism, and the latter is based on the former.
1. Hook mechanism
Perhaps some programmers only know the hook mechanism can be written very "cow" application, who do not know MFC itself is relying on the hook mechanism.
As you can see from the diagram, each hook has a pointer queue, each pointing to a hookproc function called the hookproc that will be executed at the right time by the OS call. Hooks are different types of hooks, but the type of hook determines when it is executed by the OS call. Tip, you can look at the Subscribe-Publish design pattern to help you understand.