ExitWindowsEx
Для выключания компьютера изпользую ExitWindowsEx(?,?)
Какие параметры за что отвечают?
Написал так ExitWindowsEx(0,0); - Завершение сеанса
Написал так ExitWindowsEx(1,0) - Вырубил, но потом куча ошибок в системе.
НАрод!!!
Для выключания компьютера изпользую ExitWindowsEx(?,?)
Какие параметры за что отвечают?
Написал так ExitWindowsEx(0,0); - Завершение сеанса
Написал так ExitWindowsEx(1,0) - Вырубил, но потом куча ошибок в системе.
Если у тебя нет MSDN'a, вот тебе описание функции:
BOOL ExitWindowsEx(
UINT uFlags, // shutdown operation
DWORD dwReserved // reserved
);
uFlags
EWX_LOGOFF — Shuts down all processes running in the security context of the process that called the ExitWindowsEx function. Then it logs the user off.
EWX_POWEROFF — Shuts down the system and turns off the power. The system must support the power-off feature.
Windows NT/2000 or later: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
EWX_REBOOT — Shuts down the system and then restarts the system.
Windows NT/2000 or later: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
EWX_SHUTDOWN — Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped. If the system supports the power-off feature, the power is also turned off.
Windows NT/2000 or later: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.
dwReserved
[in] Reserved; this parameter is ignored.