Hi all
In normal situration, when press Power Button, operation system goes to shutdown
But how can i write a program to let Power Button function fail ?
is this need any driver support ?
TKS
Posted on 2005-10-07 02:19:03 by jordanc
I have built a filter driver just for that purpose.

I have a bad keyboard where the Power/Sleep/Wake keys are in a really uncomfortable position, and frequently I pressed them by accident. The filter driver that I wrote is based on kbfiltr example from Win2000 DDK, and it changes some system properties of the keyboard device.

I will post it here once I get home.
Posted on 2005-10-07 11:50:28 by comrade
You are talking about the system Power Button on the front of your system case?

What do you want to do ?  Because you are going to forcing the user to use the power cord removal method for power control, which I don't recommend.  In shutdown, apps do get a message so they can clean up.

Regards,  P1  8)
Posted on 2005-10-07 12:35:12 by Pone

What do you want to do ?  Because you are going to forcing the user to use the power cord removal method for power control, which I don't recommend.  In shutdown, apps do get a message so they can clean up.

Even if the ATX powerbutton message is ignored, the user can still keep the button pressed for 3-5seconds, which will force a shutdown anyway.
Posted on 2005-10-07 12:44:51 by f0dder

Even if the ATX powerbutton message is ignored, the user can still keep the button pressed for 3-5seconds, which will force a shutdown anyway.
This is true.  But the point I was making, users need some TLC from the programmer so that they do not shoot our programs in the foot.    :shock:

Regards,  P1  8)
Posted on 2005-10-07 13:09:41 by Pone
Here is the project. It disables some kind of power-control bits for the keyboard device. Perhaps you can find a way to do it for the whole system.
Attachments:
Posted on 2005-10-07 15:52:14 by comrade
thanks Comrade's sample, i'll try it
And my question is no consider for hardware shutdown
since press power button 4 second shutdown is hardware operation
not control by operation system
Posted on 2005-10-07 21:40:31 by jordanc