home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / webmon_1 / frmgatew.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-09  |  31.8 KB  |  985 lines

  1. VERSION 5.00
  2. Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
  3. Object = "{24365B29-A3B5-11D1-B8B0-444553540000}#1.0#0"; "Xfxforms.ocx"
  4. Begin VB.Form FrmGateWay 
  5.    BackColor       =   &H00FF8080&
  6.    BorderStyle     =   0  'None
  7.    ClientHeight    =   6195
  8.    ClientLeft      =   4320
  9.    ClientTop       =   3330
  10.    ClientWidth     =   9285
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6195
  13.    ScaleWidth      =   9285
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Timer tmrStarted 
  16.       Interval        =   65000
  17.       Left            =   4080
  18.       Top             =   2880
  19.    End
  20.    Begin xfxFormShaper.FormShaper FormShaper1 
  21.       Left            =   120
  22.       Top             =   1080
  23.       _ExtentX        =   1852
  24.       _ExtentY        =   1296
  25.    End
  26.    Begin VB.TextBox txtPingThis 
  27.       Height          =   285
  28.       Left            =   5880
  29.       TabIndex        =   24
  30.       Top             =   5280
  31.       Width           =   1575
  32.    End
  33.    Begin VB.Timer tmrScroll 
  34.       Interval        =   50
  35.       Left            =   5160
  36.       Top             =   240
  37.    End
  38.    Begin VB.Timer tmrUpdater 
  39.       Interval        =   1000
  40.       Left            =   3120
  41.       Top             =   360
  42.    End
  43.    Begin VB.Timer tmrAlert2 
  44.       Enabled         =   0   'False
  45.       Index           =   1
  46.       Interval        =   1000
  47.       Left            =   480
  48.       Top             =   0
  49.    End
  50.    Begin VB.Timer tmrAlert2 
  51.       Enabled         =   0   'False
  52.       Index           =   0
  53.       Interval        =   10000
  54.       Left            =   0
  55.       Top             =   0
  56.    End
  57.    Begin VB.Timer tmrAlert2 
  58.       Enabled         =   0   'False
  59.       Index           =   2
  60.       Interval        =   1000
  61.       Left            =   960
  62.       Top             =   0
  63.    End
  64.    Begin VB.Timer tmrDealWithResponseCodes 
  65.       Enabled         =   0   'False
  66.       Interval        =   10000
  67.       Left            =   4560
  68.       Top             =   120
  69.    End
  70.    Begin MSWinsockLib.Winsock WGate 
  71.       Left            =   720
  72.       Top             =   240
  73.       _ExtentX        =   741
  74.       _ExtentY        =   741
  75.       _Version        =   327681
  76.       Protocol        =   1
  77.    End
  78.    Begin VB.Timer TmrCheckGateWays 
  79.       Interval        =   1000
  80.       Left            =   360
  81.       Top             =   240
  82.    End
  83.    Begin VB.Label lblPingStatus 
  84.       BackColor       =   &H00000000&
  85.       BeginProperty Font 
  86.          Name            =   "MS Sans Serif"
  87.          Size            =   9.75
  88.          Charset         =   0
  89.          Weight          =   400
  90.          Underline       =   0   'False
  91.          Italic          =   0   'False
  92.          Strikethrough   =   0   'False
  93.       EndProperty
  94.       ForeColor       =   &H0000FFFF&
  95.       Height          =   615
  96.       Left            =   4320
  97.       TabIndex        =   33
  98.       Top             =   3120
  99.       Width           =   4815
  100.    End
  101.    Begin VB.Label Label12 
  102.       BackColor       =   &H00000000&
  103.       Caption         =   "  Bytes Sent"
  104.       ForeColor       =   &H0000FFFF&
  105.       Height          =   255
  106.       Left            =   4320
  107.       TabIndex        =   32
  108.       Top             =   3720
  109.       Width           =   1335
  110.    End
  111.    Begin VB.Label lblBytesSent 
  112.       BackColor       =   &H00000000&
  113.       ForeColor       =   &H0000FFFF&
  114.       Height          =   255
  115.       Left            =   5640
  116.       TabIndex        =   31
  117.       Top             =   3720
  118.       Width           =   1215
  119.    End
  120.    Begin VB.Label Label7 
  121.       BackColor       =   &H00000000&
  122.       Caption         =   "  Bytes Recieved"
  123.       ForeColor       =   &H0000FFFF&
  124.       Height          =   255
  125.       Left            =   4320
  126.       TabIndex        =   30
  127.       Top             =   3960
  128.       Width           =   1335
  129.    End
  130.    Begin VB.Label lblBytesRecieved 
  131.       BackColor       =   &H00000000&
  132.       ForeColor       =   &H0000FFFF&
  133.       Height          =   255
  134.       Left            =   5640
  135.       TabIndex        =   29
  136.       Top             =   3960
  137.       Width           =   1215
  138.    End
  139.    Begin VB.Label Label9 
  140.       BackColor       =   &H00000000&
  141.       Caption         =   "  Time in m/s"
  142.       ForeColor       =   &H0000FFFF&
  143.       Height          =   255
  144.       Left            =   4320
  145.       TabIndex        =   28
  146.       Top             =   4200
  147.       Width           =   1335
  148.    End
  149.    Begin VB.Label lblTimeMS 
  150.       BackColor       =   &H00000000&
  151.       ForeColor       =   &H0000FFFF&
  152.       Height          =   255
  153.       Left            =   5640
  154.       TabIndex        =   27
  155.       Top             =   4200
  156.       Width           =   1215
  157.    End
  158.    Begin VB.Label lblPStats2 
  159.       BackColor       =   &H00000000&
  160.       BeginProperty Font 
  161.          Name            =   "MS Sans Serif"
  162.          Size            =   9.75
  163.          Charset         =   0
  164.          Weight          =   400
  165.          Underline       =   0   'False
  166.          Italic          =   0   'False
  167.          Strikethrough   =   0   'False
  168.       EndProperty
  169.       ForeColor       =   &H0000FFFF&
  170.       Height          =   375
  171.       Left            =   4320
  172.       TabIndex        =   26
  173.       Top             =   4440
  174.       Width           =   4815
  175.    End
  176.    Begin VB.Label Label5 
  177.       BackColor       =   &H00000000&
  178.       Caption         =   "Label11"
  179.       Height          =   735
  180.       Left            =   6840
  181.       TabIndex        =   25
  182.       Top             =   3720
  183.       Width           =   2295
  184.    End
  185.    Begin VB.Image Image1 
  186.       Height          =   480
  187.       Left            =   4560
  188.       Picture         =   "FrmGateWay.frx":0000
  189.       ToolTipText     =   "Add New Server"
  190.       Top             =   5160
  191.       Width           =   480
  192.    End
  193.    Begin VB.Image Image2 
  194.       Height          =   480
  195.       Left            =   5280
  196.       Picture         =   "FrmGateWay.frx":0442
  197.       ToolTipText     =   "Reset Alarms"
  198.       Top             =   5160
  199.       Width           =   480
  200.    End
  201.    Begin VB.Image Image3 
  202.       Height          =   480
  203.       Left            =   7680
  204.       Picture         =   "FrmGateWay.frx":0884
  205.       ToolTipText     =   "Manual Ping"
  206.       Top             =   5160
  207.       Width           =   480
  208.    End
  209.    Begin VB.Image Image4 
  210.       Height          =   480
  211.       Left            =   8400
  212.       Picture         =   "FrmGateWay.frx":0CC6
  213.       ToolTipText     =   "Hide"
  214.       Top             =   5160
  215.       Width           =   480
  216.    End
  217.    Begin VB.Label lblScroll 
  218.       BackStyle       =   0  'Transparent
  219.       Caption         =   "WebMon GateWay Service Monitor"
  220.       BeginProperty Font 
  221.          Name            =   "Comic Sans MS"
  222.          Size            =   18
  223.          Charset         =   0
  224.          Weight          =   400
  225.          Underline       =   0   'False
  226.          Italic          =   0   'False
  227.          Strikethrough   =   0   'False
  228.       EndProperty
  229.       Height          =   615
  230.       Left            =   -5760
  231.       TabIndex        =   23
  232.       Top             =   120
  233.       Width           =   6015
  234.    End
  235.    Begin VB.Line Line17 
  236.       BorderColor     =   &H0000FF00&
  237.       X1              =   240
  238.       X2              =   3840
  239.       Y1              =   5280
  240.       Y2              =   5280
  241.    End
  242.    Begin VB.Label Label3 
  243.       BackColor       =   &H00000000&
  244.       Caption         =   "Label3"
  245.       Height          =   495
  246.       Left            =   120
  247.       TabIndex        =   22
  248.       Top             =   5280
  249.       Width           =   3855
  250.    End
  251.    Begin VB.Line Line16 
  252.       BorderColor     =   &H0000FF00&
  253.       X1              =   3840
  254.       X2              =   3840
  255.       Y1              =   4800
  256.       Y2              =   5280
  257.    End
  258.    Begin VB.Line Line15 
  259.       BorderColor     =   &H0000FF00&
  260.       X1              =   240
  261.       X2              =   3840
  262.       Y1              =   4800
  263.       Y2              =   4800
  264.    End
  265.    Begin VB.Line Line14 
  266.       BorderColor     =   &H00FF00FF&
  267.       X1              =   240
  268.       X2              =   3840
  269.       Y1              =   4560
  270.       Y2              =   4560
  271.    End
  272.    Begin VB.Label Label1 
  273.       BackColor       =   &H00000000&
  274.       Caption         =   "Label1"
  275.       Height          =   255
  276.       Left            =   120
  277.       TabIndex        =   21
  278.       Top             =   4560
  279.       Width           =   3855
  280.    End
  281.    Begin VB.Shape Shape5 
  282.       Height          =   855
  283.       Left            =   4200
  284.       Shape           =   4  'Rounded Rectangle
  285.       Top             =   5040
  286.       Width           =   5055
  287.    End
  288.    Begin VB.Shape Shape4 
  289.       Height          =   1935
  290.       Left            =   4200
  291.       Shape           =   4  'Rounded Rectangle
  292.       Top             =   3000
  293.       Width           =   5055
  294.    End
  295.    Begin VB.Line Line13 
  296.       BorderColor     =   &H0000FF00&
  297.       X1              =   240
  298.       X2              =   240
  299.       Y1              =   4800
  300.       Y2              =   5280
  301.    End
  302.    Begin VB.Line Line12 
  303.       BorderColor     =   &H0000FF00&
  304.       X1              =   1320
  305.       X2              =   1320
  306.       Y1              =   4800
  307.       Y2              =   5280
  308.    End
  309.    Begin VB.Line Line11 
  310.       BorderColor     =   &H00FF00FF&
  311.       X1              =   1320
  312.       X2              =   1320
  313.       Y1              =   3600
  314.       Y2              =   4560
  315.    End
  316.    Begin VB.Line Line10 
  317.       BorderColor     =   &H00FF00FF&
  318.       X1              =   240
  319.       X2              =   240
  320.       Y1              =   3600
  321.       Y2              =   4560
  322.    End
  323.    Begin VB.Line Line9 
  324.       BorderColor     =   &H00FF00FF&
  325.       X1              =   3840
  326.       X2              =   3840
  327.       Y1              =   3600
  328.       Y2              =   4560
  329.    End
  330.    Begin VB.Line Line8 
  331.       BorderColor     =   &H0000FF00&
  332.       X1              =   240
  333.       X2              =   3960
  334.       Y1              =   5280
  335.       Y2              =   5280
  336.    End
  337.    Begin VB.Line Line7 
  338.       BorderColor     =   &H0000FF00&
  339.       X1              =   240
  340.       X2              =   3960
  341.       Y1              =   4800
  342.       Y2              =   4800
  343.    End
  344.    Begin VB.Line Line6 
  345.       BorderColor     =   &H0000FF00&
  346.       X1              =   240
  347.       X2              =   3840
  348.       Y1              =   5040
  349.       Y2              =   5040
  350.    End
  351.    Begin VB.Line Line5 
  352.       BorderColor     =   &H00FF00FF&
  353.       X1              =   240
  354.       X2              =   3960
  355.       Y1              =   4560
  356.       Y2              =   4560
  357.    End
  358.    Begin VB.Line Line4 
  359.       BorderColor     =   &H00FF00FF&
  360.       X1              =   240
  361.       X2              =   3840
  362.       Y1              =   4320
  363.       Y2              =   4320
  364.    End
  365.    Begin VB.Line Line3 
  366.       BorderColor     =   &H00FF00FF&
  367.       X1              =   240
  368.       X2              =   3840
  369.       Y1              =   4080
  370.       Y2              =   4080
  371.    End
  372.    Begin VB.Line Line2 
  373.       BorderColor     =   &H00FF00FF&
  374.       X1              =   240
  375.       X2              =   3840
  376.       Y1              =   3840
  377.       Y2              =   3840
  378.    End
  379.    Begin VB.Line Line1 
  380.       BorderColor     =   &H00FF00FF&
  381.       X1              =   240
  382.       X2              =   3840
  383.       Y1              =   3600
  384.       Y2              =   3600
  385.    End
  386.    Begin VB.Label lblNextCheck 
  387.       BackColor       =   &H00000000&
  388.       ForeColor       =   &H0000FFFF&
  389.       Height          =   255
  390.       Left            =   1320
  391.       TabIndex        =   20
  392.       Top             =   5040
  393.       Width           =   2655
  394.    End
  395.    Begin VB.Label lblCurrentTime 
  396.       BackColor       =   &H00000000&
  397.       ForeColor       =   &H0000FFFF&
  398.       Height          =   255
  399.       Left            =   1320
  400.       TabIndex        =   19
  401.       Top             =   4800
  402.       Width           =   2655
  403.    End
  404.    Begin VB.Label Label11 
  405.       BackColor       =   &H00000000&
  406.       Caption         =   "    Next Scan"
  407.       ForeColor       =   &H0000FFFF&
  408.       Height          =   255
  409.       Left            =   120
  410.       TabIndex        =   18
  411.       Top             =   5040
  412.       Width           =   1215
  413.    End
  414.    Begin VB.Label Label10 
  415.       BackColor       =   &H00000000&
  416.       Caption         =   "    Current Time"
  417.       ForeColor       =   &H0000FFFF&
  418.       Height          =   255
  419.       Left            =   120
  420.       TabIndex        =   17
  421.       Top             =   4800
  422.       Width           =   1215
  423.    End
  424.    Begin VB.Label lblDownTime 
  425.       BackColor       =   &H00000000&
  426.       ForeColor       =   &H0000FFFF&
  427.       Height          =   255
  428.       Left            =   1320
  429.       TabIndex        =   16
  430.       Top             =   4320
  431.       Width           =   2655
  432.    End
  433.    Begin VB.Label Label8 
  434.       BackColor       =   &H00000000&
  435.       Caption         =   "    Down Time"
  436.       ForeColor       =   &H0000FFFF&
  437.       Height          =   255
  438.       Left            =   120
  439.       TabIndex        =   15
  440.       Top             =   4320
  441.       Width           =   1215
  442.    End
  443.    Begin VB.Label lblLastFail 
  444.       BackColor       =   &H00000000&
  445.       ForeColor       =   &H0000FFFF&
  446.       Height          =   255
  447.       Left            =   1320
  448.       TabIndex        =   14
  449.       Top             =   4080
  450.       Width           =   2655
  451.    End
  452.    Begin VB.Label Label6 
  453.       BackColor       =   &H00000000&
  454.       Caption         =   "    Last Failed"
  455.       ForeColor       =   &H0000FFFF&
  456.       Height          =   255
  457.       Left            =   120
  458.       TabIndex        =   13
  459.       Top             =   4080
  460.       Width           =   1215
  461.    End
  462.    Begin VB.Label lblChecked 
  463.       BackColor       =   &H00000000&
  464.       ForeColor       =   &H0000FFFF&
  465.       Height          =   255
  466.       Left            =   1320
  467.       TabIndex        =   12
  468.       Top             =   3840
  469.       Width           =   2655
  470.    End
  471.    Begin VB.Label Label4 
  472.       BackColor       =   &H00000000&
  473.       Caption         =   "    Last Checked"
  474.       ForeColor       =   &H0000FFFF&
  475.       Height          =   255
  476.       Left            =   120
  477.       TabIndex        =   11
  478.       Top             =   3840
  479.       Width           =   1215
  480.    End
  481.    Begin VB.Label lblIP 
  482.       BackColor       =   &H00000000&
  483.       ForeColor       =   &H0000FFFF&
  484.       Height          =   255
  485.       Left            =   1320
  486.       TabIndex        =   10
  487.       Top             =   3600
  488.       Width           =   2655
  489.    End
  490.    Begin VB.Label Label2 
  491.       BackColor       =   &H00000000&
  492.       Caption         =   "    IP Address"
  493.       ForeColor       =   &H0000FFFF&
  494.       Height          =   255
  495.       Left            =   120
  496.       TabIndex        =   9
  497.       Top             =   3600
  498.       Width           =   1215
  499.    End
  500.    Begin VB.Label lblMName 
  501.       Alignment       =   2  'Center
  502.       BackColor       =   &H00000000&
  503.       BeginProperty Font 
  504.          Name            =   "Comic Sans MS"
  505.          Size            =   14.25
  506.          Charset         =   0
  507.          Weight          =   400
  508.          Underline       =   0   'False
  509.          Italic          =   0   'False
  510.          Strikethrough   =   0   'False
  511.       EndProperty
  512.       ForeColor       =   &H0000FFFF&
  513.       Height          =   495
  514.       Left            =   120
  515.       TabIndex        =   8
  516.       Top             =   3120
  517.       Width           =   3855
  518.    End
  519.    Begin VB.Shape Shape3 
  520.       Height          =   2895
  521.       Left            =   0
  522.       Shape           =   4  'Rounded Rectangle
  523.       Top             =   3000
  524.       Width           =   4095
  525.    End
  526.    Begin VB.Label lblGateWay 
  527.       Alignment       =   2  'Center
  528.       BackColor       =   &H00000000&
  529.       BeginProperty Font 
  530.          Name            =   "MS Sans Serif"
  531.          Size            =   13.5
  532.          Charset         =   0
  533.          Weight          =   700
  534.          Underline       =   0   'False
  535.          Italic          =   0   'False
  536.          Strikethrough   =   0   'False
  537.       EndProperty
  538.       ForeColor       =   &H0000FFFF&
  539.       Height          =   735
  540.       Index           =   7
  541.       Left            =   7080
  542.       TabIndex        =   7
  543.       Top             =   2040
  544.       Visible         =   0   'False
  545.       Width           =   2055
  546.    End
  547.    Begin VB.Label lblGateWay 
  548.       Alignment       =   2  'Center
  549.       BackColor       =   &H00000000&
  550.       BeginProperty Font 
  551.          Name            =   "MS Sans Serif"
  552.          Size            =   13.5
  553.          Charset         =   0
  554.          Weight          =   700
  555.          Underline       =   0   'False
  556.          Italic          =   0   'False
  557.          Strikethrough   =   0   'False
  558.       EndProperty
  559.       ForeColor       =   &H0000FFFF&
  560.       Height          =   735
  561.       Index           =   6
  562.       Left            =   7080
  563.       TabIndex        =   6
  564.       Top             =   1200
  565.       Visible         =   0   'False
  566.       Width           =   2055
  567.    End
  568.    Begin VB.Label lblGateWay 
  569.       Alignment       =   2  'Center
  570.       BackColor       =   &H00000000&
  571.       BeginProperty Font 
  572.          Name            =   "MS Sans Serif"
  573.          Size            =   13.5
  574.          Charset         =   0
  575.          Weight          =   700
  576.          Underline       =   0   'False
  577.          Italic          =   0   'False
  578.          Strikethrough   =   0   'False
  579.       EndProperty
  580.       ForeColor       =   &H0000FFFF&
  581.       Height          =   735
  582.       Index           =   5
  583.       Left            =   4680
  584.       TabIndex        =   5
  585.       Top             =   2040
  586.       Visible         =   0   'False
  587.       Width           =   2175
  588.    End
  589.    Begin VB.Label lblGateWay 
  590.       Alignment       =   2  'Center
  591.       BackColor       =   &H00000000&
  592.       BeginProperty Font 
  593.          Name            =   "MS Sans Serif"
  594.          Size            =   13.5
  595.          Charset         =   0
  596.          Weight          =   700
  597.          Underline       =   0   'False
  598.          Italic          =   0   'False
  599.          Strikethrough   =   0   'False
  600.       EndProperty
  601.       ForeColor       =   &H0000FFFF&
  602.       Height          =   735
  603.       Index           =   4
  604.       Left            =   4680
  605.       TabIndex        =   4
  606.       Top             =   1200
  607.       Visible         =   0   'False
  608.       Width           =   2175
  609.    End
  610.    Begin VB.Label lblGateWay 
  611.       Alignment       =   2  'Center
  612.       BackColor       =   &H00000000&
  613.       BeginProperty Font 
  614.          Name            =   "MS Sans Serif"
  615.          Size            =   13.5
  616.          Charset         =   0
  617.          Weight          =   700
  618.          Underline       =   0   'False
  619.          Italic          =   0   'False
  620.          Strikethrough   =   0   'False
  621.       EndProperty
  622.       ForeColor       =   &H0000FFFF&
  623.       Height          =   735
  624.       Index           =   3
  625.       Left            =   2400
  626.       TabIndex        =   3
  627.       Top             =   2040
  628.       Visible         =   0   'False
  629.       Width           =   2055
  630.    End
  631.    Begin VB.Label lblGateWay 
  632.       Alignment       =   2  'Center
  633.       BackColor       =   &H00000000&
  634.       BeginProperty Font 
  635.          Name            =   "MS Sans Serif"
  636.          Size            =   13.5
  637.          Charset         =   0
  638.          Weight          =   700
  639.          Underline       =   0   'False
  640.          Italic          =   0   'False
  641.          Strikethrough   =   0   'False
  642.       EndProperty
  643.       ForeColor       =   &H0000FFFF&
  644.       Height          =   735
  645.       Index           =   2
  646.       Left            =   2400
  647.       TabIndex        =   2
  648.       Top             =   1200
  649.       Visible         =   0   'False
  650.       Width           =   2055
  651.    End
  652.    Begin VB.Label lblGateWay 
  653.       Alignment       =   2  'Center
  654.       BackColor       =   &H00000000&
  655.       BeginProperty Font 
  656.          Name            =   "MS Sans Serif"
  657.          Size            =   13.5
  658.          Charset         =   0
  659.          Weight          =   700
  660.          Underline       =   0   'False
  661.          Italic          =   0   'False
  662.          Strikethrough   =   0   'False
  663.       EndProperty
  664.       ForeColor       =   &H0000FFFF&
  665.       Height          =   735
  666.       Index           =   1
  667.       Left            =   120
  668.       TabIndex        =   1
  669.       Top             =   2040
  670.       Visible         =   0   'False
  671.       Width           =   2055
  672.    End
  673.    Begin VB.Label lblGateWay 
  674.       Alignment       =   2  'Center
  675.       BackColor       =   &H00000000&
  676.       BeginProperty Font 
  677.          Name            =   "MS Sans Serif"
  678.          Size            =   13.5
  679.          Charset         =   0
  680.          Weight          =   700
  681.          Underline       =   0   'False
  682.          Italic          =   0   'False
  683.          Strikethrough   =   0   'False
  684.       EndProperty
  685.       ForeColor       =   &H0000FFFF&
  686.       Height          =   735
  687.       Index           =   0
  688.       Left            =   120
  689.       TabIndex        =   0
  690.       Top             =   1200
  691.       Visible         =   0   'False
  692.       Width           =   2055
  693.    End
  694.    Begin VB.Shape Shape2 
  695.       Height          =   1815
  696.       Left            =   0
  697.       Shape           =   4  'Rounded Rectangle
  698.       Top             =   1080
  699.       Width           =   9255
  700.    End
  701.    Begin VB.Shape Shape1 
  702.       Height          =   855
  703.       Left            =   0
  704.       Shape           =   4  'Rounded Rectangle
  705.       Top             =   120
  706.       Width           =   9255
  707.    End
  708. Attribute VB_Name = "FrmGateWay"
  709. Attribute VB_GlobalNameSpace = False
  710. Attribute VB_Creatable = False
  711. Attribute VB_PredeclaredId = True
  712. Attribute VB_Exposed = False
  713. Dim mmflag As Boolean
  714. Dim sax As Integer
  715. Public blnAllowAlarm As Boolean
  716. Dim beepcount As Integer
  717. Dim Say As Integer
  718. Dim intResponseCount As Integer
  719. Dim SayCount As Integer
  720. Option Explicit
  721. Private Sub Form_Load()
  722.     Dim intLoadServers As Integer
  723.     Me.Top = LSetting("TOP")
  724.     Me.Left = LSetting("LEFT")
  725.     intNoOfGateServers = (CInt(Val(LSetting("NoOfGateWays"))))
  726.     With FormShaper1
  727.         .ShapeIt
  728.     End With
  729.     modWeb.refresh
  730.     'Me.Left = frmgateway.Left
  731.     'Me.Top = frmgateway.Top
  732. End Sub
  733. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  734.    Dim fml As Long
  735.    Dim fmt As Long
  736.    Dim a As Integer
  737.     For a = 0 To 7
  738.         lblGateWay(a).BorderStyle = 0
  739.     Next a
  740.    If mmflag = True Then
  741.       fml = Me.Left: fmt = Me.Top
  742.       If X > sax Then Me.Left = fml + (X - sax)
  743.         If X < sax Then Me.Left = fml - (sax - X)
  744.       If Y > Say Then Me.Top = fmt + (Y - Say)
  745.       If Y < Say Then Me.Top = fmt - (Say - Y)
  746.    End If
  747.    Image1.BorderStyle = 0
  748.    Image2.BorderStyle = 0
  749.    Image3.BorderStyle = 0
  750.    Image4.BorderStyle = 0
  751.    End Sub
  752. Private Sub form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  753. If mmflag = False Then
  754.       sax = X
  755.       Say = Y
  756.       mmflag = True
  757.    End If
  758.    Me.MousePointer = vbSizePointer
  759.    End Sub
  760. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  761.     mmflag = False
  762.    Me.MousePointer = vbDefault
  763. End Sub
  764. Private Sub lblGateWay_Click(Index As Integer)
  765.     lblIP = LSetting("GateWayIP" & Index)
  766.     lblMName = LSetting("gateWayName" & Index)
  767.     lblChecked = LSetting("LgateSend" & Index)
  768.     lblLastFail = LSetting("LGateFail" & Index)
  769.     If LSetting("GateDownSince" & Index) <> "" Then
  770.         lblDownTime = ConvertToHMS(DateDiff("s", LSetting("GateDownSince" & Index), Now)) 'convert seconds to minutes and seconds
  771.     Else
  772.         lblDownTime = "None"
  773.     End If
  774.     intGateClicked = Index
  775. End Sub
  776. Private Sub Image1_Click()
  777. blnEdit = False
  778.     frmNewgateWay.Show
  779. End Sub
  780. Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  781.    Image1.BorderStyle = 1
  782. End Sub
  783. Private Sub Image2_Click()
  784.     Dim X As Integer
  785.      For X = frmMain.tmrAlert.LBound To frmMain.tmrAlert.UBound
  786.         frmMain.tmrAlert(X).Enabled = False ' disable all timers in the alert control array
  787.     Next X
  788.     For X = tmrAlert2.LBound To tmrAlert2.UBound
  789.         tmrAlert2(X).Enabled = False ' disable all timers in the alert control array
  790.     Next X
  791.     Set frmMain.cSysTray1.TrayIcon = frmMain.imgIcon(0).Picture 'set tray icon
  792.     For X = lblGateWay.LBound To lblGateWay.UBound
  793.         lblGateWay(X).BackColor = &O0& ' set all labels to black
  794.     Next X
  795.     For X = frmMain.lblServer.LBound To frmMain.lblServer.UBound
  796.         frmMain.lblServer(X).BackColor = &O0& ' set all labels to black
  797.     Next X
  798. End Sub
  799. Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  800.      Image2.BorderStyle = 1
  801. End Sub
  802. Private Sub Image3_Click()
  803.     Dim ECHO As ICMP_ECHO_REPLY
  804.     FrmGateWay.lblBytesSent = ""
  805.     FrmGateWay.lblBytesRecieved = ""
  806.     FrmGateWay.lblTimeMS = ""
  807.     FrmGateWay.lblPingStatus.Caption = ""
  808.     lblPStats2.Caption = ""
  809.     If Val(txtPingThis) > 0 And InStr(1, txtPingThis, ".") > 1 Then 'ensure that ip address is valid syntax
  810.        FrmGateWay.lblPingStatus.Caption = "Pinging " & txtPingThis & _
  811.                     "with 9 bytes of Data................."
  812.     Call Ping(txtPingThis, ECHO)
  813.         FrmGateWay.lblBytesSent = "9" ' am sending 'Echo This' which is 9 bytes
  814.         FrmGateWay.lblBytesRecieved = ECHO.DataSize ' the data recieved back this should be 9 if successful
  815.         FrmGateWay.lblTimeMS = ECHO.RoundTripTime 'time taken in m/s
  816.         FrmGateWay.lblPingStatus.Caption = GetStatusCode(ECHO.status) 'status code see modping for details
  817.         Select Case Val(GetStatusCode(ECHO.status))
  818.             Case 0
  819.                SayThis "Pinged the server " & txtPingThis & ". The ping was successful"
  820.                 lblPStats2.Caption = "Successful ping to " & txtPingThis
  821.             Case Else
  822.                 FrmGateWay.lblPStats2.Caption = "Unable to ping " & txtPingThis
  823.                 SayThis "Couldnt Ping the server " & txtPingThis & ". The ping was UnSuccessful"
  824.         End Select
  825.     Else
  826.         MsgBox ("Can't ping that!")
  827.     End If
  828. End Sub
  829. Private Sub Image3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  830.     Image3.BorderStyle = 1
  831. End Sub
  832. Private Sub Image4_Click()
  833.     Me.Hide
  834. End Sub
  835. Private Sub Image4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  836.     Image4.BorderStyle = 1
  837. End Sub
  838. Private Sub lblGateWay_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  839.    Dim intLabs As Integer
  840.     If Button = 2 Then
  841.         intGateClicked = Index
  842.         If blnRebooting(Index) = True Then
  843.             frmPopups.mnuGateReBoot.Caption = "Abort Reboot"
  844.         Else
  845.             frmPopups.mnuGateReBoot.Caption = "Reboot Server"
  846.         End If
  847.         PopupMenu frmPopups.mnuGateMain
  848.         For intLabs = lblGateWay.LBound To lblGateWay.UBound
  849.             lblGateWay(intLabs).Visible = False
  850.         Next intLabs
  851.         modWeb.refresh 'refresh server list
  852.     End If
  853. End Sub
  854. Private Sub lblGateWay_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  855.     lblGateWay(Index).BorderStyle = 1
  856. End Sub
  857. Private Sub tmralert2_Timer(Index As Integer)
  858. If Index = 0 Then
  859.         tmrAlert2(0).Enabled = False
  860.         tmrAlert2(1).Enabled = True
  861.         tmrAlert2(2).Enabled = True
  862.     End If
  863.     If Index = 1 Then
  864.         DoEvents
  865.         Beep
  866.         beepcount = beepcount + 1
  867.     If beepcount = 5 Then
  868.         beepcount = 0
  869.         tmrAlert2(1).Enabled = False
  870.         tmrAlert2(0).Enabled = True
  871.     End If
  872.     End If
  873.     If Index = 2 Then
  874.         If frmMain.cSysTray1.TrayIcon = frmMain.imgIcon(0).Picture Then
  875.             Set frmMain.cSysTray1.TrayIcon = frmMain.imgIcon(1).Picture
  876.         Else
  877.             Set frmMain.cSysTray1.TrayIcon = frmMain.imgIcon(0).Picture
  878.         End If
  879.     End If
  880. End Sub
  881. Private Sub TmrCheckGateWays_Timer()
  882.     Dim intWinsock As Integer
  883.     Dim ssql As String
  884.     TmrCheckGateWays.Enabled = False
  885.     TmrCheckGateWays.Interval = 60000
  886.     If Not intNoOfGateServers = 0 Then
  887.         For intWinsock = 1 To intNoOfGateServers
  888.             WGate.RemotePort = LSetting("GateWayPort" & intWinsock - 1)
  889.             WGate.RemoteHost = LSetting("GateWayip" & intWinsock - 1)
  890.             'sets the box code to send ,this is sent back
  891.             ssql = "010" & intWinsock & "SELECT SYSDATE FROM DUAL"
  892.             WGate.SendData Encrypt(ssql & "|", 8479, 4597)
  893.             GateOk(intWinsock - 1) = False
  894.             SSetting "LGateSend" & intWinsock - 1, Now
  895.         Next intWinsock
  896.     End If
  897.     TmrCheckGateWays.Enabled = True
  898. End Sub
  899. Private Sub tmrDealWithResponseCodes_Timer()
  900.     Dim X As Integer
  901.     Dim strErrMsg As String
  902.     Dim strM As String
  903.     Dim strS As String
  904.     Dim blnAllOk As Boolean
  905.     blnAllOk = True
  906.     For X = 0 To intNoOfGateServers - 1
  907.         If GateOk(X) = False Then
  908.             lblGateWay(X).BackColor = &HFF&
  909.             tmrAlert2(0).Enabled = True
  910.             LogIt "Service Failed Test " & LSetting("GateWayName" & X)
  911.             SSetting "LGateFail" & X, Now
  912.             If LSetting("GateDownSince" & X) = "" Then
  913.                 SSetting "gateDownSince" & X, Now
  914.             End If
  915.             strM = Left(ConvertToHMS(DateDiff("s", LSetting("gateDownSince" & X), Now)), InStr(1, ConvertToHMS(DateDiff("s", LSetting("gateDownSince" & X), Now)), ":") - 1)
  916.             strS = Mid(ConvertToHMS(DateDiff("s", LSetting("gateDownSince" & X), Now)), InStr(1, ConvertToHMS(DateDiff("s", LSetting("gateDownSince" & X), Now)), ":") + 1)
  917.             SayCount = SayCount + 1
  918.             strErrMsg = "Warning! Critical service failure for " & LSetting("GateWayName" & X) & " at  " & LSetting("LGateFail" & X) & " Service has not responded for " & _
  919.                     strM & " Minutes and " & strS & " Seconds"
  920.             If SayCount = 70 Then
  921.                 SayThis strErrMsg
  922.                 SayCount = 0
  923.             End If
  924.         Else
  925.             SSetting "gateDownSince" & X, ""
  926.             lblGateWay(X).BackColor = &H0&
  927.             If blnAllowAlarm = False Then
  928.                 tmrAlert2(0).Enabled = False
  929.                 tmrAlert2(1).Enabled = False
  930.                 tmrAlert2(2).Enabled = False
  931.             End If
  932.         End If
  933.     Next X
  934.     tmrDealWithResponseCodes.Enabled = False
  935. End Sub
  936. Private Sub tmrScroll_Timer()
  937. With lblScroll
  938.         DoEvents
  939.         .Left = .Left + 15
  940.         If .Left > 9000 Then
  941.             .Left = -5760
  942.         End If
  943.     End With
  944. End Sub
  945. Private Sub tmrStarted_Timer()
  946.     tmrStarted = False
  947.     blnAllowAlarm = True
  948. End Sub
  949. Private Sub tmrUpdater_Timer()
  950. On Error GoTo e_trap
  951. Dim intTempNext As Integer
  952. If LSetting("GateDownSince" & intGateClicked) <> "" Then
  953.         lblDownTime = ConvertToHMS(DateDiff("s", LSetting("GateDownSince" & intGateClicked), Now))
  954.         lblDownTime = "None"
  955. End If
  956.     lblCurrentTime.Caption = Format(Now, "hh:mm:ss")
  957.     DoEvents
  958.     intTempNext = DateDiff("s", Now, DateAdd("s", (TmrCheckGateWays.Interval / 1000), LSetting("LGateSend" & intGateClicked)))
  959.     If intTempNext > TmrCheckGateWays.Interval Or intTempNext < 0 Then
  960.         lblNextCheck = "Unknown"
  961.     Else
  962.         lblNextCheck = intTempNext
  963.     End If
  964. Exit Sub
  965. e_trap:
  966.     lblNextCheck = "Unknown"
  967. End Sub
  968. Private Sub WGate_DataArrival(ByVal bytesTotal As Long)
  969.     Dim strTempData As String
  970.     Dim intMsgCode As Integer
  971.     Dim intBoxNo As Integer
  972.     WGate.GetData strTempData
  973.     If Not CInt(Val(Left(strTempData, 2))) = 4 Then
  974.         intBoxNo = CInt(Val(Mid(strTempData, 3, 2)))
  975.         GateOk(intBoxNo - 1) = True
  976.     Else
  977.         tmrDealWithResponseCodes.Enabled = True
  978.     End If
  979.     intResponseCount = intResponseCount + 1
  980.     If intResponseCount = intNoOfGateServers * 3 Then
  981.         tmrDealWithResponseCodes.Enabled = True
  982.         intResponseCount = 0
  983.     End If
  984. End Sub
  985.