Networks

Question

Locked

Detecting if a program is being run in terminal services

By Slayer_ ·
Basically I want to know if my program is being run in a terminal server session.

So far, my research has told me that


Const SM_REMOTESESSION As Long = &H1000
Const SM_REMOTECONTROL As Long = &H2001


GetSystemMetrics(SM_REMOTESESSION)
Tells me if your program is running in an RDP session, but not Terminal Server specifc, any RDP session, so not useful.

GetSystemMetrics(SM_REMOTECONTROL)
I have yet to figure out how to get a value from this, I tried on a terminal session and it returned 0, I suspect it has something to do with Controlling someone elses remote session through terminal services. I cannot seem to get this to work to test this, but it is apperently not what I want.


To Summarize, I want to know when My app is running in a terminal session, not just remote desktop. A remote desktop session to a normal machine (IE a workstation) should be different from a terminal session'd RDP. I want to know when its the terminal session under terminal services.

If it helps anyone, I am coding this under VB6 and am fairly skilled with Windows API.

Any help would be appreciated.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Related Discussions

Related Forums