开发者

Is it possible to block ExitWindows or ExitWindowsEx?

I'm using a corporate workstation, and my IT department keeps using programs to restart my PC without my permission. I've asked them to stop, but they don't how how - typical.

Anyway, I figured there must be a way of preventing (malicious?) programs like these from resta开发者_如何学编程rting my PC... So how about preventing ExitWindows or ExitWindowsEx from being called? I assume this is what they'll be using, but I'm not sure how to find out.

Is this a good solution, or should I just move to another company?

Update 1:

Just thinking about this from another angle - is it possible to tell which program is making a call to ExitWindows or ExitWindowsEx? This way I can log the process name, and then write a small program to blacklist the offending program (i.e. kill it whenever it appears).


On < Vista, you can handle WM_QUERYENDSESSION, on Vista+, you need to use ShutdownBlockReasonCreate in addition to WM_QUERYENDSESSION.


You can stop it by running shutdown /a on the command-line once you see the System Shutdown dialog.


If you have the appropriate rights, use shutdown -a to abort a scheduled shutdown; alternatively, write a small program that catches WM_QUERYENDSESSION and answers with zero.

But I think the real problem here is your IT department interrupting your work. Talk with your manager before you take any other action, and make sure she understands that this is impacting your performance.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜