Kernel32WTSGetActiveConsoleSessionId Method
Retrieves the session identifier of the console session.
The console session is the session that is currently attached to the physical console.
Note that it is not necessary that Remote Desktop Services be running for this function to succeed.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll")]
public static uint WTSGetActiveConsoleSessionId()
<DllImportAttribute("Kernel32.dll">]
Public Shared Function WTSGetActiveConsoleSessionId As UInteger
Dim returnValue As UInteger
returnValue = Kernel32.WTSGetActiveConsoleSessionId()
public:
[DllImportAttribute(L"Kernel32.dll")]
static unsigned int WTSGetActiveConsoleSessionId()
[<DllImportAttribute("Kernel32.dll")>]
static member WTSGetActiveConsoleSessionId : unit -> uint32
No code example is currently available or this language may not be supported.
Return Value
UInt32
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
UInt32 (
0xFFFFFFFF).