home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pc3270sa.zip / vbdde / fgsysstt.frm < prev    next >
Text File  |  2002-02-28  |  6KB  |  196 lines

  1. VERSION 4.00
  2. Begin VB.Form FormGetSysStatus 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Get System Status"
  5.    ClientHeight    =   2004
  6.    ClientLeft      =   3312
  7.    ClientTop       =   3648
  8.    ClientWidth     =   5316
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   700
  13.       size            =   7.8
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H80000008&
  19.    Height          =   2328
  20.    Left            =   3264
  21.    LinkMode        =   1  'Source
  22.    LinkTopic       =   "Form1"
  23.    MaxButton       =   0   'False
  24.    MinButton       =   0   'False
  25.    ScaleHeight     =   2004
  26.    ScaleWidth      =   5316
  27.    ShowInTaskbar   =   0   'False
  28.    Top             =   3372
  29.    Width           =   5412
  30.    Begin VB.CommandButton ExitDlg 
  31.       Cancel          =   -1  'True
  32.       Caption         =   "E&xit"
  33.       Height          =   372
  34.       Left            =   3360
  35.       TabIndex        =   2
  36.       Top             =   1440
  37.       Width           =   972
  38.    End
  39.    Begin VB.CommandButton Execute 
  40.       Caption         =   "&Update"
  41.       Default         =   -1  'True
  42.       Height          =   372
  43.       Left            =   960
  44.       TabIndex        =   1
  45.       Top             =   1440
  46.       Width           =   876
  47.    End
  48.    Begin VB.TextBox StatusDataText 
  49.       ForeColor       =   &H00FF0000&
  50.       Height          =   372
  51.       Left            =   2280
  52.       MultiLine       =   -1  'True
  53.       TabIndex        =   0
  54.       TabStop         =   0   'False
  55.       Top             =   1440
  56.       Visible         =   0   'False
  57.       Width           =   492
  58.    End
  59.    Begin MSGrid.Grid SessionStatusGrid 
  60.       Height          =   972
  61.       Left            =   240
  62.       TabIndex        =   3
  63.       TabStop         =   0   'False
  64.       Top             =   240
  65.       Width           =   4812
  66.       _Version        =   65536
  67.       _ExtentX        =   8488
  68.       _ExtentY        =   1715
  69.       _StockProps     =   77
  70.       BackColor       =   12648447
  71.       Rows            =   27
  72.       Cols            =   4
  73.       FixedCols       =   0
  74.       ScrollBars      =   2
  75.    End
  76. End
  77. Attribute VB_Name = "FormGetSysStatus"
  78. Attribute VB_Creatable = False
  79. Attribute VB_Exposed = False
  80.  
  81.  
  82. Private Sub Execute_Click()
  83.    
  84.  OldMousePointer = MousePointer
  85.  MousePointer = 11 ' Hour Glass Mouse Pointer
  86.   
  87.   UpdateSystemStatus
  88.       
  89.   MousePointer = OldMousePointer
  90. End Sub
  91.  
  92. Private Sub ExitDlg_Click()
  93.     Hide
  94. End Sub
  95.  
  96. Private Sub UpdateLogPointer()
  97.     LogEnd = LogEnd + 1
  98.     If LogEnd = MAXLOGNUM + 1 Then
  99.        LogEnd = 0
  100.     End If
  101.  
  102.     If LogTop = LogEnd Then
  103.        LogTop = LogTop + 1
  104.        If LogTop = MAXLOGNUM + 1 Then
  105.           LogTop = 0
  106.        End If
  107.     End If
  108. End Sub
  109.  
  110. Private Sub Form_Load()
  111.   ScrollBarWidthInPixels = GetSystemMetrics(SM_CXVSCROLL)
  112.   
  113.   ScaleMode = 3 ' Pixels
  114.   GridWidthInPixels = SessionStatusGrid.Width
  115.   ScaleMode = 1 ' Twips
  116.   GridWidthInTwips = SessionStatusGrid.Width
  117.   ScrollBarWidthInTwips = (ScrollBarWidthInPixels * GridWidthInTwips) / GridWidthInPixels
  118.   GridWidthInTwips = GridWidthInTwips - ScrollBarWidthInTwips
  119.  
  120.   For Counter = 0 To 3
  121.     SessionStatusGrid.ColWidth(Counter) = GridWidthInTwips / 4
  122.     SessionStatusGrid.ColAlignment(Counter) = 2 ' Centered Text
  123.     SessionStatusGrid.FixedAlignment(Counter) = 2 ' Centered Text
  124.   Next Counter
  125. '  SessionStatusGrid.ColWidth(4) = ScrollBarWidthInTwips
  126.   
  127.   SessionStatusGrid.Row = 0
  128.   SessionStatusGrid.Col = 0
  129.   SessionStatusGrid.Text = "Session"
  130.   SessionStatusGrid.Col = 1
  131.   SessionStatusGrid.Text = "Host"
  132.   SessionStatusGrid.Col = 2
  133.   SessionStatusGrid.Text = "Emulator"
  134.   SessionStatusGrid.Col = 3
  135.   SessionStatusGrid.Text = "Status"
  136.   
  137.   UpdateSystemStatus
  138. End Sub
  139.  
  140.  
  141. Private Sub StatusTitle_Click()
  142.  
  143. End Sub
  144.  
  145.  
  146.  
  147. Private Sub UpdateSystemStatus()
  148. On Error GoTo ErrHandler
  149.    FunctionComp = True
  150.  
  151.    rc = DoEvents()              'If you use VisualBasic V2.0, call
  152.                                 'DoEvents function each time before
  153.                                 'starting DDE conversation.
  154.    StatusDataText.LinkTimeout = -1
  155.    StatusDataText.LinkTopic = "IBM327032|System"
  156.    StatusDataText.LinkMode = COLD
  157.    StatusDataText.LinkItem = "Status"
  158.    StatusDataText.LinkRequest
  159.    StatusDataText.LinkMode = NONE
  160.    If FunctionComp = True Then
  161. '      MsgBox MSG_FUNCTION_COMP, 64, MSG_SAMPLE_PROG
  162.       EndStatus$ = MSG_OK
  163.    Else
  164.       MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
  165.       EndStatus$ = MSG_NG
  166.    End If
  167.    TempLogData$ = Time$ + ":Get System Status : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
  168.    TempLogData$ = TempLogData$ + MSG_APPLICATION + APPLICATION_NAME + """" + Chr$(13) + Chr$(10) + Chr$(9)
  169.    TempLogData$ = TempLogData$ + MSG_TOPIC + """System""" + Chr$(13) + Chr$(10) + Chr$(9)
  170.    TempLogData$ = TempLogData$ + MSG_ITEM + """Status""" + Chr$(13) + Chr$(10) + Chr$(9)
  171.    TempLogData$ = TempLogData$ + "Data =" + """" + StatusDataText.Text + """" + Chr$(13) + Chr$(10)
  172.    LogData$(LogEnd) = TempLogData$
  173.    UpdateLogPointer
  174.    Loged = True
  175.    Exit Sub
  176.  
  177. ErrHandler:
  178.    FunctionComp = False
  179.    Resume Next
  180.  
  181. End Sub
  182.  
  183. Private Sub StatusDataText_Change()
  184.  
  185.   SessionStatusGrid.SelStartCol = 0
  186.   SessionStatusGrid.SelStartRow = 1
  187.   SessionStatusGrid.SelEndCol = SessionStatusGrid.Cols - 1
  188.   SessionStatusGrid.SelEndRow = SessionStatusGrid.Rows - 1
  189.   SessionStatusGrid.Clip = StatusDataText.Text
  190.   
  191.   SessionStatusGrid.SelStartCol = 1
  192.   SessionStatusGrid.SelEndCol = 0
  193. End Sub
  194.  
  195.  
  196.