Click to See Complete Forum and Search --> : Program not terminating on WM_ENDSESSION


Volker Annuss
April 28th, 1999, 02:18 AM
Hi all,

my MFC program does not terminate when I logout from Windows NT 4.0. Instead I get a MessageBox from the operating system: "This Application does not respond to 'terminate task' " ("Diese Anwendung reagiert nicht auf die Anforderung 'Task beenden' ").

However I can stop it by starting another Program executing the following code:

HWND hwnd = (HWND)0xf0ab0230; // Window handle from Spy++
::PostMessage( hwnd, WM_QUERYENDSESSION, 0, ENDSESSION_LOGOFF );
::PostMessage( hwnd, WM_ENDSESSION, TRUE, ENDSESSION_LOGOFF );

The program does not use any special code to handle WM_QUERYENDSESSION and WM_ENDSESSION.

Does anyone have an idea, what might go wrong or what else I can do to debug this?

Thanks

Volker