Disable shutdown confirmation

J

Jared Holzman

Hey All,

I've got a headless embedded device running XPE SP1 and am using the
ACPI Power Button to shutdown the device cleanly when I want it to turn
off. I'm also using Remote Desktop to administer the device, but I've
discovered after I've logger in via Remote Desktop, the power button no
longer appears to shutdown the device. After plugging in a monitor, I've
discovered the reason is that after an RDP login the following dialog
appears on pressing of the power button:

"Other people are logged on to this computer. Shutting down Windows
might cause them to lose data.

Do you want to continue shutting down?"

How do I disable this confirmation?

TIA,
Jared
 
J

Jared

Slobodan,

Thanks! That EnableDefault Response setting solved the problem nicely, now perhaps you can
help me with another one.

My program uses SetConsoleCtrlHandler so it can be notified when the power button is pressed
and clean itself up before the shutdown occurs. Unfortunately this only seems to work some
of the time. Sometimes pushing the power button causes the program to get killed immediately
without notification. This causes a problem as my program uses the watchdog on the CPU card
and this will fire before windows finsihes shutting down resulting in the device resetting
and restarting rather then shutting down as intended. The call to setconsolectrlhandler does
not fail as this would be logged at the console so I'm not sure why the notification doesn't
always work. I am using winlogon and the explorer shell and am starting my program from the
HKLM\Software\Microsoft\Windows\CurrentVersion\Run key.

It usually seems to fail following a system reset rather than a shutdown, of course this
then causes the system to reset the next time resulting in a self perpepuating condition.
I have found that if I beleive this condition has occured and I manually restart the program
from the local console then it will behave correctly. Of course I'm never sure if the
condition has occured until I push the power button and observe what happens, so it could
just be coincidence.

TIA,
Jared
 
K

KM

Jared,

Do you process CTRL_SHUTDOWN_EVENT in your own HandlerRoutine?
Actually, accroding to SDK (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/handlerroutine.asp) this
signal is intended to be received only by services. Interactive applications are terminated at logoff, so they are not present when
the system sends this signal. I guess if you make a service that installs its own HandlerRoutine, it should work stable.

You can also try and lower the shutdown range for your current app with SetProcessShutdownParameters API so it get time to process
that signal. (http://msdn.microsoft.com/library/d...dllproc/base/setprocessshutdownparameters.asp)

KM
 

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