You call DispatchMessage so that the message is delivered to the appropriate window, in its "proc window". You think that you have only one window, but is it really the only one? COM will create auxiliary windows, other subsystems can also create auxiliary hidden windows that will deliver messages sent to the general message queue and addressed to these windows. Without thinking about these details, you have an API to send them. And you have to do this because these subsystems rely on the presence of messages.
Spy++ The Windows SDK tool will help you find out how many windows you have.
However, if you really have a single window, it doesnβt really matter if the handler is called from internal DispatchMessage services or directly using your message pump.
Roman R.
source share