Вниз
Скачать: CL | DM;

Полный ShutDown   Найти похожие ветки 

← →
IlyaA   (2002-07-17 14:36) [0]

Как можно програмно выключить комьютер или ребутнуть его.


← →
Song ©   (2002-07-17 15:09) [1]

В FAQ есть.


← →
andrey_pst ©   (2002-07-18 11:50) [2]

функции WinAPI:
1) ExitWindows() - использовалась в Win16 (под Win32 тоже работает)
2) ExitWindowsEx() - используется в Win32

Первая только перезагружает компутер, вторая могет и ребут и сеанс закончить и питание выключить вобщем см. ниже (ангхлицкий надеюсь знаешь).

Обе лично использовал в Win98/ME с семейством NT юзать её не пробовал.
Удачи :)

У первой оба параметра зарезервированы у второй первый параметр это флаги говорящие как выполнять выход:

EWX_FORCE
Forces processes to terminate. When this flag is set, Windows does not send the messages WM_QUERYENDSESSION and WM_ENDSESSION to the applications currently running in the system. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.

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: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section. Windows 95: Security privileges are not supported or required.

EWX_REBOOT
Shuts down the system and then restarts the system. Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section. Windows 95: Security privileges are not supported or required.

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. Windows NT: The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section. Windows 95: Security privileges are not supported or required.



← →
IlyaA   (2002-07-18 13:35) [3]

Большое спасибо. Извиняюсь за глупый вопрос.
Что-то совсем ленивый стал, даже в MSDN лень залесть. Надо воспитываться.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.01 c
1-85589
Администратор
2002-09-14 12:33
2002.09.26
Срочно!!! Траффиикк


3-85409
UnDISCOvery
2002-09-05 19:27
2002.09.26
Access 2000. Ошибка:


1-85512
ed_209
2002-09-10 11:57
2002.09.26
Jpeg & png size


3-85363
maxim2
2002-09-05 06:15
2002.09.26
Надо узнать длину поля в таблице, незнаю как?


6-85637
Sir Alex
2002-07-20 12:56
2002.09.26
В отдельном потоке работает IdHTTP, как его остановить?




   Наверх