IPB
ЛогинПароль:

> ВНИМАНИЕ!

Прежде чем задать вопрос, смотрите FAQ.
Рекомендуем загрузить DRKB.

> Перезагрузка компьютера на Delphi, Немогу перезагрузить в Windows XP
#$# PaVeL #$#
сообщение 25.11.2005 14:03
Сообщение #1


Пионер
**

Группа: Пользователи
Сообщений: 91
Пол: Мужской
Реальное имя: Павел

Репутация: -  0  +


mega_chok.gif[SIZE=14] Может кто подскажет: "Как перезагрузить комп програмно, из Delphi в OS Windows XP".А то уж совсем сума сошёл. wacko.gif
P.S.: Предпочтительно готовый участок кода! cool.gif
 Оффлайн  Профиль  PM 
 К началу страницы 
+ Ответить 
 
 Ответить  Открыть новую тему 
Ответов
GoodWind
сообщение 12.12.2005 13:16
Сообщение #2


Автооответчик
*****

Группа: Модераторы
Сообщений: 1 188
Пол: Мужской
Реальное имя: Александр

Репутация: -  16  +


Цитата
ExitWindowsEx
The ExitWindowsEx function either logs off the current user, shuts down the system, or shuts down and restarts the system. It sends the WM_QUERYENDSESSION message to all applications to determine if they can be terminated.

BOOL ExitWindowsEx(
UINT uFlags,
DWORD dwReason
);
Parameters
uFlags [in] Shutdown type. This parameter must include one of the following values. Value Meaning EWX_LOGOFF
0 Shuts down all processes running in the logon session of the process that called the ExitWindowsEx function. Then it logs the user off.This flag can be used only by processes running in an interactive user's logon session.

EWX_POWEROFF
0x00000008 Shuts down the system and turns off the power. The system must support the power-off feature. The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.

EWX_REBOOT
0x00000002 Shuts down the system and then restarts the system. The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.

EWX_SHUTDOWN
0x00000001 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. The calling process must have the SE_SHUTDOWN_NAME privilege. For more information, see the following Remarks section.

Specifying this flag will not turn off the power even if the system supports the power-off feature. You must specify EWX_POWEROFF to do this.

Windows XP SP1: If the system supports the power-off feature, specifying this flag turns off the power.


This parameter can optionally include one of the following values.

Value Meaning EWX_FORCE
0x00000004
Windows 2000/NT: Forces processes to terminate. When this flag is set, the system does not send the WM_QUERYENDSESSION and WM_ENDSESSION messages. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.Starting with Windows XP, these messages will always be sent.

EWX_FORCEIFHUNG
0x00000010 Forces processes to terminate if they do not respond to the WM_QUERYENDSESSION or WM_ENDSESSION message within the timeout interval. For more information, see the Remarks.
Windows NT and Windows Me/98/95: This value is not supported.

информация с www.msdn.com

Сообщение отредактировано: GoodWind - 12.12.2005 13:18


--------------------
Неадекватная чушь может быть адекватным ответом на неадекватный вопрос. Понятно или разжевать?
 Оффлайн  Профиль  PM 
 К началу страницы 
+ Ответить 

Сообщений в этой теме
#$# PaVeL #$#   Перезагрузка компьютера на Delphi   25.11.2005 14:03
Fang   Вот так наверное: ExitWindowsEx(EWX_REBOOT,0...   25.11.2005 14:10
#$# PaVeL #$#   Чтобы перезагрузить Windows XP НАДО ПРИВИЛЕГИИ АДМ...   25.11.2005 14:15
Ozzя   Изменение привелегий { For some functions you...   25.11.2005 16:24
#$# PaVeL #$#   Ну с привелегиями вроде понял только какую использ...   29.11.2005 8:12
FreeMan   Вроде SeShutdownPrivilege Тут то, что нужно   29.11.2005 8:22
#$# PaVeL #$#   Не получается!!!! :nea: SeShutdow...   6.12.2005 14:12
volvo   Ну, так покажи, КАК ты делаешь? Телепатов у нас не...   6.12.2005 14:13
#$# PaVeL #$#   Чё правда не телепаты????????????????????????? :bl...   8.12.2005 11:55
volvo   #$# PaVeL #$#, попробуй ExitWindowsEx(E...   8.12.2005 12:05
#$# PaVeL #$#   Ну, понятно только перед тем как закрыть тему хоте...   12.12.2005 11:23
GoodWind   если не изменяет склероз, включает режим "фор...   12.12.2005 12:19
#$# PaVeL #$#   Чё то я незаметил разницы комп выключается очень б...   12.12.2005 12:48
GoodWind   а в чем тогда его смысл :blink: кто знает ?   12.12.2005 12:52
volvo   Замечу также что флаг EWX_FORCE необходим только д...   12.12.2005 13:06
GoodWind   информация с www.msdn.com   12.12.2005 13:16
#$# PaVeL #$#   Спасибо материал интересный. :good: Только, если...   13.12.2005 7:37


 Ответить  Открыть новую тему 
2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0

 



- Текстовая версия 13.08.2025 10:39
Хостинг предоставлен компанией "Веб Сервис Центр" при поддержке компании "ДокЛаб"