>Is there a message that Windows sends out? In that case, I could use >PeekMessage. Try windows mesages, WM_QUERYENDSESSION and WM_ENDSESSION You can read about them on MSDN or this usefull link I got from list awhile ago. <http://www.sxlist.com/techref/os/win/win32prg.htm>
If you get this to work please post result. JohnR