home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / NIVB_SRC / PSINFO.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-06-03  |  5.1 KB  |  162 lines

  1. VERSION 2.00
  2. Begin Form PSInfoForm 
  3.    Caption         =   "Print Server Information"
  4.    Height          =   4305
  5.    Left            =   1605
  6.    LinkTopic       =   "Form2"
  7.    ScaleHeight     =   3900
  8.    ScaleWidth      =   6495
  9.    Top             =   1200
  10.    Width           =   6615
  11.    Begin ListBox ServerList 
  12.       Height          =   1005
  13.       Left            =   1680
  14.       TabIndex        =   7
  15.       Top             =   2160
  16.       Width           =   4695
  17.    End
  18.    Begin CommandButton OKButton 
  19.       Caption         =   "&OK"
  20.       Height          =   375
  21.       Left            =   2760
  22.       TabIndex        =   0
  23.       Top             =   3360
  24.       Width           =   975
  25.    End
  26.    Begin Label PSType 
  27.       Height          =   255
  28.       Left            =   2520
  29.       TabIndex        =   11
  30.       Top             =   1440
  31.       Width           =   2775
  32.    End
  33.    Begin Label PSVersion 
  34.       Height          =   255
  35.       Left            =   2520
  36.       TabIndex        =   10
  37.       Top             =   1200
  38.       Width           =   1455
  39.    End
  40.    Begin Label PSPrinters 
  41.       Height          =   255
  42.       Left            =   2520
  43.       TabIndex        =   9
  44.       Top             =   960
  45.       Width           =   1455
  46.    End
  47.    Begin Label PSStatus 
  48.       Height          =   255
  49.       Left            =   2520
  50.       TabIndex        =   8
  51.       Top             =   720
  52.       Width           =   3015
  53.    End
  54.    Begin Label Label5 
  55.       Alignment       =   1  'Right Justify
  56.       Caption         =   "Attached servers:"
  57.       Height          =   255
  58.       Left            =   720
  59.       TabIndex        =   6
  60.       Top             =   1800
  61.       Width           =   1575
  62.    End
  63.    Begin Label Label4 
  64.       Alignment       =   1  'Right Justify
  65.       Caption         =   "Server type:"
  66.       Height          =   255
  67.       Left            =   960
  68.       TabIndex        =   5
  69.       Top             =   1440
  70.       Width           =   1335
  71.    End
  72.    Begin Label Label3 
  73.       Alignment       =   1  'Right Justify
  74.       Caption         =   "Version:"
  75.       Height          =   255
  76.       Left            =   960
  77.       TabIndex        =   4
  78.       Top             =   1200
  79.       Width           =   1335
  80.    End
  81.    Begin Label Label2 
  82.       Alignment       =   1  'Right Justify
  83.       Caption         =   "Attached printers:"
  84.       Height          =   255
  85.       Left            =   720
  86.       TabIndex        =   3
  87.       Top             =   960
  88.       Width           =   1575
  89.    End
  90.    Begin Label Label1 
  91.       Alignment       =   1  'Right Justify
  92.       Caption         =   "Status:"
  93.       Height          =   255
  94.       Left            =   1200
  95.       TabIndex        =   2
  96.       Top             =   720
  97.       Width           =   1095
  98.    End
  99.    Begin Label Title 
  100.       Height          =   495
  101.       Left            =   480
  102.       TabIndex        =   1
  103.       Top             =   240
  104.       Width           =   5535
  105.    End
  106. Sub Form_Load ()
  107.     Dim info As PS_INFO
  108.     Title.Caption = "Information on print server :  " + PrintServerName$ + " :"
  109.     ServerList.Clear
  110.     ccode% = PSAttachToPrintServer(PrintServerName$, connID%)
  111.     If (ccode% <> SUCCESSFUL) Then
  112.         PSStatus.Caption = "Unable to attach to print server"
  113.     Else
  114.         ccode% = PSGetPrintServerInfo(connID%, info, Len(info))
  115.         If (ccode% <> SUCCESSFUL) Then
  116.             MsgBox "Unable to get print server information", MB_OK, "Error"
  117.         Else
  118.             Select Case Asc(info.status)
  119.                 Case RUNNING
  120.                     PSStatus.Caption = "Running"
  121.                 Case GOING_DOWN
  122.                     PSStatus.Caption = "Going down"
  123.                 Case DOWN
  124.                     PSStatus.Caption = "Down"
  125.                 Case INITIALIZING
  126.                     PSStatus.Caption = "Initializing"
  127.                 Case Else
  128.                     PSStatus.Caption = "Unknown"
  129.             End Select
  130.             PSPrinters.Caption = Asc(info.numPrinters)
  131.             PSVersion.Caption = Format$(Asc(info.majorVersion)) + "." + Format$(Asc(info.minorVersion)) + Chr$(Asc(info.revision) + 97)
  132.             
  133.             Select Case Asc(info.serverType)
  134.                 Case 1
  135.                     PSType.Caption = "Dedicated DOS"
  136.                 Case 2
  137.                     PSType.Caption = "NLM"
  138.                 Case 3
  139.                     PSType.Caption = "File Server VAP"
  140.                 Case 4
  141.                     PSType.Caption = "Bridge VAP"
  142.                 Case Else
  143.                     PSType.Caption = "Unknown"
  144.             End Select
  145.             sequence% = 0
  146.             Do
  147.                 serverName$ = String$(48, 0)
  148.                 ccode% = PSGetAttachedServers(connID%, sequence%, serverName$)
  149.                 ServerList.AddItem serverName$
  150.             Loop While (ccode% = SUCCESSFUL)
  151.         End If
  152.         
  153.         ccode% = PSDetachFromPrintServer(connID%)
  154.     End If
  155. End Sub
  156. Sub OKButton_Click ()
  157.     Unload PSInfoForm
  158. End Sub
  159. Sub PSInfoForm_Click ()
  160.     Unload PSInfoForm
  161. End Sub
  162.