....How can I quit an application when Win95/98 is about to shutdown or log-off ? The application has no window handles associated with it, and I do not want to hook window calls to see whether a WM_QUERYENDSESSION OR WM_ENDSESSION message has been sent. Basically, it is a multithreaded application and it needs to terminate when the user has logged off or the computer is being shutdown. Is there any other way of doing this ? (It needs to be a clean method ! No dodgy code !, pref. in c plz. or any ideas would be appreciated...).