home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pc3270sa.zip
/
vbdde
/
fgsysstt.frm
< prev
next >
Wrap
Text File
|
2002-02-28
|
6KB
|
196 lines
VERSION 4.00
Begin VB.Form FormGetSysStatus
BorderStyle = 3 'Fixed Dialog
Caption = "Get System Status"
ClientHeight = 2004
ClientLeft = 3312
ClientTop = 3648
ClientWidth = 5316
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 7.8
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 2328
Left = 3264
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2004
ScaleWidth = 5316
ShowInTaskbar = 0 'False
Top = 3372
Width = 5412
Begin VB.CommandButton ExitDlg
Cancel = -1 'True
Caption = "E&xit"
Height = 372
Left = 3360
TabIndex = 2
Top = 1440
Width = 972
End
Begin VB.CommandButton Execute
Caption = "&Update"
Default = -1 'True
Height = 372
Left = 960
TabIndex = 1
Top = 1440
Width = 876
End
Begin VB.TextBox StatusDataText
ForeColor = &H00FF0000&
Height = 372
Left = 2280
MultiLine = -1 'True
TabIndex = 0
TabStop = 0 'False
Top = 1440
Visible = 0 'False
Width = 492
End
Begin MSGrid.Grid SessionStatusGrid
Height = 972
Left = 240
TabIndex = 3
TabStop = 0 'False
Top = 240
Width = 4812
_Version = 65536
_ExtentX = 8488
_ExtentY = 1715
_StockProps = 77
BackColor = 12648447
Rows = 27
Cols = 4
FixedCols = 0
ScrollBars = 2
End
End
Attribute VB_Name = "FormGetSysStatus"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub Execute_Click()
OldMousePointer = MousePointer
MousePointer = 11 ' Hour Glass Mouse Pointer
UpdateSystemStatus
MousePointer = OldMousePointer
End Sub
Private Sub ExitDlg_Click()
Hide
End Sub
Private Sub UpdateLogPointer()
LogEnd = LogEnd + 1
If LogEnd = MAXLOGNUM + 1 Then
LogEnd = 0
End If
If LogTop = LogEnd Then
LogTop = LogTop + 1
If LogTop = MAXLOGNUM + 1 Then
LogTop = 0
End If
End If
End Sub
Private Sub Form_Load()
ScrollBarWidthInPixels = GetSystemMetrics(SM_CXVSCROLL)
ScaleMode = 3 ' Pixels
GridWidthInPixels = SessionStatusGrid.Width
ScaleMode = 1 ' Twips
GridWidthInTwips = SessionStatusGrid.Width
ScrollBarWidthInTwips = (ScrollBarWidthInPixels * GridWidthInTwips) / GridWidthInPixels
GridWidthInTwips = GridWidthInTwips - ScrollBarWidthInTwips
For Counter = 0 To 3
SessionStatusGrid.ColWidth(Counter) = GridWidthInTwips / 4
SessionStatusGrid.ColAlignment(Counter) = 2 ' Centered Text
SessionStatusGrid.FixedAlignment(Counter) = 2 ' Centered Text
Next Counter
' SessionStatusGrid.ColWidth(4) = ScrollBarWidthInTwips
SessionStatusGrid.Row = 0
SessionStatusGrid.Col = 0
SessionStatusGrid.Text = "Session"
SessionStatusGrid.Col = 1
SessionStatusGrid.Text = "Host"
SessionStatusGrid.Col = 2
SessionStatusGrid.Text = "Emulator"
SessionStatusGrid.Col = 3
SessionStatusGrid.Text = "Status"
UpdateSystemStatus
End Sub
Private Sub StatusTitle_Click()
End Sub
Private Sub UpdateSystemStatus()
On Error GoTo ErrHandler
FunctionComp = True
rc = DoEvents() 'If you use VisualBasic V2.0, call
'DoEvents function each time before
'starting DDE conversation.
StatusDataText.LinkTimeout = -1
StatusDataText.LinkTopic = "IBM327032|System"
StatusDataText.LinkMode = COLD
StatusDataText.LinkItem = "Status"
StatusDataText.LinkRequest
StatusDataText.LinkMode = NONE
If FunctionComp = True Then
' MsgBox MSG_FUNCTION_COMP, 64, MSG_SAMPLE_PROG
EndStatus$ = MSG_OK
Else
MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
TempLogData$ = Time$ + ":Get System Status : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_APPLICATION + APPLICATION_NAME + """" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_TOPIC + """System""" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_ITEM + """Status""" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + "Data =" + """" + StatusDataText.Text + """" + Chr$(13) + Chr$(10)
LogData$(LogEnd) = TempLogData$
UpdateLogPointer
Loged = True
Exit Sub
ErrHandler:
FunctionComp = False
Resume Next
End Sub
Private Sub StatusDataText_Change()
SessionStatusGrid.SelStartCol = 0
SessionStatusGrid.SelStartRow = 1
SessionStatusGrid.SelEndCol = SessionStatusGrid.Cols - 1
SessionStatusGrid.SelEndRow = SessionStatusGrid.Rows - 1
SessionStatusGrid.Clip = StatusDataText.Text
SessionStatusGrid.SelStartCol = 1
SessionStatusGrid.SelEndCol = 0
End Sub