Please tell me - how can I restart, turn off and put the computer on standby (sleep) mode on Delphi?
Please tell me - how can I restart, turn off and put the computer on standby (sleep) mode on Delphi?
To work in windows 7 and windows vista
ExitWindowsEx (EWX_LOGOFF or ewx_force, 0);
terminates all processes running in the system, saving the data of the application that called this function
ExitWindowsEx (EWX_SHUTDOWN or ewx_force, 0);
stops the system at a safe time. All buffers are cleared while saving data to disk, all processes are stopped
ExitWindowsEx (EWX_REBOOT or ewx_force, 0);
reboot system
ExitWindowsEx (EWX_FORCE or ewx_force, 0);
terminates all applications running on the system without sending them WM_QUERYENDSESSION and WM_ENDSESSIO messages. This may cause loss of unsaved data.
ExitWindowsEx (EWX_POWEROFF or ewx_force, 0);
shuts down the computer with power off if the system supports auto power management
ExitWindowsEx (EWX_FORCEIFHUNG or ewx_force, 0);
shuts down all applications running in the system if the system hangs
Another reboot option:
mov al, 0F0h
out 64h, al
Comments
Post a Comment