Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hi.. in the MSDN library i see t

Status
Not open for further replies.

jmnagi

Programmer
Oct 17, 2002
47
0
0
GB
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
 
You do that like this:

if(lParam & ENDSESSION_LOGOFF) {
do your stuff
}
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top