home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pc3270sa.zip
/
vbdde
/
fstmouse.frm
< prev
next >
Wrap
Text File
|
2002-02-28
|
22KB
|
737 lines
VERSION 4.00
Begin VB.Form FormStartMouseIntercept
BorderStyle = 3 'Fixed Dialog
Caption = "Start Mouse Intercept"
ClientHeight = 6852
ClientLeft = 2736
ClientTop = 1332
ClientWidth = 6744
ControlBox = 0 'False
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 = 7176
Left = 2688
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6852
ScaleWidth = 6744
ShowInTaskbar = 0 'False
Top = 1056
Visible = 0 'False
Width = 6840
Begin VB.TextBox InterceptConditionText
BackColor = &H00C0FFFF&
BeginProperty Font
name = "System"
charset = 0
weight = 700
size = 9.6
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 372
Left = 3960
ScrollBars = 2 'Vertical
TabIndex = 11
TabStop = 0 'False
Top = 6360
Visible = 0 'False
Width = 372
End
Begin VB.Frame Frame3
Caption = "Intercepted Mouse &Input"
Height = 3372
Left = 120
TabIndex = 5
Top = 2880
Width = 6492
Begin VB.Frame Frame13
Caption = "Time Of Intercept"
Height = 612
Left = 4440
TabIndex = 40
Top = 1680
Width = 1932
Begin VB.Label TimeLabel
Height = 252
Left = 120
TabIndex = 41
Top = 240
Width = 1692
End
End
Begin VB.Frame RetrievedFrame
Caption = "Retrieved String"
Height = 852
Left = 120
TabIndex = 30
Top = 2400
Width = 6012
Begin VB.TextBox RetrievedText
BackColor = &H00C0FFFF&
Height = 492
Left = 120
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 1 'Horizontal
TabIndex = 39
Top = 240
Width = 5772
End
End
Begin VB.Frame Frame12
Caption = "Type of Click"
Height = 612
Left = 2280
TabIndex = 28
Top = 1680
Width = 1932
Begin VB.Label TypeOfClickLabel
Height = 252
Left = 120
TabIndex = 29
Top = 240
Width = 1692
End
End
Begin VB.Frame Frame11
Caption = "Which Button"
Height = 612
Left = 120
TabIndex = 26
Top = 1680
Width = 1932
Begin VB.Label WhichButtonLabel
Height = 252
Left = 120
TabIndex = 27
Top = 240
Width = 1692
End
End
Begin VB.Frame Frame10
Caption = "Number of Columns"
Height = 612
Left = 4440
TabIndex = 24
Top = 960
Width = 1932
Begin VB.Label NumberOfColumnsLabel
Height = 252
Left = 120
TabIndex = 25
Top = 240
Width = 1692
End
End
Begin VB.Frame Frame9
Caption = "Number of Rows"
Height = 612
Left = 2280
TabIndex = 22
Top = 960
Width = 1932
Begin VB.Label NumberOfRowsLabel
Height = 252
Left = 120
TabIndex = 23
Top = 240
Width = 1692
End
End
Begin VB.Frame Frame8
Caption = "Size of PS"
Height = 612
Left = 120
TabIndex = 17
Top = 960
Width = 1932
Begin VB.Label SizeOfPSLabel
Height = 252
Left = 120
TabIndex = 21
Top = 240
Width = 1692
End
End
Begin VB.Frame Frame7
Caption = "Column"
Height = 612
Left = 4440
TabIndex = 16
Top = 240
Width = 1932
Begin VB.Label ColumnLabel
Height = 252
Left = 120
TabIndex = 20
Top = 240
Width = 1692
End
End
Begin VB.Frame Frame6
Caption = "Row"
Height = 612
Left = 2280
TabIndex = 15
Top = 240
Width = 1932
Begin VB.Label RowLabel
Height = 252
Left = 120
TabIndex = 19
Top = 240
Width = 1692
End
End
Begin VB.Frame Frame5
Caption = "PS Offset"
Height = 612
Left = 120
TabIndex = 14
Top = 240
Width = 1932
Begin VB.Label PSOffsetLabel
Height = 252
Left = 120
TabIndex = 18
Top = 240
Width = 1692
End
End
End
Begin VB.ComboBox SessionIdList
BackColor = &H00FFFFC0&
ForeColor = &H00000000&
Height = 288
ItemData = "FSTMOUSE.frx":0000
Left = 1200
List = "FSTMOUSE.frx":0052
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 2
Top = 360
Width = 492
End
Begin VB.Frame UserDefFrame
Caption = "&User Defined String"
Enabled = 0 'False
Height = 612
Left = 240
TabIndex = 4
Top = 1800
Width = 2532
Begin VB.TextBox UserDefStrText
BackColor = &H00FFFFC0&
Enabled = 0 'False
ForeColor = &H00000000&
Height = 288
Left = 120
TabIndex = 31
Text = "example"
Top = 240
Width = 2292
End
End
Begin VB.TextBox MouseInputText
BackColor = &H00C0FFFF&
BeginProperty Font
name = "System"
charset = 0
weight = 700
size = 9.6
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 372
Left = 2160
ScrollBars = 2 'Vertical
TabIndex = 10
TabStop = 0 'False
Top = 6360
Visible = 0 'False
Width = 372
End
Begin VB.CommandButton ExitCommand
Cancel = -1 'True
Caption = "E&xit"
Height = 372
Left = 4920
TabIndex = 8
Top = 6360
Width = 732
End
Begin VB.CommandButton StopCommand
Caption = "&End"
Enabled = 0 'False
Height = 372
Left = 2880
TabIndex = 7
Top = 6360
Width = 732
End
Begin VB.CommandButton StartCommand
Caption = "&Begin"
Default = -1 'True
Height = 372
Left = 840
TabIndex = 6
Top = 6360
Width = 732
End
Begin VB.CheckBox TopicCheck
Caption = "Use Session Topic &Name "
Height = 372
Left = 240
TabIndex = 3
Top = 720
Value = 1 'Checked
Width = 2532
End
Begin VB.Frame Frame2
Caption = "Input Parameters"
Height = 2412
Left = 120
TabIndex = 0
Top = 120
Width = 6492
Begin VB.Frame Frame1
Caption = "Intercept &Conditions"
Height = 2052
Left = 2880
TabIndex = 32
Top = 240
Width = 3492
Begin VB.CheckBox ChkRetString
Caption = "Retrieve &Pointed String"
Height = 252
Left = 120
TabIndex = 38
Top = 1680
Value = 1 'Checked
Width = 2532
End
Begin VB.CheckBox ChkDoubleClick
Caption = "&Double Click"
Height = 252
Left = 1800
TabIndex = 37
Top = 720
Value = 1 'Checked
Width = 1572
End
Begin VB.CheckBox ChkSingleClick
Caption = "&Single Click"
Height = 252
Left = 1800
TabIndex = 36
Top = 240
Width = 1572
End
Begin VB.CheckBox ChkRightButton
Caption = "&Right Button"
Height = 252
Left = 120
TabIndex = 35
Top = 1200
Width = 1692
End
Begin VB.CheckBox ChkMiddleButton
Caption = "&Middle Button"
Height = 252
Left = 120
TabIndex = 34
Top = 720
Width = 1692
End
Begin VB.CheckBox ChkLeftButton
Caption = "&Left Button"
Height = 252
Left = 120
TabIndex = 33
Top = 240
Value = 1 'Checked
Width = 1692
End
End
Begin VB.Frame Frame4
Caption = "Topic"
Height = 612
Left = 120
TabIndex = 12
Top = 960
Width = 2532
Begin VB.Label TopicLabel
Alignment = 2 'Center
Caption = "SessionA"
Height = 252
Left = 120
TabIndex = 13
Top = 240
Width = 2292
End
End
Begin VB.Label Label1
Caption = "Session &Id"
Height = 252
Left = 120
TabIndex = 1
Top = 240
Width = 972
End
End
Begin VB.Label ResultMessageLabel
Alignment = 2 'Center
Caption = "DDE Conversation Active"
ForeColor = &H00FF0000&
Height = 252
Left = 120
TabIndex = 9
Top = 2640
Visible = 0 'False
Width = 6252
End
End
Attribute VB_Name = "FormStartMouseIntercept"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Dim MinimumHeight As Long
Dim MinimumWidth As Long
Dim OutputFrameWidth As Long
Dim OutputFrameHeight As Long
Dim StartTop As Long
Dim StartLeft As Long
Dim StopTop As Long
Dim StopLeft As Long
Dim WidthDelta As Long
Dim HeightDelta As Long
Dim ExitCommandTop As Long
Dim ExitCommandLeft As Long
Dim ResultMessageWidth As Long
Private Sub ChkRetString_Click()
If ChkRetString.Value = 1 Then
RetrievedFrame.Enabled = True
RetrievedText.Enabled = True
Else
RetrievedFrame.Enabled = False
RetrievedText.Enabled = False
End If
End Sub
Private Sub ExitCommand_Click()
Unload FormStartMouseIntercept
End Sub
Private Function GetTopicName() As String
If Len(SessionIdList.Text) > 0 Then
If TopicCheck.Value = CHECKED Then
ReturnString$ = "Session" + SessionIdList.Text
Else
ReturnString$ = "Sess" + SessionIdList.Text + "_" + UserDefStrText.Text
End If
GetTopicName = ReturnString$
Else
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
End If
End Function
Private Function InputConditions$()
If ChkLeftButton.Value = CHECKED Then
temp$ = "L"
Else
temp$ = "l"
End If
If ChkMiddleButton.Value = CHECKED Then
temp$ = temp$ + "M"
Else
temp$ = temp$ + "m"
End If
If ChkRightButton.Value = CHECKED Then
temp$ = temp$ + "R"
Else
temp$ = temp$ + "r"
End If
If ChkSingleClick.Value = CHECKED Then
temp$ = temp$ + "S"
Else
temp$ = temp$ + "s"
End If
If ChkDoubleClick.Value = CHECKED Then
temp$ = temp$ + "D"
Else
temp$ = temp$ + "d"
End If
If ChkRetString.Value = CHECKED Then
temp$ = temp$ + "T"
Else
temp$ = temp$ + "t"
End If
InputConditions$ = temp$
End Function
Private Sub Form_Load()
SessionIdList.ListIndex = 0
MinimumWidth = Width
MinimumHeight = Height
OutputFrameWidth = Frame3.Width
OutputFrameHeight = Frame3.Height
StartTop = StartCommand.Top
StartLeft = StartCommand.Left
StopTop = StopCommand.Top
StopLeft = StopCommand.Left
ExitCommandTop = ExitCommand.Top
ExitCommandLeft = ExitCommand.Left
ResultMessageWidth = ResultMessageLabel.Width
AdjustForNT351 FormStartMouseIntercept
End Sub
Private Sub Form_Resize()
If (Width < MinimumWidth) Then
Width = MinimumWidth
End If
If (Height < MinimumHeight) Then
Height = MinimumHeight
End If
WidthDelta = Width - MinimumWidth
HeightDelta = Height - MinimumHeight
Frame3.Width = OutputFrameWidth + WidthDelta
Frame3.Height = OutputFrameHeight + HeightDelta
StartCommand.Top = StartTop + HeightDelta
StartCommand.Left = StartLeft
ExitCommand.Top = ExitCommandTop + HeightDelta
ExitCommand.Left = ExitCommandLeft + WidthDelta
StopCommand.Top = StopTop + HeightDelta
StopCommand.Left = (StartCommand.Left + ExitCommand.Left) / 2
ResultMessageLabel.Width = ResultMessageWidth + WidthDelta
Refresh
End Sub
Private Sub MouseInputText_Change()
Dim temp(1 To 8) As String
If (MouseInputText.LinkMode = HOT) And (MouseInputText.Text <> "") Then
TimeLabel.Caption = Time
BeginPosition = 1
For Counter = 1 To 8
EndPosition = InStr(BeginPosition, MouseInputText.Text, Chr$(9))
temp(Counter) = Mid(MouseInputText.Text, BeginPosition, EndPosition - BeginPosition)
BeginPosition = EndPosition + 1
Next Counter
PSOffsetLabel.Caption = temp(1)
RowLabel.Caption = temp(2)
ColumnLabel.Caption = temp(3)
SizeOfPSLabel.Caption = temp(4)
NumberOfRowsLabel.Caption = temp(5)
NumberOfColumnsLabel.Caption = temp(6)
WhichButtonLabel.Caption = temp(7)
TypeOfClickLabel.Caption = temp(8)
RetrievedText.Text = Mid$(MouseInputText.Text, BeginPosition)
PSDataLen& = Val(Left$(MouseInputText.Text, 4)) + 15
LogData$(LogEnd) = Time$ + ":Mouse was intercepted" + Chr$(13) + Chr$(10)
UpdateLogPointer
UpdateLog
End If
End Sub
Private Sub Option2_Click()
End Sub
Private Sub StartCommand_Click()
On Error GoTo ErrHandler
FunctionComp = True
OldMousePointer = MousePointer
MousePointer = 11 ' Hour Glass Mouse Pointer
MouseInputLog.Text = ""
DisplayType$ = GetDisplayType$(SessionIdList.Text)
If DisplayType$ = "NONE" Then
MousePointer = OldMousePointer
MsgBox MSG_INVALID_PSID + SessionIdList.Text, 48, MSG_SAMPLE_PROG
Exit Sub
End If
Topic$ = GetTopicName()
If Len(Topic$) <= 0 Then
MsgBox MSG_PARA_ERROR, 48, MSG_SAMPLE_PROG
MousePointer = OldMousePointer
Exit Sub
End If
Item$ = "MOUSE"
rc = DoEvents() 'If you use VisualBasic V2.0, call
'DoEvents function each time before
'starting DDE conversation.
MouseInputText.LinkTimeout = -1
MouseInputText.LinkTopic = APPLICATION_NAME + "|" + Topic$
MouseInputText.LinkItem = Item$
MouseInputText.LinkMode = COLD
MouseInputText.Text = InputConditions$()
MouseInputText.LinkPoke
MouseInputText.LinkMode = HOT
MousePointer = OldMousePointer
If FunctionComp = True Then
ResultMessageLabel.Visible = True
EndStatus$ = MSG_OK
StartCommand.Enabled = False
StopCommand.Enabled = True
ExitCommand.Enabled = False
SessionIdList.Enabled = False
TopicCheck.Enabled = False
UserDefFrame.Enabled = False
UserDefStrText.Enabled = False
ChkLeftButton.Enabled = False
ChkRightButton.Enabled = False
ChkMiddleButton.Enabled = False
ChkSingleClick.Enabled = False
ChkDoubleClick.Enabled = False
ChkRetString.Enabled = False
Else
ResultMessageLabel.Visible = False
MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
TempLogData$ = Time$ + ":Start Mouse Intercept : " + 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)
LogData$(LogEnd) = TempLogData$
UpdateLogPointer
UpdateLog
Exit Sub
ErrHandler:
FunctionComp = False
Resume Next
End Sub
Private Sub StopCommand_Click()
On Error GoTo StopErrHandler
FunctionComp = True
MouseInputText.LinkTimeout = -1
MouseInputText.LinkMode = NONE
StartCommand.Enabled = True
If FunctionComp = True Then
ResultMessageLabel.Visible = False
EndStatus$ = MSG_OK
ExitCommand.Enabled = True
StartCommand.Enabled = True
SessionIdList.Enabled = True
TopicCheck.Enabled = True
TopicCheck_Click
ChkLeftButton.Enabled = True
ChkRightButton.Enabled = True
ChkMiddleButton.Enabled = True
ChkSingleClick.Enabled = True
ChkDoubleClick.Enabled = True
ChkRetString.Enabled = True
Else
MsgBox MSG_DDE_ERROR, 48, MSG_SAMPLE_PROG
EndStatus$ = MSG_NG
End If
LogData$(LogEnd) = Time$ + ":Stop Mouse Intercept : " + EndStatus$ + Chr$(13) + Chr$(10)
UpdateLogPointer
UpdateLog
Exit Sub
StopErrHandler:
FunctionComp = False
Resume Next
End Sub
Private Sub TopicCheck_Click()
If TopicCheck.Value = CHECKED Then
UserDefFrame.Enabled = False
UserDefStrText.Enabled = False
Else
UserDefFrame.Enabled = True
UserDefStrText.Enabled = True
End If
TopicLabel.Caption = GetTopicName()
End Sub
Private Sub UpdateLog()
temp$ = ""
If LogTop > LogEnd Then
For i% = LogTop To MAXLOGNUM
temp$ = temp$ + LogData$(i%)
Next
For i% = 0 To LogEnd
temp$ = temp$ + LogData$(i%)
Next
ElseIf LogTop < LogEnd Then
For i% = LogTop To LogEnd
temp$ = temp$ + LogData(i%)
Next
Else
temp$ = LogData(i%)
End If
MainForm.FunctionLog.Text = temp$
Loged = 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
Private Sub UserDefStrText_Change()
TopicLabel.Caption = GetTopicName()
End Sub