www.pudn.com > netserver.zip > frmComputer.frm


VERSION 5.00 
Begin VB.Form frmComputer  
   BorderStyle     =   3  'Fixed Dialog 
   Caption         =   "计算机状态" 
   ClientHeight    =   5010 
   ClientLeft      =   45 
   ClientTop       =   330 
   ClientWidth     =   5730 
   Icon            =   "frmComputer.frx":0000 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   5010 
   ScaleWidth      =   5730 
   StartUpPosition =   2  '屏幕中心 
   WhatsThisHelp   =   -1  'True 
   Begin VB.CommandButton Command3  
      Caption         =   "关 闭" 
      Height          =   375 
      Left            =   3840 
      TabIndex        =   4 
      Top             =   4560 
      Width           =   1335 
   End 
   Begin VB.CommandButton Command2  
      Caption         =   "刷新列表" 
      Height          =   375 
      Left            =   2280 
      TabIndex        =   3 
      Top             =   4560 
      Width           =   1335 
   End 
   Begin VB.CommandButton Command1  
      Caption         =   "结束程序" 
      Height          =   375 
      Left            =   600 
      TabIndex        =   1 
      Top             =   4560 
      Width           =   1455 
   End 
   Begin VB.ListBox List1  
      Height          =   4020 
      Left            =   0 
      TabIndex        =   0 
      Top             =   360 
      Width           =   5655 
   End 
   Begin VB.Label Label1  
      Caption         =   "当前应用程序" 
      Height          =   255 
      Left            =   120 
      TabIndex        =   2 
      Top             =   120 
      Width           =   1815 
   End 
End 
Attribute VB_Name = "frmComputer" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Public SelectComIndex As Long 
 
Private Sub Command1_Click() 
On Error Resume Next 
frmMain.Winsock1(SelectComIndex).SendData "_prog" + Chr(0) + "close" + Chr(0) + CStr(List1.ItemData(List1.ListIndex)) + Chr(0) + "OK$" 
DoEvents 
Command2_Click 
End Sub 
 
Private Sub Command2_Click() 
On Error Resume Next 
frmMain.Winsock1(SelectComIndex).SendData "_prog" + Chr(0) + "get" + Chr(0) + "OK$" 
DoEvents 
End Sub 
 
Private Sub Command3_Click() 
Unload Me 
End Sub 
 
Private Sub Form_Load() 
Command2_Click 
End Sub 
 
 
Public Sub FlashList1(strData As String) 
' 
Dim ThisStr() As String 
 
    '  MsgBox strData 
    cc = 0 
              ReDim Preserve ThisStr(cc) As String 
  
    For i = 1 To Len(strData) 
        ab$ = Mid(strData, i, 1) 
        If ab$ = Chr(0) Then 
            cc = cc + 1 
            ReDim Preserve ThisStr(cc) As String 
        Else 
            ThisStr(cc) = ThisStr(cc) + ab$ 
        End If 
     Next i 
     'MsgBox cc 
  List1.Clear 
    For i = 1 To cc Step 2 
    List1.AddItem ThisStr(i) 
    List1.ItemData(List1.NewIndex) = Val(ThisStr(i + 1)) 
    Next i 
 
 
 
    Dim max As Long, f As Font 
     
    Me.ScaleMode = vbPixels 
    Set f = Me.Font 
    Set Me.Font = List1.Font 
     
    With List1 
        For i = 0 To .ListCount 
        If Me.TextWidth(.List(i)) > max Then 
            max = Me.TextWidth(.List(i)) 
        End If 
        Next 
    End With 
    max = max + 10 
 
    Set Me.Font = f 
     
    SendMessage List1.hWnd, LB_SETHORIZONTALEXTENT, max, ByVal 0& 
 
 
 
End Sub