WindowHandle Property Example

The following example gets the Windows identifier of a session window, and then calls a Windows API (SetForegroundWindow) to give focus to the session window.

 

Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long

 

Sub Main()

 Dim Sys As Object, Sess As Object

 Dim hWindow As Long

 

 Set Sys = CreateObject("EXTRA.System") ' Assumes an open session

 Set Sess = Sys.ActiveSession

 hWindow = Sess.WindowHandle

 SetForegroundWindow (hWindow)

End Sub