Форум программистов «Весельчак У»
  *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

  • Рекомендуем проверить настройки временной зоны в вашем профиле (страница "Внешний вид форума", пункт "Часовой пояс:").
  • У нас больше нет рассылок. Если вам приходят письма от наших бывших рассылок mail.ru и subscribe.ru, то знайте, что это не мы рассылаем.
   Начало  
Наши сайты
Помощь Поиск Календарь Почта Войти Регистрация  
 
Страниц: [1]   Вниз
  Печать  
Автор Тема: СРОЧНО НУЖЕН HELP-REBOOT или SHUTDOWN вот в чем вопрос  (Прочитано 7029 раз)
0 Пользователей и 1 Гость смотрят эту тему.
SOS
Гость
« : 26-10-2004 16:08 » 

Извеняюсь зарание.
Народ, помогите пожалуста, и если можно то быстро.
ВОПРОС:

Как из кернела, GINA или из USER MODE узнать что
юзер делает: reboot or shutdown of Windows 98/ME/2000/XP

Использую C \ C++, MS-VS C++ 6.0
Записан
Finch
Спокойный
Администратор

il
Offline Offline
Пол: Мужской
Пролетал мимо


« Ответ #1 : 26-10-2004 16:15 » 

Цитата

The WM_QUERYENDSESSION message is sent when the user chooses to end the Windows session or when an application calls the ExitWindows function. If any application returns zero, the Windows session is not ended. Windows stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.

After processing this message, Windows sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.

WM_QUERYENDSESSION  
nSource = (UINT) wParam;    // source of end-session request
fLogOff = lParam            // logoff flag
 

Parameters

nSource

Reserved for future use.

fLogOff

Value of lParam. Indicates whether the user is logging off or shutting down the system. Supported values include: ENDSESSION_LOGOFF.
 

Return Values

If an application can terminate conveniently, it should return TRUE; otherwise, it should return FALSE.

Remarks

By default, the DefWindowProc function returns TRUE for this message.
Windows NT: When an application returns TRUE for this message, it receives the WM_ENDSESSION message and it is terminated, regardless of how the other applications respond to the WM_QUERYENDSESSION message.
Windows 95: After all applications return TRUE for this message, they receive the WM_ENDSESSION and they are terminated.

See Also

DefWindowProc, ExitWindows, WM_ENDSESSION
Записан

Не будите спашяго дракона.
             Джаффар (Коша)
SOS
Гость
« Ответ #2 : 29-10-2004 16:32 » 

Finch,

A quote from online MSDN:

Цитата

A window receives this message through its WindowProc function.

LRESULT CALLBACK WindowProc(
  HWND hwnd,          // handle to window
  WM_QUERYENDSESSION, // the message to send
  WPARAM wParam,      // not used
  LPARAM lParam       // logoff option
);

Parameters

wParam - This parameter is reserved for future use.

lParam - If this parameter includes ENDSESSION_LOGOFF, the user is logging off. (Note that this parameter is a bit mask. To test for this value, use a bit-wise operation; do not test for equality.)
If this parameter is zero, the system is shutting down or restarting (it is not possible to determine which event is occurring).


 Жаль   Ха-ха-ха
Записан
Finch
Спокойный
Администратор

il
Offline Offline
Пол: Мужской
Пролетал мимо


« Ответ #3 : 29-10-2004 16:38 » 

SOS, Я могу только сказать, что нужно проэксперементировать. По крайней мере в моем хелпе Последней строчки нет упоминание. Да кстати обрати внимание. Что это сообшение может послать сигнал не перезогружать и не выключать комп.

Вот еше одно сообшение. Виндовс его посылает при смене пользователя
Цитата

The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.

WM_USERCHANGED  
wParam = 0;       // not used, must be zero
lParam = 0;       // not used, must be zero
 

Return Values

An application should return zero if it processes this message.
Записан

Не будите спашяго дракона.
             Джаффар (Коша)
SOS
Гость
« Ответ #4 : 01-11-2004 14:32 » new

Спасибо Finch,
Вопрос решен, мы сделали запрос в Microsoft и поучили ответ, что они знают про эту проблемму и может в следующей версии Windows можно будет распознавать Shutdown это или Reboot. А пока, не в kernal, не в GINA, ни где нельзя получить эту инфу Жаль
Записан
Страниц: [1]   Вверх
  Печать  
 

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines