Export (0) Print
Expand All
Expand Minimize
6 out of 17 rated this helpful - Rate this topic

WTSGetActiveConsoleSessionId function

Retrieves the Remote Desktop Services session that is currently attached to the physical console. The physical console is the monitor, keyboard, and mouse. Note that it is not necessary that Remote Desktop Services be running for this function to succeed.

Syntax


DWORD WTSGetActiveConsoleSessionId(void);

Parameters

This function has no parameters.

Return value

The session identifier of the session that is attached to the physical console. If there is no session attached to the physical console, (for example, if the physical console session is in the process of being attached or detached), this function returns 0xFFFFFFFF.

Remarks

The session identifier returned by this function is the identifier of the current physical console session. To monitor the state of the current physical console session, use the WTSRegisterSessionNotification function.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

ProcessIdToSessionId
WM_WTSSESSION_CHANGE
WTSQuerySessionInformation
WTSRegisterSessionNotification

 

 

Show:
© 2014 Microsoft. All rights reserved.