Detect citrix “application mode”?

后端 未结 3 359
独厮守ぢ
独厮守ぢ 2021-02-03 15:40

Forgive me for probably using the wrong term for this \"application mode\".

Our application has a problem during start in that it doesn\'t show a task bar icon until the

相关标签:
3条回答
  • 2021-02-03 16:06

    Not sure exactly how to do this in delphi, but if you can call out to the user32.dll, and call the function:

    if (GetSystemMetrics(SM_REMOTESESSION) != 0)
    {
       // We are in a remote session
    }
    

    This should tell you if you are running in a Citrix or Terminal Services environment. SM_REMOTESESSION is defined as:

    #define SM_REMOTESESSION        0x1000
    

    More info on the GetSystemMetrics api here: Link to msdn

    Edit The following page describes how to do exactly the above in delphi. What works for Terminal Services should also work for Citrix:

    Is your Delphi Application Running under Terminal Services as a Remote Session

    0 讨论(0)
  • 2021-02-03 16:08

    This works for me:

    return System.Windows.Forms.SystemInformation.TerminalServerSession;
    
    0 讨论(0)
  • 2021-02-03 16:21

    A side-note for the curious: The solution proposed by "open-collar" is just a .NET wrapper for the one given by John Sibly. They should return the same result in every case. I confirmed this by disassembling the System.Windows.Forms.SystemInformation class.

    0 讨论(0)
提交回复
热议问题