Is library running on Citrix or Terminal Server? – Testing on existence/value of environment variable SESSIONNAME – Solution
Its a while ago now, but I think for me it was to do with printing.
Different users connecting to the server will have different local
printers setup, and won’t use some standard server printer.
Clearly this was just the first indication that maybe I should not to
use the default printer.
Based in Chester in the UK.
On 27/01/2018 12:24, Doug Easterbrook wrote:
> hi Phil/Bruno…
> Just out of interest…… what reasons make you want to know if you are
> running on terminal services???
> A number of our customers run under terminal services — and we have
> had no reason in the past to want to know. so the underlying purpose
> is of interest to me — in case I should want to know 🙂
> thanks in advance.
> **Doug Easterbrook*
> *Arts Management Systems Ltd.*
> Phone (403) 650-1978
> see you at the third annual users conference
>> On Jan 27, 2018, at 4:45 AM, Phil (OmnisList) via omnisdev-en
>> <mailto:email@example.com>> wrote:
>> Hi Bruno,
>> I had this code lingering, not used recently:
>> Register DLL (‘user32′,’GetSystemMetrics’,’AJ’) ;; jf – 21 aug
>> 03 — detect if running under Terminal Server
>> Call DLL (‘user32′,’GetSystemMetrics’,4096) Returns
>> lbUsingTerminalServices ;; 4096 = SM_REMOTESESSION
>> May help you… or point you in a different direction…
>> Phil Potter
>> Based in Chester in the UK.
>> On 26/01/2018 15:40, bub wrote:
>>> Hey all,
>>> I would love to find out if my library is running on Citrix or
>>> Terminal Server.
>>> Apparently, the environment variable SESSIONNAME is only defined on
>>> Citrix or Terminal Server so that would be a way to find it out,
>>> even more specific
>>> Citrix client => SESSIONNAME starts with ICA
>>> Rdp client => SESSIONNAME starts with rdp
>>> Console session => SESSIONNAME starts with console
>>> Is there any DLL that can provide the value of an envirnoment
>>> variable like SESSIONNAME?
>>> Ok, just did some more effort in scrolling through historic posts
>>> and found similar construction to get username (which i changed now
>>> to sessionname)
>>> Register DLL (‘kernel32′,’GetEnvironmentVariableA’,’ICCM’)
>>> Call DLL
>>> So solution found, happy to share, might me be interesting for some
>>> This email has been checked for viruses by Avast antivirus software.
>>> Manage your list subscriptions at lists.omnis-dev.com
>> Manage your list subscriptions at lists.omnis-dev.com
Manage your list subscriptions at lists.omnis-dev.com