Click to See Complete Forum and Search --> : Forcing a ShutDown
HanneSThEGreaT
August 3rd, 2001, 02:59 PM
You can force a shutdown by doing the Following:
First declare this API function and constant
public Declare Function ExitWindowsEx Lib "user32" (byval uFlags as Long, byval dwReserved as Long) as Long
public Const EWX_SHUTDOWN = 1
Then you can call it by doing this:
Call ExitWindowsEx(EWX_SHUTDOWN, 1) 'shut down the computer
Please rate this posting if you like it
F. T. W.
Cimperiali
August 6th, 2001, 02:52 AM
I like but I am out of votes, for today (here we can rate only 5 time a day...). Let me give youa suggestion: as usually we post questions and not answers at first klevel, you should name your posts starting with:
"Re: how to..." just to signal it is not a question, but an answer.
Have a nice day, and thanks for all the sharing code job
Cesare
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Cimperiali
August 6th, 2001, 04:11 AM
from api guide:
other useful const for that api are:
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
HanneSThEGreaT
August 6th, 2001, 03:04 PM
Thanx! I'll remeber it next time
F. T. W.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.