I would like to add some functionality to an app which is run from thin clients which are connected to a Citrix Farm.
All this needs to do is open the Citrix Connection Centre (This is done by right clicking Citrix Receiver and then clicking Connection Centre), open the 'preferences' option, and then close the Connection Centre again. This resolves an issue we are having and I would like to automate this for our users.
Can anyone please suggest a way of achieving this through the use of the .NET framework? Any advice is much appreciated.
I am working within the .NET-3.5 framework with Citrix 7.6
I managed to solve this with the following :
Process.Start(@"C:\Program Files (x86)\Citrix\ICA Client\concentr.exe");
IntPtr windowPtr = FindWindowByCaption(IntPtr.Zero, "Citrix Connection Center");
SetForegroundWindow(windowPtr);
SendKeys.SendWait("{r}");
IntPtr prefWindowPtr = FindWindowByCaption(IntPtr.Zero, "Citrix Receiver - Preferences");
SendMessage(prefWindowPtr, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
SendMessage(windowPtr, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
Which does :
See pinvoke for details on the invoked methods FindWindowByCaption
, SetForegroundWindow
and SendMessage