home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pc3270sa.zip
/
vbdde
/
fsesexsk.frm
< prev
next >
Wrap
Text File
|
2002-02-28
|
12KB
|
377 lines
VERSION 4.00
Begin VB.Form FormSessExMacroSendKey
Caption = "Send Key"
ClientHeight = 5244
ClientLeft = 3636
ClientTop = 2304
ClientWidth = 4704
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 = 5568
Left = 3588
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 5244
ScaleWidth = 4704
Top = 2028
Width = 4800
Begin VB.TextBox TempText
BackColor = &H00FFFFC0&
Height = 372
Left = 2400
MaxLength = 255
TabIndex = 17
Top = 4800
Visible = 0 'False
Width = 252
End
Begin VB.ComboBox SessionIdList
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
ItemData = "FSESEXSK.frx":0000
Left = 1200
List = "FSESEXSK.frx":0052
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 2
Top = 480
Width = 492
End
Begin VB.CommandButton ExitDlg
Cancel = -1 'True
Caption = "E&xit"
Height = 372
Left = 2880
TabIndex = 15
Top = 4800
Width = 852
End
Begin VB.CommandButton Execute
Caption = "&Execute"
Default = -1 'True
Height = 372
Left = 960
TabIndex = 14
Top = 4800
Width = 852
End
Begin VB.Frame SendkeyFrame
Caption = "Input Parameters"
ForeColor = &H80000008&
Height = 4572
Left = 120
TabIndex = 0
Top = 120
Width = 4452
Begin VB.Frame Frame2
Caption = "Outgoing Text, Commands and Macros"
Height = 852
Left = 120
TabIndex = 12
Top = 3480
Width = 4212
Begin VB.TextBox TotalSendKeyText
BackColor = &H00FFFFC0&
Height = 492
Left = 120
Locked = -1 'True
MaxLength = 255
MultiLine = -1 'True
ScrollBars = 1 'Horizontal
TabIndex = 13
TabStop = 0 'False
Text = "FSESEXSK.frx":00A4
Top = 240
Width = 3972
End
End
Begin VB.ComboBox CommandCombo
BackColor = &H00FFC0C0&
Height = 288
ItemData = "FSESEXSK.frx":00B2
Left = 1440
List = "FSESEXSK.frx":0227
Style = 2 'Dropdown List
TabIndex = 7
Top = 1680
Width = 2772
End
Begin VB.OptionButton MacroOption
Caption = "&Macro"
Height = 252
Left = 240
TabIndex = 8
Top = 2280
Width = 1212
End
Begin VB.OptionButton CommandOption
Caption = "&Command"
Height = 252
Left = 240
TabIndex = 6
Top = 1680
Value = -1 'True
Width = 1212
End
Begin VB.OptionButton StringOption
Caption = "&String"
Height = 252
Left = 240
TabIndex = 4
Top = 1080
Width = 1212
End
Begin VB.TextBox MacroText
BackColor = &H00FFC0C0&
Enabled = 0 'False
Height = 492
Left = 1440
MaxLength = 255
MultiLine = -1 'True
ScrollBars = 1 'Horizontal
TabIndex = 9
Top = 2280
Width = 2772
End
Begin VB.TextBox SendkeyText
BackColor = &H00FFC0C0&
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 = 1440
MaxLength = 255
MultiLine = -1 'True
ScrollBars = 1 'Horizontal
TabIndex = 5
Top = 1080
Width = 2772
End
Begin VB.Frame Frame1
Caption = "Choose One or More"
Height = 2532
Left = 120
TabIndex = 3
Top = 840
Width = 4212
Begin VB.CommandButton Clear
Caption = "&Delete All"
Height = 372
Left = 2280
TabIndex = 11
Top = 2040
Width = 972
End
Begin VB.CommandButton Command1
Caption = "&Add "
Height = 372
Left = 840
TabIndex = 10
Top = 2040
Width = 1092
End
End
Begin VB.Label Label1
Caption = "Session &Id"
Height = 252
Left = 120
TabIndex = 1
Top = 360
Width = 972
End
End
Begin VB.TextBox DataText
BackColor = &H00C0FFFF&
Height = 372
Left = 2040
TabIndex = 16
Text = "Text2"
Top = 4800
Visible = 0 'False
Width = 204
End
End
Attribute VB_Name = "FormSessExMacroSendKey"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub Clear_Click()
TempText.Text = ""
TotalSendKeyText.Text = "[SENDKEY()]"
End Sub
Private Sub Command1_Click()
If StringOption.Value = True Then
If TempText.Text = "" Then
temp$ = """" & SendkeyText.Text & """"
Else
temp$ = TempText.Text & "," & """" & SendkeyText.Text & """"
End If
If Len(temp$) > (255 - Len("[SENDKEY()]")) Then
MsgBox "Total string can only be 255 characters."
Exit Sub
End If
TempText.Text = temp$
TotalSendKeyText.Text = "[SENDKEY(" + TempText.Text + ")]"
ElseIf CommandOption.Value = True Then
If TempText.Text = "" Then
temp$ = CommandCombo.Text
Else
temp$ = TempText.Text & "," & CommandCombo.Text
End If
If Len(temp$) > (255 - Len("[SENDKEY()]")) Then
MsgBox "Total string can only be 255 characters."
Exit Sub
End If
TempText.Text = temp$
TotalSendKeyText.Text = "[SENDKEY(" + TempText.Text + ")]"
Else ' MacroOption.Value = True
If TempText.Text = "" Then
temp$ = MacroText.Text
Else
temp$ = TempText.Text & "," & MacroText.Text
End If
If Len(temp$) > (255 - Len("[SENDKEY()]")) Then
MsgBox "Total string can only be 255 characters."
Exit Sub
End If
TempText.Text = temp$
TotalSendKeyText.Text = "[SENDKEY(macro " + TempText.Text + ")]"
End If
End Sub
Private Sub CommandOption_Click()
SendkeyText.Enabled = False
CommandCombo.Enabled = True
MacroText.Enabled = False
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
If Len(TotalSendKeyText.Text) <> Len("[SENDKEY()]") Then
CommandString$ = TotalSendKeyText.Text
Else ' Nothing to Send
MousePointer = OldMousePointer
MsgBox "Add Text, Commands and Macros to send."
Exit Sub
End If
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 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
CommandCombo.ListIndex = 8
TotalSendKeyText.Text = "[SENDKEY()]"
AdjustForNT351 FormSessExMacroSendKey
End Sub
Private Sub MacroOption_Click()
SendkeyText.Enabled = False
CommandCombo.Enabled = False
MacroText.Enabled = True
End Sub
Private Sub StringOption_Click()
SendkeyText.Enabled = True
CommandCombo.Enabled = False
MacroText.Enabled = False
End Sub