Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Terminal Services / Citrix
Message
From
09/01/2007 12:05:20
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00573467
Message ID:
01183836
Views:
24
FINALLY!

Other solutions only detect whether the system "SUPPORTS" TS but not whether the current session is a TS. I could find no direct reference to detect if a session was being run in a TS session. But after some digging and noggin scratching I came up with this simple function:
DECLARE integer ProcessIdToSessionId IN WIN32API integer, integer @
DECLARE INTEGER GetCurrentProcessId IN WIN32API
local lnProcessid, lnTsSessionid 
lnProcessid =  GetCurrentProcessId ()
lnTsSessionid = lnProcessid - lnProcessid
=ProcessIdToSessionId(lnProcessid,@lnTsSessionId)
RETURN lnTsSessionid <> 0
Glenn


>Take a look at Thread #534050.
>
>>Hi All,
>>
>>I am just wondering if anybody knows of a way to detect if a program
>>is being run from a terminal server.
>>
>>Is there an API that can be called or something like that ?
>>
>>TIA for any help
>>
>>Chris.
Previous
Reply
Map
View

Click here to load this message in the networking platform