Private listPointer As Long Private treePointer As Long Private iSockets As Integer Private ret As Long ' When program starts.... Public Sub Form_Load() ' Listen for socket requests on Port 4050 Socket(0).LocalPort = 4050 Socket(0).Listen ' Establish the Ops Nav Tree and List panels listPointer = AS400List1.ReturnPtr treePointer = AS400Tree1.ReturnPtr AS400Tree1.SetListOcx (listPointer) AS400List1.SetTreeOcx (treePointer) Label1.Caption = Socket(0).LocalIP Me.Hide End Sub '********************************* ' Exit Close and Exit Application '********************************* Private Sub btnExit_Click() Unload Me End Sub '**************************************** ' Hide window '**************************************** Private Sub btnHideMe_Click() ' Hide this window/Remove topmost setting ret = SetTopMostWindowp(Me.hwnd, False) Me.Hide End Sub '****************************************************************************** ' ' Receive Connection Request From Host ' '******************************************************************************* Private Sub Socket_ConnectionRequest(Index As Integer, ByVal requestID As Long) If Index = 0 Then sRequestID = requestID iSockets = iSockets + 1 Load Socket(iSockets) Socket(iSockets).LocalPort = 4050 Socket(iSockets).Accept requestID End If End Sub Private Sub Socket_DataArrival(Index As Integer, ByVal bytesTotal As Long) ' Make this window show over the top of all others ret = SetTopMostWindowp(Me.hwnd, True) Me.Show End Sub