I am attempting to use VS .NET(either J# or VB) to write a client executable which will prevent my web ICA client from timing out with the server when I leave my desk for an extended period of time. I am accessing the process(Outlook specifically) via main window title, but when I generate programmatic mouse/icon movement or sendKeys() to the process, the client still disconnects after the citrix server specified 15 minutes of no activity.
What specific events on the client side does the ICA client observe to determine that the connection is active? What programmatic events can I generate to prevent my client from disconnecting with the Citrix Server?
Here is the VB.net code thus far:
Option Explicit On
Imports System.Threading
Module Module1
Private procName As String = "\\Remote, 128-bit SSL/TLS."
Private fullscreenProcName As String = "Citrix ICA Client"
Private processes() As Process
Private proc As Process
Sub keepAlive()
Dim currentPosition As Point
Dim theCursor As Cursor
theCursor = Cursor.Current
currentPosition = theCursor.Position
Dim newPosition As Point
newPosition.X = 300
newPosition.Y = 300
theCursor.Position = newPosition
'Console.WriteLine("Mouse moved")
'MsgBox("Mouse is moved")
theCursor.Position = currentPosition
theCursor.Show()
End Sub
Sub PreventTimeout()
processes = Process.GetProcesses
For Each proc In processes
If InStr(proc.MainWindowTitle, procName) <> 0 Then
keepAlive()
'Microsoft.VisualBasic.AppActivate(proc.MainWindowTitle)
'Send the <Enter> Key to the app
'System.Windows.Forms.SendKeys.SendWait(Keys.Enter)
'MsgBox("App kept alive.")
ElseIf InStr(proc.MainWindowTitle, fullscreenProcName) <> 0 Then
keepAlive()
'Microsoft.VisualBasic.AppActivate(proc.MainWindowTitle)
'Send the <Enter> Key to the app
'System.Windows.Forms.SendKeys.SendWait(Keys.Enter)
'MsgBox("App kept alive.")
End If
proc = Nothing
Next
processes = Nothing
End Sub
Sub Main()
While (1)
PreventTimeout()
'Prevent timeout every 9 minutes
Thread.CurrentThread.Sleep(540000)
End While
End Sub
Question
Administrator
I am attempting to use VS .NET(either J# or VB) to write a client executable which will prevent my web ICA client from timing out with the server when I leave my desk for an extended period of time. I am accessing the process(Outlook specifically) via main window title, but when I generate programmatic mouse/icon movement or sendKeys() to the process, the client still disconnects after the citrix server specified 15 minutes of no activity.
What specific events on the client side does the ICA client observe to determine that the connection is active? What programmatic events can I generate to prevent my client from disconnecting with the Citrix Server?
Here is the VB.net code thus far:
Option Explicit On
Imports System.Threading
Module Module1
Private procName As String = "\\Remote, 128-bit SSL/TLS."
Private fullscreenProcName As String = "Citrix ICA Client"
Private processes() As Process
Private proc As Process
Sub keepAlive()
Dim currentPosition As Point
Dim theCursor As Cursor
theCursor = Cursor.Current
currentPosition = theCursor.Position
Dim newPosition As Point
newPosition.X = 300
newPosition.Y = 300
theCursor.Position = newPosition
'Console.WriteLine("Mouse moved")
'MsgBox("Mouse is moved")
theCursor.Position = currentPosition
theCursor.Show()
End Sub
Sub PreventTimeout()
processes = Process.GetProcesses
For Each proc In processes
If InStr(proc.MainWindowTitle, procName) <> 0 Then
keepAlive()
'Microsoft.VisualBasic.AppActivate(proc.MainWindowTitle)
'Send the <Enter> Key to the app
'System.Windows.Forms.SendKeys.SendWait(Keys.Enter)
'MsgBox("App kept alive.")
ElseIf InStr(proc.MainWindowTitle, fullscreenProcName) <> 0 Then
keepAlive()
'Microsoft.VisualBasic.AppActivate(proc.MainWindowTitle)
'Send the <Enter> Key to the app
'System.Windows.Forms.SendKeys.SendWait(Keys.Enter)
'MsgBox("App kept alive.")
End If
proc = Nothing
Next
processes = Nothing
End Sub
Sub Main()
While (1)
PreventTimeout()
'Prevent timeout every 9 minutes
Thread.CurrentThread.Sleep(540000)
End While
End Sub
End Module
Link to comment
16 answers 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 accountSign in
Already have an account? Sign in here.
Sign In Now