I found a solution and posted it into another forum: http://www.codeguru.com/forum/showthread.php?t=442396
I'm having a hard time to handle the WM_QUERYENDSESSION and WM_ENDSESSION messages correctly. I'm always ready to shutdown so I always return...
Separate names with a comma.