This is not only for your own benefit, COM requires that you create a message loop. COM requires it to handle threaded COM servers, an expensive word for "components that do not support multithreading." The vast majority of them do not.
Itโs best to create a window; it should not be visible. This gives you an HWND that you can use in your SendMessage () calls. The window procedure you are writing can process messages. From there it is easy to create a minimal user interface, for example, using Shell_NotifyIcon. It is always nice when you can display a notification when something goes wrong. So much better than an event in a magazine that no one ever looks at.
source share