Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2008.01.13;
Скачать: [xml.tar.bz2];

Вниз

Сообщение при подключении к удаленной сессии   Найти похожие ветки 

 
Дмитрий Белькевич ©   (2007-06-18 22:57) [0]

Существует ли какое-либо сообщение в Windows 2k0/2k3 Server, которое случается, когда к нему присоединяются терминальным клиентом?


 
SLoW.AlfaMoon.Com   (2007-06-19 10:16) [1]

Лично я в MSDN не нашел. Есть, конечно,

WM_WTSSESSION_CHANGE

The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.

The window receives this message through its WindowProc function.


Но ведь это не то, что Вам нужно, если я правильно понимаю.
Вам нужна функция
WTSRegisterSessionNotification с флагом NOTIFY_FOR_ALL_SESSIONS

The WTSRegisterSessionNotification function registers the specified window to receive session change notifications.

BOOL WTSRegisterSessionNotification(
 HWND hWnd,
 DWORD dwFlags
);

Parameters
hWnd
[in] Handle of the window to receive session change notifications.
dwFlags
[in] Specifies which session notifications are to be received. This parameter can be one of the following values.Value Meaning
NOTIFY_FOR_THIS_SESSION Only session notifications involving the session attached to by the window identified by the hWnd parameter value are to be received.
NOTIFY_FOR_ALL_SESSIONS All session notifications are to be received.

Return Values
If the function succeeds, the return value is TRUE. Otherwise, it is FALSE. To get extended error information, call GetLastError.

Remarks
If this function is called before the dependent services of Terminal Services have started, an RPC_S_INVALID_BINDING error code may be returned. When the Global\\TermSrvReadyEvent global event is set, all dependent services have started and this function can be successfully called.

Session change notifications are sent in the form of a WM_WTSSESSION_CHANGE message. These notifications are sent only to the windows that have registered for them using this function.

When a window no longer requires these notifications, it must call WTSUnRegisterSessionNotification before being destroyed. For every call to this function, there must be a corresponding call to WTSUnRegisterSessionNotification.

If the window handle passed in this function is already registered, the value of the dwFlags parameter is ignored.

To receive session change notifications from a service, use the HandlerEx function.

Requirements
Client Requires Windows XP.
Server Requires Windows Server 2003.
Header Declared in WtsApi32.h.

Library Link to WtsApi32.lib.

DLL Requires Wtsapi32.dll.  


 
SLoW.AlfaMoon.Com   (2007-06-19 10:19) [2]

Если добьетесь результата, поделитесь, пожалуйста. Просто вопрос достаточно занятный, а самому времени на все не хватает.


 
SLoW.AlfaMoon.Com   (2007-06-19 12:43) [3]

А кстати, про WM_WTSSESSION_CHANGE. Возможно, оно Вам подойдет. Смотрю внимательно в MSDN и вижу, что:

http://msdn2.microsoft.com/en-us/library/aa383828.aspx

wParam
   [in] Status code describing the reason the session state change notification was sent. This parameter can be one of the following values.
   Value  Meaning
   WTS_CONSOLE_CONNECT
   0x1  A session was connected to the console terminal.
   WTS_CONSOLE_DISCONNECT
   0x2  A session was disconnected from the console terminal.
   WTS_REMOTE_CONNECT
   0x3  A session was connected to the remote terminal.
   WTS_REMOTE_DISCONNECT
   0x4  A session was disconnected from the remote terminal.
   WTS_SESSION_LOGON
   0x5  A user has logged on to the session.
   WTS_SESSION_LOGOFF
   0x6  A user has logged off the session.
   WTS_SESSION_LOCK
   0x7  A session has been locked.
   WTS_SESSION_UNLOCK
   0x8  A session has been unlocked.
   WTS_SESSION_REMOTE_CONTROL
   0x9  A session has changed its remote controlled status. To determine the status, call GetSystemMetrics and check the SM_REMOTECONTROL metric.
lParam
   [in] The identifier of the session.


 
Eraser ©   (2007-06-19 12:58) [4]

> [3] SLoW.AlfaMoon.Com   (19.06.07 12:43)

есть, как минимум 5 способов
1. WM_WTSSESSION_CHANGE.
2. для сервиса RegisterServiceCtrlHandlerEx + SERVICE_CONTROL_SESSIONCHANGE.
3. windlogon notification packages.
4. ISensLogon.
5. ICredentialProvider для vista.


 
Дмитрий Белькевич ©   (2007-06-19 13:16) [5]

Большое всем спасибо. Отпишу о результатах.



Страницы: 1 вся ветка

Форум: "WinAPI";
Текущий архив: 2008.01.13;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.008 c
2-1197379483
ZLinX
2007-12-11 16:24
2008.01.13
LIKE в MySQL


15-1197263105
class_
2007-12-10 08:05
2008.01.13
При просмотре небольшого ролика в Интернет


15-1197295580
slavakaram
2007-12-10 17:06
2008.01.13
Массовая рассылка почты с помощью idSMTP


15-1196892989
Petr V. Abramov
2007-12-06 01:16
2008.01.13
глюк (?) форума


15-1196698181
Nucer
2007-12-03 19:09
2008.01.13
Помогите с HTML и CSS





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский