| View previous topic :: View next topic |
| Author |
Message |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Dec 28, 2006 4:15 am Post subject: Detect shutdown, reboot, standby, etc. |
|
|
Is there a way using VDS that I can tell when the computer is about to shutdown, reboot, standby, etc. ? I need to have a program run a command before these happen.
Thanks _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Thu Dec 28, 2006 4:41 am Post subject: |
|
|
OPTION SHUTDOWN, _________________ cheers
Dave |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Dec 28, 2006 3:25 pm Post subject: |
|
|
Forgot about that. Now how about standby, would the same event go off? _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Thu Dec 28, 2006 6:17 pm Post subject: |
|
|
You could experiment with this.
| Code: | OPTION MSGEVENT,$16,WM_ENDSESSION,HANDLED
OPTION MSGEVENT,$218,WM_POWERBROADCAST,HANDLED
OPTION SHUTDOWN,SHUTDOWN
:WM_ENDSESSION
REM Write code to handle user logoff event then end the app.
Stop
:WM_POWERBROADCAST
REM Write code to handle System Standby notification
:SHUTDOWN
REM Write code to handle System Shutdown then end the app.
Stop |
|
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Dec 28, 2006 6:20 pm Post subject: |
|
|
Sweet. I'll give it a try. Thanks _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
|