hi..
in the MSDN library i see that WM_QUERYENDSESSION is sent when an application calls ExitWindows function. A window receives this message through its WindowProc fuction.
The lParam value in its argument will indicate whether the user wants to log-off or shutdown.
Also, the library suggests that i perform a BITWISE operation to check if lParam value includes ENDSESSION_LOGOFF or SHUTDOWN.
can anyone tell me how to do this ? please reply as soon as you possibly can. thanks. i DON'T KNOW WHAT VALUES TO COMPARE !
this is what i have in win 2000:
if (lParam == 0) /* system is shutting down */
{
...
clean up everything ..
...
}
else /* user is logging off */
{
...
do something else
...
}
in Win 2000 i am able to clearly identify if the user is logging off or shutting down. i thought it will work fine in XP as well ..
but in XP the code always identifies it as a shutdown .. MSDN library says that i should check for ENDSESISION_LOGOFF and do a bitwise comparison .. but i am not sure how. --
br: nagi
in the MSDN library i see that WM_QUERYENDSESSION is sent when an application calls ExitWindows function. A window receives this message through its WindowProc fuction.
The lParam value in its argument will indicate whether the user wants to log-off or shutdown.
Also, the library suggests that i perform a BITWISE operation to check if lParam value includes ENDSESSION_LOGOFF or SHUTDOWN.
can anyone tell me how to do this ? please reply as soon as you possibly can. thanks. i DON'T KNOW WHAT VALUES TO COMPARE !
this is what i have in win 2000:
if (lParam == 0) /* system is shutting down */
{
...
clean up everything ..
...
}
else /* user is logging off */
{
...
do something else
...
}
in Win 2000 i am able to clearly identify if the user is logging off or shutting down. i thought it will work fine in XP as well ..
but in XP the code always identifies it as a shutdown .. MSDN library says that i should check for ENDSESISION_LOGOFF and do a bitwise comparison .. but i am not sure how. --
br: nagi