Is there a class/example application for a message-only window that is in C++ Win32?
If I recall, the standard solution is to create a basic styleless window with a message pump as you normally would, but never call ShowWindow on it. This way you can receive and process the standard messages like WM_QUERYENDSESSION which are sent to all windows.