|
Turn on the timer to turn off and leave your PC.here is the program
With using ExitWindowsEx function as WinAPI function where you
can do some operation like log off, shut down, and also restart
the system.
function ExitWindowsEx (uFlags : word ; dwReserved : DWORD): BOOL;
The first parameter of uFlags defined operation behaviour:
EWX_RESTART |
Do restart with warning infomation displaying. |
EWX_SHUTDOWN |
Do shutdown with warning informatino displaying. |
EWX_LOGOFF |
Do logoff with warning information displaying. |
EWX_FORCE |
Do shutdown without warning informatin displaying. You
may lost some unsaved data. |
Last parameter is 0. So you just write this code:
ExitWindowsEx (EWX_SHUTDOWN, 0);
It's easy, isnt it? you can download source code here.
|