.comment-link {margin-left:.6em;}
Gert .Net
[GertDotNet]
20040504
 
Get the Terminal Services session ID
To retrieve the ID of the session (Terminal Services session that is) you can use the function WTSGetActiveConsoleSessionID.

[System.Runtime.InteropServices.DllImport("kernel32")]

private static extern uint WTSGetActiveConsoleSessionId();

 
Real World Applications Sample, Part 1: Adding SDI, Single Instance, and a Forms Collection to Windows Forms
Real World Applications Sample, Part 1: Adding SDI, Single Instance, and a Forms Collection to Windows Forms

Powered by Blogger