I am looking for a way to watch for specific messages sent by the system to my application. For example, I want to be able to watch for the WM_QUERYENDSESSION message and when it is received, to perform a specific action.
I am working with the python win32 extensions, but I'm sure that I could translate the equivalent code in another language.
I know how to use SendMessage to send messages to other windows, but I don't know what to use to watch for messages sent to my window.
Any help is appreciated.