0

Is there any windows API function to check if I am in a terminal service session?

Daniel Silveira
  • 41,125
  • 36
  • 100
  • 121

1 Answers1

2

Use

GetSystemMetrics(SM_REMOTECONTROL))

To determine if the calling session is being remotely controlled

and

GetSystemMetrics(SM_REMOTESESSION))

to determine if the calling session is associated with a remote session on a terminal server

http://msdn.microsoft.com/en-us/library/ms724385%28VS.85%29.aspx

cmsjr
  • 56,771
  • 11
  • 70
  • 62