Override Power Button

B

BattleAngel444

Hi All

I was wondering if there is a way to override the power button on my
embedded device? I have a very delecate database (DB) that needs to be
shutdown in a specific way. I have a script that does it and
everything is just fine if you softshut down from my custom GUI. Which
pretty much closes safely exits out of all my processes and DB and then
issues a shutdown -s -t 0

The problem arrises when someone comes up and hits the physical power
button and Windows will do the typical studown and prompts you to end
services etc. This is undesired and will corrupt my DB.

I am not familiar with what windows does if the power button is pushed.
If it was as simple as to issue a shutdown -s -t 0 then it would be
easy for me to replace shutdown.exe with my own custom shutdown.exe and
no one would be the wiser... but something tells me Windows is a little
more sophisticated than that.

To sum it up... I want to be able to shutdown my embedded device in a
specific way so that the DB does not become currupt. I need to
override the way windows shutsdown when the power button is pushed, so
that i can close out everything and properly save all element in my DB
before actually shutting down.

thanks for your time
 
A

Adora Belle Dearheart

BattleAngel444 said:
Hi All

I was wondering if there is a way to override the power button on my
embedded device? I have a very delecate database (DB) that needs to be
shutdown in a specific way. I have a script that does it and
everything is just fine if you softshut down from my custom GUI. Which
pretty much closes safely exits out of all my processes and DB and then
issues a shutdown -s -t 0

The problem arrises when someone comes up and hits the physical power
button and Windows will do the typical studown and prompts you to end
services etc. This is undesired and will corrupt my DB.

I am not familiar with what windows does if the power button is pushed.
If it was as simple as to issue a shutdown -s -t 0 then it would be
easy for me to replace shutdown.exe with my own custom shutdown.exe and
no one would be the wiser... but something tells me Windows is a little
more sophisticated than that.

To sum it up... I want to be able to shutdown my embedded device in a
specific way so that the DB does not become currupt. I need to
override the way windows shutsdown when the power button is pushed, so
that i can close out everything and properly save all element in my DB
before actually shutting down.

thanks for your time

On the units I have here, if I use Standard PC rather than ACPI PC etc,
the power button no longer does anything. Anyother way to kill it
involves changing the registry so that there's no shut down available
when you hit 'start' - that seems to disable it even if ACPI PC is used.
 
B

BattleAngel444

well I don't want to kill the functionality of the power button... I
just want to edit the functionality.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top