如何拒绝关机时pressing电源键一会儿? [英] How to deny shutdown when pressing the power button for a while?

查看:215
本文介绍了如何拒绝关机时pressing电源键一会儿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在大多数较新的计算机,您可以关闭由pressing电源按钮几秒钟艰辛的道路。但我想prevent这完全。

你能prevent喜欢睡软一些事件,暂停,休眠,并在Windows控制面板的preSS电源按钮时的事件;你也可以使用一些Win32和WDI程序捕获并处理/否认这些事件,但它似乎并没有停止的机械断电的当你持有较长时间的按钮。

我猜电源按钮被硬连接到电源,从不等待操作系统,当你按住几秒钟?或者是有一些方法,以prevent即使这种情况下,由code?

我是一个.NET开发人员。

  

Whooaaa ...!很多你真的认为不这样做 - 你不   拥有我的电脑或我的操作系统, - 你   开发天网等:)这   应用程序是高度定制,   对于某些客户闭解。   这是在自定义亭应用   在Windows XP的硬件上运行   嵌入式和使用触摸屏。其   不公开的。

解决方案

请参阅ACPI规范的62页相对于4秒规则(<一href="http://www.acpi.info/DOWNLOADS/ACPIspec30b.pdf">http://www.acpi.info/DOWNLOADS/ACPIspec30b.pdf)

龙和它的短是其逻辑是在硬件上。

On most newer computers you can shutdown the hard way by pressing the power button for a couple of seconds. But I want to prevent this completely.

You're able to prevent some soft events like the sleep, suspend, hibernate and "Press power button" events in Windows control panel; you can also use some Win32 and WDI programming to catch and handle/deny those events but it doesn't seem to stop the mechanical power off when you hold the button for a longer time.

I guess the power button is hard-wired to the power supply and never waits for the OS when you hold it down for some seconds? Or is there some way to prevent even this case by code?

I'm a .NET developer.

Whooaaa...! Lots of you really argued for not doing this - "You don't own my computer or my OS", - "are you developing SkyNet" etc :) This application is a highly customized and closed solution for some customers. It's a kiosk application on customized hardware running on Windows XP Embedded and use a touch screen. It's not public.

解决方案

See page 62 of the ACPI spec in relation to the 4-second rule (http://www.acpi.info/DOWNLOADS/ACPIspec30b.pdf)

Long and the short of it is that the logic is in hardware.

这篇关于如何拒绝关机时pressing电源键一会儿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆