Forcing Shutdown...?

ImmortalWarrior
07-19-2003, 05:24 AM
How would I force my PC to shut down?
I'm making an app that reads when my winamp playlist is finished and shuts down the computer cos I'm too lazy to do it in the evenings before I go to bed..
Matt

Kashif
07-19-2003, 05:35 AM
How would I force my PC to shut down?
I'm making an app that reads when my winamp playlist is finished and shuts down the computer cos I'm too lazy to do it in the evenings before I go to bed..
Matt

Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Sub command_click()
var = ExitWindowsEx(EWX_SHUTDOWN, 0)
End Sub

ImmortalWarrior
07-19-2003, 07:09 PM
Thanks, that works perfectly :)
Matt

reboot
07-19-2003, 08:06 PM
Only with Windows 9x.

ImmortalWarrior
07-20-2003, 09:50 PM
It's a personal utility on Win98 SE so that's perfect :)
Matt

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum