home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pc3270sa.zip / vbdde / vbdde.frm < prev    next >
Text File  |  2002-02-28  |  25KB  |  963 lines

  1. VERSION 4.00
  2. Begin VB.Form MainForm 
  3.    Caption         =   "DDE Test Program"
  4.    ClientHeight    =   4524
  5.    ClientLeft      =   1956
  6.    ClientTop       =   3120
  7.    ClientWidth     =   8460
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   0
  11.       weight          =   700
  12.       size            =   7.8
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    ForeColor       =   &H80000008&
  18.    Height          =   5076
  19.    Left            =   1908
  20.    LinkMode        =   1  'Source
  21.    LinkTopic       =   "Form1"
  22.    ScaleHeight     =   4524
  23.    ScaleWidth      =   8460
  24.    Top             =   2616
  25.    Width           =   8556
  26.    Begin VB.TextBox SessionCoordsTextBox 
  27.       Height          =   372
  28.       Left            =   8280
  29.       TabIndex        =   33
  30.       Text            =   "Text1"
  31.       Top             =   1920
  32.       Visible         =   0   'False
  33.       Width           =   252
  34.    End
  35.    Begin VB.TextBox SessionDimensionsTextBox 
  36.       Height          =   372
  37.       Left            =   8280
  38.       TabIndex        =   32
  39.       Text            =   "Text1"
  40.       Top             =   2400
  41.       Visible         =   0   'False
  42.       Width           =   252
  43.    End
  44.    Begin VB.TextBox GetDisplayTypeText 
  45.       Height          =   372
  46.       Left            =   8280
  47.       TabIndex        =   31
  48.       Text            =   "Text1"
  49.       Top             =   3000
  50.       Visible         =   0   'False
  51.       Width           =   252
  52.    End
  53.    Begin VB.Timer SessionUpdateTimer 
  54.       Interval        =   5000
  55.       Left            =   8160
  56.       Top             =   3600
  57.    End
  58.    Begin VB.TextBox SystemTopicsText 
  59.       Height          =   372
  60.       Left            =   8160
  61.       TabIndex        =   30
  62.       Text            =   "Text1"
  63.       Top             =   4080
  64.       Visible         =   0   'False
  65.       Width           =   252
  66.    End
  67.    Begin VB.TextBox FunctionLog 
  68.       BackColor       =   &H00C0FFFF&
  69.       BorderStyle     =   0  'None
  70.       BeginProperty Font 
  71.          name            =   "System"
  72.          charset         =   0
  73.          weight          =   700
  74.          size            =   9.6
  75.          underline       =   0   'False
  76.          italic          =   0   'False
  77.          strikethrough   =   0   'False
  78.       EndProperty
  79.       ForeColor       =   &H00FF0000&
  80.       Height          =   3372
  81.       Left            =   360
  82.       Locked          =   -1  'True
  83.       MultiLine       =   -1  'True
  84.       ScrollBars      =   3  'Both
  85.       TabIndex        =   0
  86.       TabStop         =   0   'False
  87.       Top             =   360
  88.       Width           =   7692
  89.    End
  90.    Begin VB.Frame FunctionLogFrame 
  91.       Caption         =   "DDE Function Call Log"
  92.       Height          =   3732
  93.       Left            =   240
  94.       TabIndex        =   1
  95.       Top             =   120
  96.       Width           =   7932
  97.    End
  98.    Begin VB.Label SessionLabel 
  99.       Alignment       =   2  'Center
  100.       Caption         =   "Z"
  101.       ForeColor       =   &H00808080&
  102.       Height          =   252
  103.       Index           =   25
  104.       Left            =   7920
  105.       TabIndex        =   29
  106.       Top             =   4080
  107.       Width           =   252
  108.    End
  109.    Begin VB.Label SessionLabel 
  110.       Alignment       =   2  'Center
  111.       Caption         =   "Y"
  112.       ForeColor       =   &H00808080&
  113.       Height          =   252
  114.       Index           =   24
  115.       Left            =   7680
  116.       TabIndex        =   28
  117.       Top             =   4080
  118.       Width           =   252
  119.    End
  120.    Begin VB.Label SessionLabel 
  121.       Alignment       =   2  'Center
  122.       Caption         =   "X"
  123.       ForeColor       =   &H00808080&
  124.       Height          =   252
  125.       Index           =   23
  126.       Left            =   7440
  127.       TabIndex        =   27
  128.       Top             =   4080
  129.       Width           =   252
  130.    End
  131.    Begin VB.Label SessionLabel 
  132.       Alignment       =   2  'Center
  133.       Caption         =   "W"
  134.       ForeColor       =   &H00808080&
  135.       Height          =   252
  136.       Index           =   22
  137.       Left            =   7200
  138.       TabIndex        =   26
  139.       Top             =   4080
  140.       Width           =   252
  141.    End
  142.    Begin VB.Label SessionLabel 
  143.       Alignment       =   2  'Center
  144.       Caption         =   "V"
  145.       ForeColor       =   &H00808080&
  146.       Height          =   252
  147.       Index           =   21
  148.       Left            =   6960
  149.       TabIndex        =   25
  150.       Top             =   4080
  151.       Width           =   252
  152.    End
  153.    Begin VB.Label SessionLabel 
  154.       Alignment       =   2  'Center
  155.       Caption         =   "U"
  156.       ForeColor       =   &H00808080&
  157.       Height          =   252
  158.       Index           =   20
  159.       Left            =   6720
  160.       TabIndex        =   24
  161.       Top             =   4080
  162.       Width           =   252
  163.    End
  164.    Begin VB.Label SessionLabel 
  165.       Alignment       =   2  'Center
  166.       Caption         =   "T"
  167.       ForeColor       =   &H00808080&
  168.       Height          =   252
  169.       Index           =   19
  170.       Left            =   6480
  171.       TabIndex        =   23
  172.       Top             =   4080
  173.       Width           =   252
  174.    End
  175.    Begin VB.Label SessionLabel 
  176.       Alignment       =   2  'Center
  177.       Caption         =   "S"
  178.       ForeColor       =   &H00808080&
  179.       Height          =   252
  180.       Index           =   18
  181.       Left            =   6240
  182.       TabIndex        =   22
  183.       Top             =   4080
  184.       Width           =   252
  185.    End
  186.    Begin VB.Label SessionLabel 
  187.       Alignment       =   2  'Center
  188.       Caption         =   "R"
  189.       ForeColor       =   &H00808080&
  190.       Height          =   252
  191.       Index           =   17
  192.       Left            =   6000
  193.       TabIndex        =   21
  194.       Top             =   4080
  195.       Width           =   252
  196.    End
  197.    Begin VB.Label SessionLabel 
  198.       Alignment       =   2  'Center
  199.       Caption         =   "Q"
  200.       ForeColor       =   &H00808080&
  201.       Height          =   252
  202.       Index           =   16
  203.       Left            =   5760
  204.       TabIndex        =   20
  205.       Top             =   4080
  206.       Width           =   252
  207.    End
  208.    Begin VB.Label SessionLabel 
  209.       Alignment       =   2  'Center
  210.       Caption         =   "P"
  211.       ForeColor       =   &H00808080&
  212.       Height          =   252
  213.       Index           =   15
  214.       Left            =   5520
  215.       TabIndex        =   19
  216.       Top             =   4080
  217.       Width           =   252
  218.    End
  219.    Begin VB.Label SessionLabel 
  220.       Alignment       =   2  'Center
  221.       Caption         =   "O"
  222.       ForeColor       =   &H00808080&
  223.       Height          =   252
  224.       Index           =   14
  225.       Left            =   5280
  226.       TabIndex        =   18
  227.       Top             =   4080
  228.       Width           =   252
  229.    End
  230.    Begin VB.Label SessionLabel 
  231.       Alignment       =   2  'Center
  232.       Caption         =   "N"
  233.       ForeColor       =   &H00808080&
  234.       Height          =   252
  235.       Index           =   13
  236.       Left            =   5040
  237.       TabIndex        =   17
  238.       Top             =   4080
  239.       Width           =   252
  240.    End
  241.    Begin VB.Label SessionLabel 
  242.       Alignment       =   2  'Center
  243.       Caption         =   "M"
  244.       ForeColor       =   &H00808080&
  245.       Height          =   252
  246.       Index           =   12
  247.       Left            =   4800
  248.       TabIndex        =   16
  249.       Top             =   4080
  250.       Width           =   252
  251.    End
  252.    Begin VB.Label SessionLabel 
  253.       Alignment       =   2  'Center
  254.       Caption         =   "L"
  255.       ForeColor       =   &H00808080&
  256.       Height          =   252
  257.       Index           =   11
  258.       Left            =   4560
  259.       TabIndex        =   15
  260.       Top             =   4080
  261.       Width           =   252
  262.    End
  263.    Begin VB.Label SessionLabel 
  264.       Alignment       =   2  'Center
  265.       Caption         =   "K"
  266.       ForeColor       =   &H00808080&
  267.       Height          =   252
  268.       Index           =   10
  269.       Left            =   4320
  270.       TabIndex        =   14
  271.       Top             =   4080
  272.       Width           =   252
  273.    End
  274.    Begin VB.Label SessionLabel 
  275.       Alignment       =   2  'Center
  276.       Caption         =   "J"
  277.       ForeColor       =   &H00808080&
  278.       Height          =   252
  279.       Index           =   9
  280.       Left            =   4080
  281.       TabIndex        =   13
  282.       Top             =   4080
  283.       Width           =   252
  284.    End
  285.    Begin VB.Label SessionLabel 
  286.       Alignment       =   2  'Center
  287.       Caption         =   "I"
  288.       ForeColor       =   &H00808080&
  289.       Height          =   252
  290.       Index           =   8
  291.       Left            =   3840
  292.       TabIndex        =   12
  293.       Top             =   4080
  294.       Width           =   252
  295.    End
  296.    Begin VB.Label SessionLabel 
  297.       Alignment       =   2  'Center
  298.       Caption         =   "H"
  299.       ForeColor       =   &H00808080&
  300.       Height          =   252
  301.       Index           =   7
  302.       Left            =   3600
  303.       TabIndex        =   11
  304.       Top             =   4080
  305.       Width           =   252
  306.    End
  307.    Begin VB.Label SessionLabel 
  308.       Alignment       =   2  'Center
  309.       Caption         =   "G"
  310.       ForeColor       =   &H00808080&
  311.       Height          =   252
  312.       Index           =   6
  313.       Left            =   3360
  314.       TabIndex        =   10
  315.       Top             =   4080
  316.       Width           =   252
  317.    End
  318.    Begin VB.Label SessionLabel 
  319.       Alignment       =   2  'Center
  320.       Caption         =   "F"
  321.       ForeColor       =   &H00808080&
  322.       Height          =   252
  323.       Index           =   5
  324.       Left            =   3120
  325.       TabIndex        =   9
  326.       Top             =   4080
  327.       Width           =   252
  328.    End
  329.    Begin VB.Label SessionLabel 
  330.       Alignment       =   2  'Center
  331.       Caption         =   "E"
  332.       ForeColor       =   &H00808080&
  333.       Height          =   252
  334.       Index           =   4
  335.       Left            =   2880
  336.       TabIndex        =   8
  337.       Top             =   4080
  338.       Width           =   252
  339.    End
  340.    Begin VB.Label SessionLabel 
  341.       Alignment       =   2  'Center
  342.       Caption         =   "D"
  343.       ForeColor       =   &H00808080&
  344.       Height          =   252
  345.       Index           =   3
  346.       Left            =   2640
  347.       TabIndex        =   7
  348.       Top             =   4080
  349.       Width           =   252
  350.    End
  351.    Begin VB.Label SessionLabel 
  352.       Alignment       =   2  'Center
  353.       Caption         =   "C"
  354.       ForeColor       =   &H00808080&
  355.       Height          =   252
  356.       Index           =   2
  357.       Left            =   2400
  358.       TabIndex        =   6
  359.       Top             =   4080
  360.       Width           =   252
  361.    End
  362.    Begin VB.Label SessionLabel 
  363.       Alignment       =   2  'Center
  364.       Caption         =   "B"
  365.       ForeColor       =   &H00808080&
  366.       Height          =   252
  367.       Index           =   1
  368.       Left            =   2160
  369.       TabIndex        =   5
  370.       Top             =   4080
  371.       Width           =   252
  372.    End
  373.    Begin VB.Label SessionLabel 
  374.       Alignment       =   2  'Center
  375.       Caption         =   "A"
  376.       ForeColor       =   &H00808080&
  377.       Height          =   252
  378.       Index           =   0
  379.       Left            =   1920
  380.       TabIndex        =   4
  381.       Top             =   4080
  382.       Width           =   252
  383.    End
  384.    Begin VB.Label Label2 
  385.       Caption         =   "Inactive Session"
  386.       ForeColor       =   &H00808080&
  387.       Height          =   252
  388.       Left            =   360
  389.       TabIndex        =   3
  390.       Top             =   4200
  391.       Width           =   1452
  392.    End
  393.    Begin VB.Label Label1 
  394.       Caption         =   "Active Session"
  395.       ForeColor       =   &H000000FF&
  396.       Height          =   252
  397.       Left            =   360
  398.       TabIndex        =   2
  399.       Top             =   3960
  400.       Width           =   1452
  401.    End
  402.    Begin MSComDlg.CommonDialog FileSaveAsCommonDialog 
  403.       Left            =   8040
  404.       Top             =   0
  405.       _Version        =   65536
  406.       _ExtentX        =   677
  407.       _ExtentY        =   677
  408.       _StockProps     =   0
  409.    End
  410.    Begin VB.Menu MenuFile 
  411.       Caption         =   "&File"
  412.       Begin VB.Menu MenuSave 
  413.          Caption         =   "&Save Log As ..."
  414.       End
  415.       Begin VB.Menu MenuClear 
  416.          Caption         =   "&Clear Log"
  417.       End
  418.       Begin VB.Menu MenuExit 
  419.          Caption         =   "E&xit"
  420.       End
  421.    End
  422.    Begin VB.Menu MenuSysRequest 
  423.       Caption         =   "&SysRequest"
  424.       Begin VB.Menu MenuSysFormats 
  425.          Caption         =   "Get System &Formats"
  426.       End
  427.       Begin VB.Menu MenuSysStatus 
  428.          Caption         =   "Get System &Status"
  429.       End
  430.       Begin VB.Menu MenuSysConfiguration 
  431.          Caption         =   "Get System &Configuration"
  432.       End
  433.       Begin VB.Menu MenuSysSysItems 
  434.          Caption         =   "Get System S&ysItems"
  435.       End
  436.       Begin VB.Menu MenuSysTopics 
  437.          Caption         =   "Get System &Topics"
  438.       End
  439.    End
  440.    Begin VB.Menu MenuRequest 
  441.       Caption         =   "&Request"
  442.       Begin VB.Menu MenuGetParPS 
  443.          Caption         =   "&Get Partial PS"
  444.       End
  445.       Begin VB.Menu MenuFindField 
  446.          Caption         =   "&Find Field"
  447.       End
  448.       Begin VB.Menu MenuGetOIA 
  449.          Caption         =   "Get &OIA"
  450.       End
  451.       Begin VB.Menu MenuGetPS 
  452.          Caption         =   "Get &PS"
  453.       End
  454.       Begin VB.Menu MenuGetSessStat 
  455.          Caption         =   "Get &Session Status"
  456.       End
  457.       Begin VB.Menu MenuSearchforString 
  458.          Caption         =   "Search for S&tring"
  459.       End
  460.       Begin VB.Menu MenuGetTrimRect 
  461.          Caption         =   "Get Trim&Rect"
  462.       End
  463.    End
  464.    Begin VB.Menu MenuExecute 
  465.       Caption         =   "&Execute"
  466.       Begin VB.Menu MenuExecuteWindow 
  467.          Caption         =   "&Window"
  468.       End
  469.       Begin VB.Menu MenuExecuteSendkey 
  470.          Caption         =   "&Sendkey"
  471.       End
  472.       Begin VB.Menu MenuExecuteKeylock 
  473.          Caption         =   "&Keylock"
  474.       End
  475.       Begin VB.Menu MenuExecuteXfer 
  476.          Caption         =   "&File Transfer"
  477.       End
  478.       Begin VB.Menu MenuExecuteWait 
  479.          Caption         =   "W&ait"
  480.       End
  481.    End
  482.    Begin VB.Menu MenuPoke 
  483.       Caption         =   "&Poke"
  484.       Begin VB.Menu MenuPutDataToPs 
  485.          Caption         =   "&Put Data to PS"
  486.       End
  487.       Begin VB.Menu MenuSetCursorPosition 
  488.          Caption         =   "&Set Cursor Position"
  489.       End
  490.    End
  491.    Begin VB.Menu MenuAdvise 
  492.       Caption         =   "&Advise"
  493.       Begin VB.Menu MenuStartCloseIntercept 
  494.          Caption         =   "Start &Close Intercept"
  495.       End
  496.       Begin VB.Menu MenuStartKeystrokeIntercept 
  497.          Caption         =   "Start &Keystroke Intercept"
  498.       End
  499.       Begin VB.Menu MenuStartSessionAdvise 
  500.          Caption         =   "Start &Session Advise"
  501.          Begin VB.Menu MenuAdvicePS 
  502.             Caption         =   "&Presentation Space"
  503.          End
  504.          Begin VB.Menu MenuAdviseOIA 
  505.             Caption         =   "&Operator Indicator Area"
  506.          End
  507.          Begin VB.Menu MenuAdviseTrimRect 
  508.             Caption         =   "&Trim Rectangle"
  509.          End
  510.       End
  511.       Begin VB.Menu MenuStartMouseIntercept 
  512.          Caption         =   "Start &Mouse Intercept"
  513.       End
  514.    End
  515. End
  516. Attribute VB_Name = "MainForm"
  517. Attribute VB_Creatable = False
  518. Attribute VB_Exposed = False
  519. Dim NumberOfOpenForms As Boolean
  520.  
  521. Dim MainMinimumWidth As Long
  522. Dim MainMinimumHeight As Long
  523.  
  524. Dim FunctionLogWidth As Long
  525. Dim FunctionLogHeight As Long
  526.  
  527. Dim FunctionLogFrameWidth As Long
  528. Dim FunctionLogFrameHeight As Long
  529.  
  530. Dim FunctionLogChanged As Boolean
  531. Private Sub Form_Load()
  532.    NumberOfOpenForms = 0
  533.  
  534.    LogTop = 0
  535.    LogEnd = 0
  536.    Loged = False
  537.    
  538.    MSG_SAMPLE_PROG = "DDE TEST PROGRAM"
  539.    MSG_APPLICATION = "Application = "
  540.    MSG_TOPIC = "Topic = "
  541.    MSG_ITEM = "Item = "
  542.    MSG_FUNCTION_COMP = "Function was successful!"
  543.    MSG_DDE_ERROR = "An error has occurred in DDE Conversation"
  544.    MSG_PARA_ERROR = "You must set necessary parameters"
  545.    MSG_INVALID_DATA = "Invalid Data was returned"
  546.    MSG_OK = "OK"
  547.    MSG_NG = "Not Good"
  548.    MSG_INVALID_PSID = "Could not find session: "
  549. '   APPLICATION_NAME = "IBM327032"
  550.    
  551.    MainMinimumWidth = Width
  552.    MainMinimumHeight = Height
  553.  
  554.    FunctionLogWidth = FunctionLog.Width
  555.    FunctionLogHeight = FunctionLog.Height
  556.  
  557.    FunctionLogFrameWidth = FunctionLogFrame.Width
  558.    FunctionLogFrameHeight = FunctionLogFrame.Height
  559.    
  560.    FunctionLogChanged = False
  561.    
  562.    For Counter = 0 To 25
  563.      SavedSessionInfo(Counter) = False
  564.    Next Counter
  565.  
  566.    UpdateActiveSessionInfo
  567. End Sub
  568.  
  569. Private Sub Host3270Option_Click()
  570.  
  571. End Sub
  572.  
  573. Private Sub Host5250Option_Click()
  574.  
  575. End Sub
  576.  
  577. Private Sub Form_Resize()
  578. If WindowState = 1 Then ' Iconic
  579.   Exit Sub
  580. End If
  581.  
  582. If (Width < MainMinimumWidth) Then
  583.   Width = MainMinimumWidth
  584. End If
  585.  
  586. If (Height < MainMinimumHeight) Then
  587.   Height = MainMinimumHeight
  588. End If
  589.   
  590. WidthDelta = Width - MainMinimumWidth
  591. HeightDelta = Height - MainMinimumHeight
  592.  
  593. FunctionLog.Width = FunctionLogWidth + WidthDelta
  594. FunctionLog.Height = FunctionLogHeight + HeightDelta
  595.    
  596. FunctionLogFrame.Width = FunctionLogFrameWidth + WidthDelta
  597. FunctionLogFrame.Height = FunctionLogFrameHeight + HeightDelta
  598.  
  599. Refresh
  600.  
  601.  
  602. End Sub
  603.  
  604. Private Sub FunctionLog_Change()
  605.   FunctionLogChanged = True
  606. End Sub
  607.  
  608. Private Sub MenuAdvicePS_Click()
  609.   FormStartPSAdvise.Show 0
  610. End Sub
  611.  
  612. Private Sub MenuAdviseOIA_Click()
  613.    FormStartOIAAdvise.Show 0
  614. End Sub
  615.  
  616. Private Sub MenuAdviseTrimRect_Click()
  617.    FormStartTrimRectAdvise.Show 0
  618. End Sub
  619.  
  620. Private Sub MenuClear_Click()
  621.   LogTop = 0
  622.   LogEnd = 0
  623.   FunctionLog.Text = ""
  624.   FunctionLogChanged = False
  625.   
  626.   For i% = 0 To MAXLOGNUM
  627.     LogData$(i%) = ""
  628.   Next
  629.   Loged = False
  630.  
  631. End Sub
  632.  
  633. Private Sub MenuEnableLog_Click()
  634.  End Sub
  635.  
  636. Private Sub MenuExecuteKeylock_Click()
  637.     FormSessExMacroKeyboard.Show 0
  638. End Sub
  639.  
  640. Private Sub MenuExecuteSendkey_Click()
  641.     FormSessExMacroSendKey.Show 1
  642.     If Loged = True Then
  643.        UpdateLog
  644.     End If
  645.     Unload FormSessExMacroSendKey
  646. End Sub
  647.  
  648. Private Sub MenuExecuteWait_Click()
  649.     FormSessExMacroWait.Show 1
  650.     If Loged = True Then
  651.        UpdateLog
  652.     End If
  653.     Unload FormSessExMacroWait
  654.  
  655.  
  656. End Sub
  657.  
  658. Private Sub MenuExecuteWindow_Click()
  659.     FormSessExMacroWin.Show 1
  660.     If Loged = True Then
  661.        UpdateLog
  662.     End If
  663.     Unload FormSessExMacroWin
  664.  
  665. End Sub
  666.  
  667. Private Sub MenuExecuteXfer_Click()
  668.     FormSessExMacroXfer.Show 1
  669.     If Loged = True Then
  670.        UpdateLog
  671.     End If
  672.     Unload FormSessExMacroXfer
  673. End Sub
  674.  
  675. Private Sub MenuExit_Click()
  676.  End
  677. End Sub
  678.  
  679. Private Sub MenuFindField_Click()
  680.     FormFindField.Show 1
  681.     If Loged = True Then
  682.        UpdateLog
  683.     End If
  684.     Unload FormFindField
  685. End Sub
  686.  
  687. Private Sub MenuGetOIA_Click()
  688.     FormGetOIA.Show 1
  689.     If Loged = True Then
  690.        UpdateLog
  691.     End If
  692.     Unload FormGetOIA
  693.  
  694. End Sub
  695.  
  696. Private Sub MenuGetParPS_Click()
  697.     FormGetPartialPS.Show 1
  698.     If Loged = True Then
  699.        UpdateLog
  700.     End If
  701.     Unload FormGetPartialPS
  702.  
  703. End Sub
  704.  
  705. Private Sub MenuGetPS_Click()
  706.     FormGetPS.Show 1
  707.     If Loged = True Then
  708.        UpdateLog
  709.     End If
  710.     Unload FormGetPS
  711.  
  712. End Sub
  713.  
  714. Private Sub MenuGetSessStat_Click()
  715.     FormGetSessStatus.Show 1
  716.     If Loged = True Then
  717.        UpdateLog
  718.     End If
  719.     Unload FormGetSessStatus
  720.  
  721.  
  722. End Sub
  723.  
  724. Private Sub MenuGetTrimRect_Click()
  725.     FormGetTrimRect.Show 1
  726.     If Loged = True Then
  727.        UpdateLog
  728.     End If
  729.     Unload FormGetTrimRect
  730.  
  731.  
  732. End Sub
  733.  
  734. Private Sub MenuPutDataToPs_Click()
  735.     FormPutDataToPS.Show 1
  736.     If Loged = True Then
  737.        UpdateLog
  738.     End If
  739.     Unload FormPutDataToPS
  740. End Sub
  741.  
  742. Private Sub MenuSave_Click()
  743.   SaveLog
  744. End Sub
  745.  
  746. Private Sub MenuSearchforString_Click()
  747.     FormSearchForString.Show 1
  748.     If Loged = True Then
  749.        UpdateLog
  750.     End If
  751.     Unload FormSearchForString
  752.  
  753. End Sub
  754.  
  755. Private Sub MenuSetCursorPosition_Click()
  756.     FormSetCursorPosition.Show 1
  757.     If Loged = True Then
  758.        UpdateLog
  759.     End If
  760.     Unload FormSetCursorPosition
  761.  
  762.  
  763. End Sub
  764.  
  765. Private Sub MenuStartCloseIntercept_Click()
  766.     FormStartCloseIntercept.Show 0
  767. End Sub
  768.  
  769. Private Sub MenuStartKeystrokeIntercept_Click()
  770.   FormStartKeystrokeIntercept.Show 0
  771. End Sub
  772.  
  773. Private Sub MenuStartMouseIntercept_Click()
  774.   FormStartMouseIntercept.Show 0
  775. End Sub
  776.  
  777. Private Sub MenuSysConfiguration_Click()
  778.     FormGetSysConfiguration.Show 1
  779.     If Loged = True Then
  780.        UpdateLog
  781.     End If
  782.     Unload FormGetSysConfiguration
  783.  
  784. End Sub
  785.  
  786. Private Sub MenuSysFormats_Click()
  787.  
  788.     FormGetSysFormats.Show 1
  789.     If Loged = True Then
  790.        UpdateLog
  791.     End If
  792.   
  793.   Unload FormGetSysFormats
  794. End Sub
  795.  
  796. Private Sub MenuSysStatus_Click()
  797.     FormGetSysStatus.Show 1
  798.     If Loged = True Then
  799.        UpdateLog
  800.     End If
  801.     Unload FormGetSysStatus
  802.  
  803. End Sub
  804.  
  805. Private Sub MenuSysSysItems_Click()
  806.     FormGetSysSysItems.Show 1
  807.     If Loged = True Then
  808.        UpdateLog
  809.     End If
  810.     Unload FormGetSysSysItems
  811.  
  812.  
  813. End Sub
  814.  
  815. Private Sub MenuSysTopics_Click()
  816.     FormGetSysTopics.Show 1
  817.     If Loged = True Then
  818.        UpdateLog
  819.     End If
  820.     Unload FormGetSysTopics
  821.  
  822. End Sub
  823.  
  824. Private Sub UpdateLog()
  825.     temp$ = " "
  826.     If LogTop > LogEnd Then
  827.        For i% = LogTop To MAXLOGNUM
  828.           temp$ = temp$ + LogData$(i%)
  829.        Next
  830.        For i% = 0 To LogEnd
  831.           temp$ = temp$ + LogData$(i%)
  832.        Next
  833.     ElseIf LogTop < LogEnd Then
  834.        For i% = LogTop To LogEnd
  835.           temp$ = temp$ + LogData(i%)
  836.        Next
  837.     Else
  838.        temp$ = LogData(i%)
  839.     End If
  840.     FunctionLog.Text = temp$
  841.     Loged = False
  842. End Sub
  843.  
  844.  
  845. Private Sub SaveLog()
  846.   On Error GoTo SaveLogErrorHandler
  847.  
  848.   FileSaveAsCommonDialog.Filter = "Log Files (*.log)|*.log|All Files (*.*)|*.*"
  849.   FileSaveAsCommonDialog.FilterIndex = 0
  850.   FileSaveAsCommonDialog.CancelError = True
  851.   FileSaveAsCommonDialog.Flags = cdlOFNOverwritePrompt Or cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNLongNames
  852.   
  853.   FileSaveAsCommonDialog.ShowSave
  854.   
  855.   MsgBox FileSaveAsCommonDialog.filename
  856.   
  857.   FileNumber = FreeFile
  858.   Open FileSaveAsCommonDialog.filename For Output As #FileNumber
  859.   Print #FileNumber, FunctionLog.Text
  860.   Close #FileNumber
  861.   
  862. Exit Sub
  863.  
  864. SaveLogErrorHandler:
  865.   If Err = 32755 Then
  866.     ' User Canceled Save As Dialog
  867.   Else
  868.     MsgBox "Error Number " & Err & " while saving Log."
  869.   End If
  870.   
  871. End Sub
  872.  
  873. Private Sub Test_Click()
  874. SaveLog
  875. End Sub
  876.  
  877.  
  878.  
  879. Private Function UpdateActiveSessionInfo()
  880.   Dim NewSessionInfo(26) As Boolean
  881.  
  882.   UpdateSystemTopics
  883.  
  884.    For Counter = 0 To 25
  885.      NewSessionInfo(Counter) = False
  886.    Next Counter
  887.    
  888.    StartPos& = 1
  889.    Do While True
  890.       EndPos& = InStr(StartPos&, SystemTopicsText.Text, Chr$(9))
  891.       If EndPos& = 0 Then
  892.         temp$ = LTrim$(RTrim$(Mid$(SystemTopicsText.Text, StartPos&)))
  893.         If Mid$(temp$, 1, 7) = "Session" Then
  894.           PSID = Asc(Mid$(temp$, 8, 1)) - Asc("A")
  895.           NewSessionInfo(PSID) = True
  896.         End If
  897.         Exit Do
  898.       Else
  899.         temp$ = LTrim$(RTrim$(Mid$(SystemTopicsText.Text, StartPos&, EndPos& - StartPos&)))
  900.         If Mid$(temp$, 1, 7) = "Session" Then
  901.           PSID = Asc(Mid$(temp$, 8, 1)) - Asc("A")
  902.           NewSessionInfo(PSID) = True
  903.         End If
  904.       End If
  905.       StartPos& = EndPos& + 1
  906.    Loop
  907.  
  908.    For Counter = 0 To 25
  909.      If SavedSessionInfo(Counter) <> NewSessionInfo(Counter) Then
  910.        If NewSessionInfo(Counter) = True Then
  911.          SessionLabel(Counter).ForeColor = &HFF&
  912.        Else
  913.          SessionLabel(Counter).ForeColor = &H808080
  914.        End If
  915.        SavedSessionInfo(Counter) = NewSessionInfo(Counter)
  916.      End If
  917.    Next Counter
  918. End Function
  919.  
  920. Private Sub UpdateSystemTopics()
  921. On Error GoTo ErrHandler
  922.    FunctionComp = True
  923.    
  924.    SystemTopicsText.Text = ""
  925.    
  926.    rc = DoEvents()              'If you use VisualBasic V2.0, call
  927.                                 'DoEvents function each time before
  928.                                 'starting DDE conversation.
  929.    SystemTopicsText.LinkTimeout = -1
  930.    SystemTopicsText.LinkTopic = "IBM327032|System"
  931.    SystemTopicsText.LinkMode = COLD
  932.    SystemTopicsText.LinkItem = "Topics"
  933.    SystemTopicsText.LinkRequest
  934.    SystemTopicsText.LinkMode = NONE
  935.    If FunctionComp = True Then
  936.       ' Everything went well;
  937.       ' atleast one Session is open but necessarily active.
  938.    Else
  939.      SystemTopicsText.Text = ""
  940.    End If
  941.    Exit Sub
  942.  
  943. ErrHandler:
  944.    FunctionComp = False
  945.    Resume Next
  946. End Sub
  947.  
  948. Private Sub SessionLabelA_Click(Index As Integer)
  949.  
  950. End Sub
  951.  
  952.  
  953. Private Sub SessionUpdateTimer_Timer()
  954.   UpdateActiveSessionInfo
  955. End Sub
  956.  
  957.  
  958. Private Sub Text1_Change()
  959.  
  960. End Sub
  961.  
  962.  
  963.