Текущий архив: 2008.01.13;
Скачать: CL | DM;
Вниз
Сообщение при подключении к удаленной сессии Найти похожие ветки
← →
Дмитрий Белькевич © (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 вся ветка
Текущий архив: 2008.01.13;
Скачать: CL | DM;
Память: 0.46 MB
Время: 0.006 c