home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pc3270sa.zip
/
vbdde
/
fsesexwi.frm
< prev
next >
Wrap
Text File
|
2002-02-28
|
9KB
|
301 lines
VERSION 4.00
Begin VB.Form FormSessExMacroWin
Caption = "Window"
ClientHeight = 3852
ClientLeft = 4452
ClientTop = 3228
ClientWidth = 3036
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 = 4176
Left = 4404
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 3852
ScaleWidth = 3036
Top = 2952
Width = 3132
Begin VB.ComboBox SessionIdList
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
ItemData = "FSESEXWI.frx":0000
Left = 1320
List = "FSESEXWI.frx":0052
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 0
Top = 480
Width = 492
End
Begin VB.CommandButton ExitDlg
Cancel = -1 'True
Caption = "E&xit"
Height = 372
Left = 1800
TabIndex = 10
Top = 3360
Width = 852
End
Begin VB.CommandButton Execute
Caption = "&Execute"
Default = -1 'True
Height = 372
Left = 360
TabIndex = 9
Top = 3360
Width = 852
End
Begin VB.Frame Frame1
Caption = "Window command"
ForeColor = &H80000008&
Height = 2292
Left = 240
TabIndex = 1
Top = 840
Width = 2532
Begin VB.TextBox DataText
Height = 372
Left = 1680
TabIndex = 11
Top = 1200
Visible = 0 'False
Width = 204
End
Begin VB.TextBox CngnameText
BackColor = &H00FFFFC0&
Enabled = 0 'False
BeginProperty Font
name = "System"
charset = 0
weight = 700
size = 9.6
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 492
Left = 288
MultiLine = -1 'True
ScrollBars = 1 'Horizontal
TabIndex = 8
Top = 1680
Width = 2124
End
Begin VB.OptionButton CngnameOption
Caption = "&CNGNAME"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 7
Top = 1440
Width = 1260
End
Begin VB.OptionButton ShowOption
Caption = "&SHOW"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 6
Top = 1200
Width = 1356
End
Begin VB.OptionButton MinimizeOption
Caption = "MI&NIMIZE"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 5
Top = 960
Width = 1356
End
Begin VB.OptionButton MaximizeOption
Caption = "&MAXIMIZE"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 4
Top = 720
Width = 1356
End
Begin VB.OptionButton RestoreOption
Caption = "&RESTORE"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 3
Top = 480
Width = 1356
End
Begin VB.OptionButton HideOption
Caption = "&HIDE"
ForeColor = &H80000008&
Height = 252
Left = 96
TabIndex = 2
Top = 240
Value = -1 'True
Width = 1356
End
End
Begin VB.Frame Frame2
Caption = "Input Parameters"
Height = 3132
Left = 120
TabIndex = 12
Top = 120
Width = 2772
Begin VB.Label Label1
Caption = "Session &Id"
Height = 252
Left = 120
TabIndex = 13
Top = 360
Width = 1092
End
End
End
Attribute VB_Name = "FormSessExMacroWin"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub CngnameOption_Click()
CngnameText.Enabled = True
End Sub
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" + SessionIdList.Text
Else
MousePointer = OldMousePointer
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
Exit Sub
End If
CommandString$ = GetSessExWinData()
rc = DoEvents() 'If you use VisualBasic V2.0, call
'DoEvents function each time before
'starting DDE conversation.
DataText.LinkTimeout = -1
DataText.LinkTopic = APPLICATION_NAME + "|" + Topic$
DataText.LinkMode = COLD
DataText.LinkExecute CommandString$
DataText.LinkMode = NONE
MousePointer = OldMousePointer
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$ + ":Session Execute Macro : " + 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$ + "Command = " + """" + CommandString$ + """" + Chr$(13) + Chr$(10)
LogData$(LogEnd) = TempLogData$
UpdateLogPointer
Loged = True
Exit Sub
ErrHandler:
FunctionComp = False
Resume Next
End Sub
Private Sub ExitDlg_Click()
DataText.LinkMode = NONE
Hide
End Sub
Private Function GetSessExWinData() As String
Dim Action As String
If HideOption.Value = True Then
Action = "HIDE"
ElseIf RestoreOption.Value = True Then
Action = "RESTORE"
ElseIf MaximizeOption.Value = True Then
Action = "MAXIMIZE"
ElseIf MinimizeOption.Value = True Then
Action = "MINIMIZE"
ElseIf ShowOption.Value = True Then
Action = "SHOW"
Else
If Left$(CngnameText.Text, 1) = """" Then
temp$ = CngnameText.Text
Else
temp$ = """" + CngnameText.Text + """"
End If
Action = "CNGNAME" + "," + temp$
End If
GetSessExWinData = "[WINDOW(" + Action + ")]"
End Function
Private Sub Form_Load()
SessionIdList.ListIndex = 0
AdjustForNT351 FormSessExMacroWin
End Sub
Private Sub HideOption_Click()
CngnameText.Enabled = False
End Sub
Private Sub MaximizeOption_Click()
CngnameText.Enabled = False
End Sub
Private Sub MinimizeOption_Click()
CngnameText.Enabled = False
End Sub
Private Sub RestoreOption_Click()
CngnameText.Enabled = False
End Sub
Private Sub ShowOption_Click()
CngnameText.Enabled = False
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