home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pc3270sa.zip
/
vbdde
/
fgsyscon.frm
< prev
next >
Wrap
Text File
|
2002-02-28
|
10KB
|
311 lines
VERSION 4.00
Begin VB.Form FormGetSysConfiguration
BorderStyle = 3 'Fixed Dialog
Caption = "Get System Configuration"
ClientHeight = 3264
ClientLeft = 3648
ClientTop = 3240
ClientWidth = 3612
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 = 3588
Left = 3600
LinkMode = 1 'Source
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3264
ScaleWidth = 3612
ShowInTaskbar = 0 'False
Top = 2964
Width = 3708
Begin VB.TextBox ConfigurationDataText
Height = 372
Left = 2760
TabIndex = 1
Top = 2760
Visible = 0 'False
Width = 204
End
Begin VB.CommandButton ExitDlg
Cancel = -1 'True
Caption = "&OK"
Default = -1 'True
Height = 372
Left = 1320
TabIndex = 2
Top = 2760
Width = 972
End
Begin VB.Frame Frame1
Caption = "System Configuration Information"
Height = 2412
Left = 120
TabIndex = 0
Top = 120
Width = 3372
Begin VB.Label Label2
Caption = "Version:"
ForeColor = &H80000008&
Height = 252
Left = 120
TabIndex = 14
Top = 240
Width = 972
End
Begin VB.Label Version
ForeColor = &H80000008&
Height = 252
Left = 2040
TabIndex = 13
Top = 240
Width = 1212
End
Begin VB.Label Label3
Caption = "Level:"
ForeColor = &H80000008&
Height = 252
Left = 120
TabIndex = 12
Top = 600
Width = 972
End
Begin VB.Label Level
ForeColor = &H80000008&
Height = 252
Left = 2040
TabIndex = 11
Top = 600
Width = 1212
End
Begin VB.Label Label4
Caption = "Date:"
ForeColor = &H80000008&
Height = 252
Left = 120
TabIndex = 10
Top = 960
Width = 972
End
Begin VB.Label DateLog
ForeColor = &H80000008&
Height = 252
Left = 2040
TabIndex = 9
Top = 960
Width = 1212
End
Begin VB.Label Label5
Caption = "SysModel Number:"
ForeColor = &H80000008&
Height = 252
Left = 120
TabIndex = 8
Top = 1320
Width = 1692
End
Begin VB.Label SysModel
ForeColor = &H80000008&
Height = 252
Left = 2040
TabIndex = 7
Top = 1320
Width = 1212
End
Begin VB.Label Label6
Caption = "Monitor Type:"
ForeColor = &H80000008&
Height = 252
Left = 120
TabIndex = 6
Top = 1680
Width = 1332
End
Begin VB.Label Moniter
ForeColor = &H80000008&
Height = 252
Left = 2040
TabIndex = 5
Top = 1680
Width = 1212
End
Begin VB.Label Label7
Caption = "Country Code:"
ForeColor = &H80000008&
Height = 252
Left = 120
TabIndex = 4
Top = 2040
Width = 1212
End
Begin VB.Label Country
ForeColor = &H80000008&
Height = 252
Left = 2040
TabIndex = 3
Top = 2040
Width = 1212
End
End
End
Attribute VB_Name = "FormGetSysConfiguration"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Function DisplaySystemStatus() As Integer
On Error GoTo ErrorHandler
Dim Status As Integer
Status = True
StartPos& = 1
EndPos& = 1
StringLength& = Len(ConfigurationDataText.Text)
For i% = 0 To 4
EndPos& = InStr(StartPos&, ConfigurationDataText.Text, Chr$(9))
If (EndPos& = StartPos&) Or (EndPos& = 0) Then
Status = False
Exit For
End If
TempData(i%) = Mid$(ConfigurationDataText.Text, StartPos&, EndPos& - StartPos&)
StartPos& = EndPos& + 1
Next i%
If (Status = True) And (StringLength& > StartPos&) Then
TempData(5) = Mid$(ConfigurationDataText.Text, StartPos&, StringLength&)
Version.Caption = TempData(0)
Level.Caption = TempData(1)
DateLog.Caption = TempData(2)
SysModel.Caption = TempData(3)
Moniter.Caption = TempData(4)
Country.Caption = TempData(5)
End If
DisplaySystemStatus = Status
Exit Function
ErrorHandler:
dummy% = DoEvents()
Status = False
Resume Next
End Function
Private Sub Execute_Click()
On Error GoTo ErrHandler
FunctionComp = True
rc = DoEvents() 'If you use VisualBasic V2.0, call
'DoEvents function each time before
'starting DDE conversation.
ConfigurationDataText.LinkTimeout = -1
ConfigurationDataText.LinkTopic = "IBM327032|System"
ConfigurationDataText.LinkMode = COLD
ConfigurationDataText.LinkItem = "SysCon"
ConfigurationDataText.LinkRequest
ConfigurationDataText.LinkMode = NONE
If FunctionComp = True Then
If DisplaySystemStatus() = True Then
MsgBox MSG_FUNCTION_COMP, 64, MSG_SAMPLE_PROG
EndStatus$ = MSG_OK
Else
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
Else
MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
TempLogData$ = Time$ + ":Get System Configuration : " + 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 + """SysCon""" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + "Data =" + """" + ConfigurationDataText.Text + """" + Chr$(13) + Chr$(10)
LogData$(LogEnd) = TempLogData$
UpdateLogPointer
Loged = True
Exit Sub
ErrHandler:
FunctionComp = False
Resume Next
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()
On Error GoTo ErrHandler
FunctionComp = True
rc = DoEvents() 'If you use VisualBasic V2.0, call
'DoEvents function each time before
'starting DDE conversation.
ConfigurationDataText.LinkTimeout = -1
ConfigurationDataText.LinkTopic = "IBM327032|System"
ConfigurationDataText.LinkMode = COLD
ConfigurationDataText.LinkItem = "SysCon"
ConfigurationDataText.LinkRequest
ConfigurationDataText.LinkMode = NONE
If FunctionComp = True Then
If DisplaySystemStatus() = True Then
' MsgBox MSG_FUNCTION_COMP, 64, MSG_SAMPLE_PROG
EndStatus$ = MSG_OK
Else
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
Else
DisplaySystemStatusError
MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
TempLogData$ = Time$ + ":Get System Configuration : " + 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 + """SysCon""" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + "Data =" + """" + ConfigurationDataText.Text + """" + Chr$(13) + Chr$(10)
LogData$(LogEnd) = TempLogData$
UpdateLogPointer
Loged = True
Exit Sub
ErrHandler:
FunctionComp = False
Resume Next
End Sub
Private Sub DisplaySystemStatusError()
Version.Caption = "Undetermined"
Level.Caption = "Undetermined"
DateLog.Caption = "Undetermined"
SysModel.Caption = "Undetermined"
Moniter.Caption = "Undetermined"
Country.Caption = "Undetermined"
End Sub