开发者

Windows 2003 Server and Remote Desktop problems with WM_QUERYENDSESSION

开发者 https://www.devze.com 2022-12-18 16:00 出处:网络
I\'m experiencing a weird problem with a little app I wrote to detect Windows shutdown. Using Remote Desktop to connect to a Windows 2003 server, sometimes upon 开发者_Go百科login I get the WM_QUERYE

I'm experiencing a weird problem with a little app I wrote to detect Windows shutdown.

Using Remote Desktop to connect to a Windows 2003 server, sometimes upon 开发者_Go百科login I get the WM_QUERYENDSESSION from the OS with lParam = 0, which my app interprets as a shutdown request (as stated in http://msdn.microsoft.com/en-us/library/aa376890%28VS.85%29.aspx) and, as a consequence, performs its task. Problem is, I am actually logging in, not shutting down or rebooting the system.

I think it has probably to do with session management under Windows 2003 Server, as the same tool performs quite nicely on Windows XP.

I tried limiting remote access to a maximum of 1 remote session per user, but it didn't change the behaviour.

Any hint on this?


I imagine this answer is far too late to be of any use to you any more, but for the benefit of anyone else who may have the same issue: I have used the SetConsoleCtrlHandler function successfully in the past without the same sort of unexpected false positives that WM_QUERYENDSESSION seems to be prone to. This may be worth a try.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号