Windows注销当前用户时,怎么让系统向程序发送一次WM_QUERYENDSESSION后的消息处理中告诉Windows不要再发送?
对应的消息处理函数大致是
BOOL OnQueryEndSession()
MSDN上说:
Windows stops calling the function after the function returns FALSE(0) and send message WM_ENDSESSION with wParam as 0(FALSE) for any application having returned non-zero value for this function.
出现的问题是:在OnQueryEndSession()中问用户是否要退出程序,Windows注销当前用户时,用户选择否后会继续接受到2次WM_QUERYENDSESSION,从而弹出了3次对话框
现在的问题是:不知道怎么实现send message WM_ENDSESSION with wParam as 0(FALSE) for any application having returned non-zero value for this function.以停止后两次的WM_QUERYENDSESSION发送