home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pc3270sa.zip
/
vbdde
/
fgsesstd.frm
< prev
next >
Wrap
Text File
|
2002-02-28
|
15KB
|
477 lines
VERSION 4.00
Begin VB.Form FormGetSessStatus
BorderStyle = 3 'Fixed Dialog
Caption = "Get Session Status"
ClientHeight = 5268
ClientLeft = 3468
ClientTop = 2496
ClientWidth = 5304
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 = 5592
Left = 3420
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5268
ScaleWidth = 5304
ShowInTaskbar = 0 'False
Top = 2220
Width = 5400
Begin VB.Frame Frame9
Caption = "PS Status"
ForeColor = &H80000008&
Height = 612
Left = 240
TabIndex = 30
Top = 1080
Width = 1332
Begin VB.Label PSStatusLabel
ForeColor = &H80000008&
Height = 252
Left = 120
TabIndex = 31
Top = 240
Width = 1068
End
End
Begin VB.ComboBox SessionIdList
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
ItemData = "FGSESSTD.frx":0000
Left = 1200
List = "FGSESSTD.frx":0052
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 0
Top = 360
Width = 492
End
Begin VB.TextBox SessStatDataText
Height = 372
Left = 2520
TabIndex = 26
Top = 4800
Visible = 0 'False
Width = 204
End
Begin VB.CommandButton ExitDlg
Cancel = -1 'True
Caption = "E&xit"
Height = 372
Left = 3240
TabIndex = 25
Top = 4800
Width = 972
End
Begin VB.CommandButton Execute
Caption = "&Execute"
Default = -1 'True
Height = 375
Left = 1080
TabIndex = 24
Top = 4800
Width = 975
End
Begin VB.Frame Frame4
Caption = "TrimRect Status"
ForeColor = &H80000008&
Height = 1692
Left = 240
TabIndex = 13
Top = 2880
Width = 4812
Begin VB.Frame Frame6
Caption = "Lower right corner"
ForeColor = &H80000008&
Height = 612
Left = 1680
TabIndex = 19
Top = 960
Width = 3012
Begin VB.Label TrimLRRowLabel
ForeColor = &H80000008&
Height = 252
Left = 2160
TabIndex = 22
Top = 240
Width = 396
End
Begin VB.Label Label13
Caption = "Y Coord"
ForeColor = &H80000008&
Height = 252
Left = 1416
TabIndex = 21
Top = 240
Width = 756
End
Begin VB.Label TrimLRColumnLabel
ForeColor = &H80000008&
Height = 252
Left = 840
TabIndex = 23
Top = 240
Width = 396
End
Begin VB.Label Label12
Caption = "X Coord"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 20
Top = 240
Width = 756
End
End
Begin VB.Frame Frame5
Caption = "Top left corner"
ForeColor = &H80000008&
Height = 612
Left = 1680
TabIndex = 14
Top = 240
Width = 3012
Begin VB.Label TrimTLRowLabel
ForeColor = &H80000008&
Height = 252
Left = 2280
TabIndex = 17
Top = 240
Width = 396
End
Begin VB.Label Label9
Caption = "Y Coord"
ForeColor = &H80000008&
Height = 252
Left = 1440
TabIndex = 16
Top = 240
Width = 732
End
Begin VB.Label TrimTLColumnLabel
ForeColor = &H80000008&
Height = 252
Left = 840
TabIndex = 18
Top = 240
Width = 396
End
Begin VB.Label Label8
Caption = "X Coord"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 15
Top = 240
Width = 756
End
End
Begin VB.Frame Frame10
Caption = "Status"
Height = 612
Left = 120
TabIndex = 32
Top = 240
Width = 1452
Begin VB.Label TrimStatusLabel
Height = 252
Left = 120
TabIndex = 33
Top = 240
Width = 1212
End
End
End
Begin VB.Frame Frame2
Caption = "PS Dimensions"
ForeColor = &H80000008&
Height = 972
Left = 2280
TabIndex = 3
Top = 1800
Width = 1932
Begin VB.Label PSRowLabel
ForeColor = &H80000008&
Height = 252
Left = 768
TabIndex = 6
Top = 600
Width = 1068
End
Begin VB.Label Label6
Caption = "Height"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 5
Top = 600
Width = 696
End
Begin VB.Label PSColumnLabel
ForeColor = &H80000008&
Height = 252
Left = 768
TabIndex = 7
Top = 240
Width = 1068
End
Begin VB.Label Label5
Caption = "Width"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 4
Top = 240
Width = 696
End
End
Begin VB.Frame Frame3
Caption = "Cursor Position"
ForeColor = &H80000008&
Height = 972
Left = 240
TabIndex = 8
Top = 1800
Width = 1932
Begin VB.Label CursorRowLabel
ForeColor = &H80000008&
Height = 252
Left = 960
TabIndex = 11
Top = 600
Width = 852
End
Begin VB.Label Label11
Caption = "Y Coord"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 10
Top = 600
Width = 876
End
Begin VB.Label CursorColumnLabel
ForeColor = &H80000008&
Height = 252
Left = 960
TabIndex = 12
Top = 240
Width = 852
End
Begin VB.Label Label10
Caption = "X Coord"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 9
Top = 240
Width = 876
End
End
Begin VB.Frame Frame1
Caption = "Window Status"
ForeColor = &H80000008&
Height = 612
Left = 1680
TabIndex = 1
Top = 1080
Width = 1452
Begin VB.Label StatusLabel
ForeColor = &H80000008&
Height = 252
Left = 120
TabIndex = 2
Top = 240
Width = 972
End
End
Begin VB.Frame Frame7
Caption = "Input Parameters"
Height = 612
Left = 120
TabIndex = 27
Top = 120
Width = 1692
Begin VB.Label Label14
Caption = "Session &Id"
Height = 252
Left = 120
TabIndex = 28
Top = 240
Width = 972
End
End
Begin VB.Frame Frame8
Caption = "Session Status"
Height = 3852
Left = 120
TabIndex = 29
Top = 840
Width = 5052
Begin VB.Frame Frame11
Caption = "Usage"
Height = 612
Left = 3120
TabIndex = 34
Top = 240
Width = 972
Begin VB.Label UsageLabel
Height = 252
Left = 120
TabIndex = 35
Top = 240
Width = 732
End
End
End
End
Attribute VB_Name = "FormGetSessStatus"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Function DisplaySessStat() As Integer
On Error GoTo ErrorHandler
Dim Status As Integer
Status = True
StartPos& = 1
EndPos& = 1
StringLength& = Len(SessStatDataText.Text)
For i% = 0 To 11
EndPos& = InStr(StartPos&, SessStatDataText.Text, Chr$(9))
TempData$(i%) = LTrim$(RTrim$(Mid$(SessStatDataText.Text, StartPos&, EndPos& - StartPos&)))
StartPos& = EndPos& + 1
Next i%
TempData$(12) = Mid$(SessStatDataText.Text, StartPos&, StringLength&)
If Status = True Then
StatusLabel.Caption = TempData$(0)
UsageLabel.Caption = TempData$(1)
PSColumnLabel.Caption = TempData$(2)
PSRowLabel.Caption = TempData$(3)
CursorColumnLabel.Caption = TempData$(4)
CursorRowLabel.Caption = TempData$(5)
TrimStatusLabel.Caption = TempData$(6)
TrimTLColumnLabel.Caption = TempData$(7)
TrimTLRowLabel.Caption = TempData$(8)
TrimLRColumnLabel.Caption = TempData$(9)
TrimLRRowLabel.Caption = TempData$(10)
If TempData$(11) = "0" Then
PSStatusLabel.Caption = "Unlocked"
ElseIf TempData$(11) = "4" Then
PSStatusLabel.Caption = "Busy"
ElseIf TempData$(11) = "5" Then
PSStatusLabel.Caption = "Locked"
Else
Status = False
End If
End If
DisplaySessStat = Status
Exit Function
ErrorHandler:
dummy% = DoEvents()
Status = False
Resume Next
End Function
Private Sub Execute_Click()
On Error GoTo ErrHandler
FunctionComp = True
OldMousePointer = MousePointer
MousePointer = 11 ' Hour Glass Mouse Pointer
DisplayType$ = GetDisplayType$(SessionIdList.Text)
If DisplayType$ = "NONE" Then
MousePointer = OldMousePointer
MsgBox MSG_INVALID_PSID + SessionIdList.Text, 48, MSG_SAMPLE_PROG
Exit Sub
End If
temp$ = LTrim$(RTrim$(SessionIdList.Text))
If Len(temp$) > 0 Then
Topic$ = "Session" + temp$
Else
MousePointer = OldMousePointer
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
Exit Sub
End If
Item$ = "SSTAT"
rc = DoEvents() 'If you use VisualBasic V2.0, call
'DoEvents function each time before
'starting DDE conversation.
SessStatDataText.LinkTimeout = -1
SessStatDataText.LinkTopic = APPLICATION_NAME + "|" + Topic$
SessStatDataText.LinkMode = COLD
SessStatDataText.LinkItem = Item$
SessStatDataText.LinkRequest
SessStatDataText.LinkMode = NONE
MousePointer = OldMousePointer
If FunctionComp = True Then
If DisplaySessStat() = 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 Session Status : " + EndStatus$ + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_APPLICATION + APPLICATION_NAME + """" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_TOPIC + """" + Topic$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + MSG_ITEM + """" + Item$ + """" + Chr$(13) + Chr$(10) + Chr$(9)
TempLogData$ = TempLogData$ + "Data =" + """" + SessStatDataText.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()
SessionIdList.ListIndex = 0
End Sub