Вниз
Скачать: 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.44 MB
Время: 0.016 c
14-85697
Карелин Артем
2002-09-02 15:53
2002.09.26
Дайте совет!


1-85437
SoniK
2002-09-14 23:02
2002.09.26
Компонет


6-85629
Rammst
2002-07-25 17:43
2002.09.26
Mail


3-85418
MsGuns
2002-09-06 12:55
2002.09.26
Проблема при вводе данных ! Поделитесь экспириенсом


1-85465
AZ
2002-09-16 11:00
2002.09.26
Глюк или что-то в настройках?




   Наверх