forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Detect shutdown, reboot, standby, etc.

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Dec 28, 2006 4:15 am    Post subject: Detect shutdown, reboot, standby, etc. Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Thu Dec 28, 2006 4:41 am    Post subject: Reply with quote

OPTION SHUTDOWN,
_________________
cheers

Dave
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Dec 28, 2006 3:25 pm    Post subject: Reply with quote

Forgot about that. Now how about standby, would the same event go off?
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Dec 28, 2006 6:17 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Dec 28, 2006 6:20 pm    Post subject: Reply with quote

Sweet. I'll give it a try. Thanks
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group