Jump to content
Welcome to our new Citrix community!
  • 0

WFICALib Caching user sessions


Hector Grebbell

Question

I am attempting to automate some internal processes. Part of which involves interfacing with a Citrix hosted application.

The following (C#) code when run the first time sucessfully reads the windows available from a session -
 

 

            var client = new WFICALib.ICAClient();

            client.OutputMode = WFICALib.OutputMode.OutputModeNormal;
 
            var enumHandle = client.EnumerateCCMSessions();
 
            sessionId = client.GetEnumNameByIndex(enumHandle, index);
 
            client.StartMonitoringCCMSession(sessionId, false);
 
            Server = client.GetSessionString(WFICALib.ICASessionString.SessionServer);
 
            var session = client.Session;
            
            var windows = session.TopLevelWindows;
 
            foreach (WFICALib.window window in windows)
            {
                Console.Out.WriteLine(window.Caption);
                Marshal.ReleaseComObject(window);
            }
 
            Marshal.ReleaseComObject(windows);
            Marshal.ReleaseComObject(session);

            Marshal.ReleaseComObject(client);

However on future runs (even in a new process) the windows listed are always the same. The only way to get an updated list is to disconnect and reconnect the session. I imagine this list must be getting cached somewhere in the COM server.

Is there any way to repair this from the client code?

Thanks & regards,

Hector

Link to comment

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...