windows_programming_notes.nbk: Home | Index | Next Page: WM_ENTERIDLE | Previous Page: WM_ENABLE


 WM_ENDSESSION

The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.

A window receives this message through its WindowProc function.

    LRESULT CALLBACK WindowProc( HWND hwnd,      // handle to window 
                                 UINT uMsg,      // message identifier 
                                 WPARAM wParam,  // end-session option 
                                 LPARAM lParam );// logoff option

Parameters

If wParam is FALSE, the application should not shut down.

Note that this parameter is a bit mask. To test for this value, use a bit-wise operation; do not test for equality.

Return Value

If an application processes this message, it should return zero.

Remarks

Applications that have unsaved data could save the data to a temporary location and restore it the next time the application starts. It is recommended that applications save their data and state frequently; for example, automatically save data between save operations initiated by the user to reduce the amount of data to be saved at shutdown.

The application need not call the DestroyWindow or PostQuitMessage function when the session is ending.

Requirements


windows_programming_notes.nbk: Home | Index | Next Page: WM_ENTERIDLE | Previous Page: WM_ENABLE


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time