WaitForCursor Method Example

The example uses WaitForCursor and SendKeys to page through three host demonstration screens (using the SlideShow connection type). Note that with the exception of the first instance of SendKeys, this method is only executed if the WaitForCursor method returns TRUE.

Sub Main()

 Dim Sys As Object, Sess As Object, MyScreen As Object

 

 Set Sys = CreateObject("EXTRA.System")

' Assumes an open session

 Set Sess = Sys.ActiveSession

 Set MyScreen = Sess.Screen

 

 Sys.TimeoutValue = 9000

 

 ' This will page through a couple of "slide show" host screens.

 MyScreen.SendKeys ("a<Enter>")

 Found1st = MyScreen.WaitForCursor(20, 16)

 If Found1st Then

  MyScreen.SendKeys ("user1<Enter>")

  Found2nd = MyScreen.WaitForCursor(23, 1)

  If Found2nd Then

  MyScreen.SendKeys ("logoff<Enter>")

  Found3rd = MyScreen.WaitForCursor(23, 6)

  End If

 End If

 If Not (Found1st And Found2nd And Found3rd) Then MsgBox "Error navigating host screens."

End Sub