Gert .Net
[GertDotNet]
20031203
Detect if the current process is in a Terminal Services Client
Finally a real code example:
Use this code to detect if the process "If the calling process is associated with a Terminal Services client session".
[System.Runtime.InteropServices.DllImport("user32.dll",EntryPoint="GetSystemMetrics")]
private static extern int GetSystemMetrics(int valor);
private const int SM_REMOTESESSION = 0x1000;
public static bool IsInTerminalServicesClient() {
return GetSystemMetrics(SM_REMOTESESSION) != 0;
}
You call IsInTerminalServicesClient() to determine if you are in a Terminal Services session. You can use this to reduce graphic input, or allow multiple instances of the application etc.
Comments:
Een reactie plaatsen
Links to this post:
