Hi.
I want to stop shutdown while my software is working. If anyone is pressing shutdown button my application have to prompt a message showing "whether u want to shutdown(Yes) or not(No)" If we press YES then only my computer have to shut down.


I did with Platform SDK help but not working. Can u give sample

case WM_QUERYENDSESSION:
{
int r;
r = MessageBox(NULL, "Shut down?","WM_QUERYENDSESSION", MB_YESNO);

// Return TRUE to allow shutdown, FALSE to stop.

return r == IDYES;
break;
}

THe above code i tried but didnt get any idea. Please help

Thanks in advance