How to block a user shutdown or logoff?
-
Hello everybody! I would like to know if there is any way to block a user from shutting down or logging off the system. Or atleast postpone the shutdown process for a particluar time interval. Is it possible to do that? I humbly request to respond me! Thanks in advance! regards, Shalini
-
Hello everybody! I would like to know if there is any way to block a user from shutting down or logging off the system. Or atleast postpone the shutdown process for a particluar time interval. Is it possible to do that? I humbly request to respond me! Thanks in advance! regards, Shalini
Handle
WM_QUERYENDSESSION
message is your application. returnFALSE
to stop the shutdown of logoff process.if (message == WM_QUERYENDSESSION)
{
if(allow)
{
return TRUE;
}
else
{
return FALSE;
}
}Prasad Notifier using ATL | Operator new[],delete[][^]
-
Hello everybody! I would like to know if there is any way to block a user from shutting down or logging off the system. Or atleast postpone the shutdown process for a particluar time interval. Is it possible to do that? I humbly request to respond me! Thanks in advance! regards, Shalini
-
Hello everybody! I would like to know if there is any way to block a user from shutting down or logging off the system. Or atleast postpone the shutdown process for a particluar time interval. Is it possible to do that? I humbly request to respond me! Thanks in advance! regards, Shalini
Handle WM_QUERYENDSESSION and return false from there.. then shutdown the window using InitiateSystemShutdown api
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you