Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.09.26;
Скачать: 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 вся ветка

Текущий архив: 2002.09.26;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.022 c
3-85316
Listik
2002-09-06 16:07
2002.09.26
кто - нибудь///


3-85355
Шаповалов Кирилл
2002-09-04 10:59
2002.09.26
Поля соответвия или 2 DBLookUpBox а


14-85665
DenKop
2002-08-14 02:20
2002.09.26
XP и MP3


1-85443
Auz
2002-09-15 20:43
2002.09.26
Синтаксический редактор. HELP!!!


1-85563
Андрей Дмитриев
2002-09-12 12:57
2002.09.26
Ошибка Stack Overflow