I was recently asked how/if possible that one could do this. I am not sure if it is even possible, and I have been searching on it for a while now.
Basically let's take Windows
for example there is a system command to shut down the computer. Let's say shutdown -s -t 30 -c "Shutdown"
Is there a way to write a program which will listen for a shutdown
command, and then run shutdown -a
in response to abort that command?
In short, can you make it listen for certain system commands on the computer and execute system commands in response?
WM_QUERYENDSESSION
. When you get that you could proactively callshutdown -a
. Check this page out for more details on API hooking codeproject.com/Articles/2082/API-hooking-revealed – Scabbleshutdown
command at Windows level. There is a Windows programShutdown.EXE
, which knows which fundamental Windows API to call. But it's not the only program which knows this. E.g. Explorer.EXE (responsible for the start menu) knows it as well. So detectingshutdown.EXE
would not affect Explorer.EXE shutting down. – Glazed