Windows ProgramWorking Principle
Windows program design is a program design method completely different from the traditional dos method. It is an event-driven program design mode. There are many operable visual objects in the interface provided by the program to the user. The user selects any of all possible operations. The selected operation will generate some specific events. After these events occur, the message will be sent to some objects in the program, then these objects call corresponding message processing functions to complete specific operations. A Windows application has no fixed process, but a specific sub-process for processing an event. A Windows application consists of many such sub-processes.
Event (mouse click on some button) --> message (generate a message based on the event and pass it to some objecte) --> message handler (Message handled)
From the above discussion, we can see that Windows applications are object-oriented in nature. The visual object provided by the program to the user interface is generally an object inside the program. The user's operations on the Visual Object trigger the available methods of the corresponding object through the event-driven mode. The running process of a program is the process in which external operations of users continuously generate events and these events are processed by corresponding objects.