Вниз
Скачать: 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.013 c
1-85601
Странников Володя
2002-09-13 09:55
2002.09.26
Дельфи 6 и 7


4-85776
Groove
2002-08-06 16:17
2002.09.26
help


7-85711
Agran
2002-07-15 13:21
2002.09.26
Как узнать загруженность процессора?


3-85325
vanko
2002-09-04 11:18
2002.09.26
Filter в ADOTable


1-85457
BillyJeans
2002-09-16 10:44
2002.09.26
как блокировать повторный запуск?




   Наверх