VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{C30897B9-75AC-11D2-94E3-000000000000}#1.0#0"; "ARButton.ocx"
Begin VB.MDIForm MDIMain 
   Appearance      =   0  'Flat
   BackColor       =   &H00303030&
   Caption         =   "Cortex"
   ClientHeight    =   9915
   ClientLeft      =   990
   ClientTop       =   2460
   ClientWidth     =   12660
   Icon            =   "MDIMain.frx":0000
   LinkTopic       =   "MDIForm1"
   WindowState     =   2  'Maximized
   Begin VB.PictureBox picContext 
      Align           =   4  'Align Right
      Appearance      =   0  'Flat
      BackColor       =   &H00404040&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   9105
      Left            =   8685
      ScaleHeight     =   9105
      ScaleWidth      =   3975
      TabIndex        =   5
      Top             =   0
      Width           =   3975
      Begin VB.TextBox txtuserFilter 
         Appearance      =   0  'Flat
         BackColor       =   &H00505050&
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   285
         Left            =   45
         TabIndex        =   0
         Top             =   270
         Width           =   2850
      End
      Begin Synapsis.ChainCopy ccpServer 
         Height          =   1215
         Left            =   90
         TabIndex        =   10
         Top             =   7650
         Visible         =   0   'False
         Width           =   2835
         _ExtentX        =   5001
         _ExtentY        =   2143
         ForeColor       =   16777215
         InboundPort     =   80
         Transparent     =   0   'False
         BackColor       =   4210752
      End
      Begin MSComctlLib.ImageList imlUser 
         Left            =   585
         Top             =   3015
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   -2147483643
         ImageWidth      =   15
         ImageHeight     =   19
         MaskColor       =   6316128
         _Version        =   393216
         BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
            NumListImages   =   2
            BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "MDIMain.frx":1242
               Key             =   ""
            EndProperty
            BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "MDIMain.frx":1624
               Key             =   ""
            EndProperty
         EndProperty
      End
      Begin VB.PictureBox picSubContainer 
         BackColor       =   &H00404040&
         BorderStyle     =   0  'None
         Height          =   3345
         Left            =   0
         ScaleHeight     =   3345
         ScaleWidth      =   2535
         TabIndex        =   8
         Top             =   4275
         Width           =   2535
         Begin Synapsis.LightGroup mhdContext 
            Height          =   285
            Index           =   1
            Left            =   315
            TabIndex        =   27
            Top             =   315
            Width           =   1815
            _ExtentX        =   3201
            _ExtentY        =   503
            BackColor       =   4210752
            ForeColor       =   16777215
            Caption         =   "Fila de Espera"
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LineFGColor     =   6316128
            LineBGColor     =   2097696
            ForeColor       =   16777215
         End
         Begin MSComctlLib.ListView lstQueue 
            DragIcon        =   "MDIMain.frx":1A06
            Height          =   1140
            Left            =   180
            TabIndex        =   2
            Tag             =   "UserQueue"
            Top             =   585
            Width           =   1950
            _ExtentX        =   3440
            _ExtentY        =   2011
            View            =   3
            LabelEdit       =   1
            MultiSelect     =   -1  'True
            LabelWrap       =   -1  'True
            HideSelection   =   -1  'True
            FullRowSelect   =   -1  'True
            _Version        =   393217
            Icons           =   "imlMain"
            SmallIcons      =   "imlUser"
            ForeColor       =   12632256
            BackColor       =   3158064
            Appearance      =   0
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Small Fonts"
               Size            =   6.75
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            NumItems        =   2
            BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
               Text            =   "Nome"
               Object.Width           =   38100
            EndProperty
            BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
               SubItemIndex    =   1
               Text            =   "Entrada"
               Object.Width           =   2540
            EndProperty
         End
      End
      Begin MSComctlLib.ListView lstUsers 
         DragIcon        =   "MDIMain.frx":22D0
         Height          =   2265
         Left            =   0
         TabIndex        =   1
         Tag             =   "MicroUserList"
         Top             =   585
         Width           =   2850
         _ExtentX        =   5027
         _ExtentY        =   3995
         View            =   3
         LabelEdit       =   1
         MultiSelect     =   -1  'True
         LabelWrap       =   -1  'True
         HideSelection   =   0   'False
         FullRowSelect   =   -1  'True
         _Version        =   393217
         Icons           =   "imlMain"
         SmallIcons      =   "imlUser"
         ForeColor       =   12632256
         BackColor       =   3158064
         Appearance      =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Small Fonts"
            Size            =   6
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         NumItems        =   4
         BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
            Text            =   "ID"
            Object.Width           =   2540
         EndProperty
         BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
            SubItemIndex    =   1
            Text            =   "Nick"
            Object.Width           =   2540
         EndProperty
         BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
            SubItemIndex    =   2
            Text            =   "Nome"
            Object.Width           =   2540
         EndProperty
         BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
            SubItemIndex    =   3
            Text            =   "Idade"
            Object.Width           =   2540
         EndProperty
      End
      Begin Synapsis.LightGroup mhdContext 
         Height          =   285
         Index           =   0
         Left            =   90
         TabIndex        =   28
         Top             =   45
         Width           =   1815
         _ExtentX        =   3201
         _ExtentY        =   503
         BackColor       =   4210752
         ForeColor       =   16777215
         Caption         =   "Usuários"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LineFGColor     =   6316128
         LineBGColor     =   2097696
         ForeColor       =   16777215
      End
      Begin Synapsis.LightGroup mhdContext 
         Height          =   285
         Index           =   2
         Left            =   495
         TabIndex        =   29
         Top             =   6885
         Width           =   1815
         _ExtentX        =   3201
         _ExtentY        =   503
         BackColor       =   4210752
         ForeColor       =   16777215
         Caption         =   "Sincronia de Arquivos"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LineFGColor     =   6316128
         LineBGColor     =   2097696
         ForeColor       =   16777215
      End
   End
   Begin VB.PictureBox picHolder 
      Align           =   2  'Align Bottom
      AutoSize        =   -1  'True
      BackColor       =   &H00404040&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   0
      ScaleHeight     =   41
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   844
      TabIndex        =   4
      Top             =   9105
      Width           =   12660
      Begin Synapsis.DoubleLine dblDeco 
         Height          =   30
         Index           =   3
         Left            =   0
         TabIndex        =   13
         Top             =   0
         Width           =   1680
         _ExtentX        =   2963
         _ExtentY        =   53
         BackColor       =   3158064
         ForeColor       =   5263440
      End
      Begin VB.PictureBox picContainer 
         Height          =   510
         Left            =   11655
         ScaleHeight     =   450
         ScaleWidth      =   900
         TabIndex        =   9
         Top             =   45
         Visible         =   0   'False
         Width           =   960
         Begin VB.Timer tmrClock 
            Enabled         =   0   'False
            Interval        =   1000
            Left            =   450
            Top             =   0
         End
      End
      Begin VB.Label lblStatus 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   195
         Index           =   1
         Left            =   900
         TabIndex        =   12
         Top             =   270
         Width           =   45
      End
      Begin VB.Label lblStatus 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   195
         Index           =   0
         Left            =   810
         TabIndex        =   11
         Top             =   0
         Width           =   45
      End
      Begin VB.Image imgStLib 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   600
         Index           =   3
         Left            =   8550
         Picture         =   "MDIMain.frx":2B9A
         Top             =   0
         Visible         =   0   'False
         Width           =   690
      End
      Begin VB.Image imgStLib 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   600
         Index           =   2
         Left            =   7830
         Picture         =   "MDIMain.frx":3F74
         Top             =   0
         Visible         =   0   'False
         Width           =   690
      End
      Begin VB.Image imgStLib 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   600
         Index           =   1
         Left            =   7110
         Picture         =   "MDIMain.frx":534E
         Top             =   0
         Visible         =   0   'False
         Width           =   690
      End
      Begin VB.Image imgStLib 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   600
         Index           =   0
         Left            =   6390
         Picture         =   "MDIMain.frx":6728
         Top             =   0
         Visible         =   0   'False
         Width           =   690
      End
      Begin VB.Image imgStatusIcon 
         Height          =   570
         Left            =   45
         Picture         =   "MDIMain.frx":7B02
         Top             =   45
         Width           =   660
      End
   End
   Begin VB.PictureBox picButtons 
      Align           =   3  'Align Left
      Appearance      =   0  'Flat
      BackColor       =   &H00404040&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   9105
      Left            =   0
      ScaleHeight     =   607
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   120
      TabIndex        =   3
      Top             =   0
      Width           =   1800
      Begin Synapsis.LightGroup lgpOpts 
         Height          =   1545
         Index           =   2
         Left            =   45
         TabIndex        =   19
         Top             =   2565
         Width           =   1725
         _ExtentX        =   3043
         _ExtentY        =   2725
         BackColor       =   4210752
         ForeColor       =   16777215
         Caption         =   "Funções"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LineFGColor     =   6316128
         LineBGColor     =   2097696
         ForeColor       =   16777215
         Begin Synapsis.DoubleLine dblDeco 
            Height          =   30
            Index           =   0
            Left            =   0
            TabIndex        =   26
            Top             =   1035
            Width           =   1680
            _ExtentX        =   2963
            _ExtentY        =   53
            BackColor       =   3684408
            ForeColor       =   4737096
         End
         Begin ARButtonCtrl.ARButton cmdItem 
            Height          =   330
            Index           =   5
            Left            =   0
            TabIndex        =   23
            Top             =   630
            Width           =   1680
            _ExtentX        =   2963
            _ExtentY        =   582
            Caption         =   "&Sobre"
            ForeColor       =   16777215
            ForeColorOnMouse=   0
            ForeColorOnFocus=   16777215
            BackColorOnMouse=   10526880
            BackColor       =   5263440
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Alignment       =   1
            ShowFocus       =   2
            BorderStyle     =   2
         End
         Begin ARButtonCtrl.ARButton cmdItem 
            Height          =   330
            Index           =   4
            Left            =   0
            TabIndex        =   24
            Top             =   1125
            Width           =   1680
            _ExtentX        =   2963
            _ExtentY        =   582
            Caption         =   "&Sair"
            ForeColor       =   16777215
            ForeColorOnMouse=   0
            ForeColorOnFocus=   16777215
            BackColorOnMouse=   10526880
            BackColor       =   5263440
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Alignment       =   1
            ShowFocus       =   2
            BorderStyle     =   2
            Picture         =   "MDIMain.frx":8EDC
         End
         Begin ARButtonCtrl.ARButton cmdItem 
            Height          =   330
            Index           =   3
            Left            =   0
            TabIndex        =   25
            Top             =   270
            Width           =   1680
            _ExtentX        =   2963
            _ExtentY        =   582
            Caption         =   "&Panic!"
            ForeColor       =   16777215
            ForeColorOnMouse=   0
            ForeColorOnFocus=   16777215
            BackColorOnMouse=   10526880
            BackColor       =   5263440
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Alignment       =   1
            ShowFocus       =   2
            BorderStyle     =   2
         End
      End
      Begin Synapsis.LightGroup lgpOpts 
         Height          =   1320
         Index           =   1
         Left            =   45
         TabIndex        =   18
         Top             =   1125
         Width           =   1725
         _ExtentX        =   3043
         _ExtentY        =   2328
         BackColor       =   4210752
         ForeColor       =   16777215
         Caption         =   "Utilitários"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LineFGColor     =   6316128
         LineBGColor     =   2097696
         ForeColor       =   16777215
         Begin ARButtonCtrl.ARButton cmdItem 
            Height          =   330
            Index           =   2
            Left            =   0
            TabIndex        =   22
            Top             =   990
            Width           =   1680
            _ExtentX        =   2963
            _ExtentY        =   582
            Caption         =   "&Configurações"
            ForeColor       =   16777215
            ForeColorOnMouse=   0
            ForeColorOnFocus=   16777215
            BackColorOnMouse=   10526880
            BackColor       =   5263440
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Alignment       =   1
            VerticalAlignment=   2
            ShowFocus       =   2
            BorderStyle     =   2
         End
         Begin ARButtonCtrl.ARButton cmdItem 
            Height          =   330
            Index           =   6
            Left            =   0
            TabIndex        =   20
            Top             =   270
            Width           =   1680
            _ExtentX        =   2963
            _ExtentY        =   582
            Caption         =   "A&dministração"
            ForeColor       =   16777215
            ForeColorOnMouse=   0
            ForeColorOnFocus=   16777215
            BackColorOnMouse=   10526880
            BackColor       =   5263440
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Alignment       =   1
            ShowFocus       =   2
            BorderStyle     =   2
         End
         Begin ARButtonCtrl.ARButton cmdItem 
            Height          =   330
            Index           =   7
            Left            =   0
            TabIndex        =   21
            Top             =   630
            Width           =   1680
            _ExtentX        =   2963
            _ExtentY        =   582
            Caption         =   "&Ferramentas"
            ForeColor       =   16777215
            ForeColorOnMouse=   0
            ForeColorOnFocus=   16777215
            BackColorOnMouse=   10526880
            BackColor       =   5263440
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Alignment       =   1
            ShowFocus       =   2
            BorderStyle     =   2
         End
      End
      Begin Synapsis.LightGroup lgpOpts 
         Height          =   960
         Index           =   0
         Left            =   45
         TabIndex        =   15
         Top             =   45
         Width           =   1725
         _ExtentX        =   3043
         _ExtentY        =   1693
         BackColor       =   4210752
         ForeColor       =   16777215
         Caption         =   "Listas"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LineFGColor     =   6316128
         LineBGColor     =   2097696
         ForeColor       =   16777215
         Begin ARButtonCtrl.ARButton cmdItem 
            Height          =   330
            Index           =   0
            Left            =   0
            TabIndex        =   16
            Top             =   270
            Width           =   1680
            _ExtentX        =   2963
            _ExtentY        =   582
            Caption         =   "&Atendimento"
            ForeColor       =   16777215
            ForeColorOnMouse=   0
            ForeColorOnFocus=   16777215
            BackColorOnMouse=   10526880
            BorderColor     =   6316128
            BackColor       =   5263440
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Alignment       =   1
            ShowFocus       =   2
            BorderStyle     =   2
         End
         Begin ARButtonCtrl.ARButton cmdItem 
            Height          =   330
            Index           =   1
            Left            =   0
            TabIndex        =   17
            Top             =   630
            Width           =   1680
            _ExtentX        =   2963
            _ExtentY        =   582
            Caption         =   "&Usuários"
            ForeColor       =   16777215
            ForeColorOnMouse=   0
            ForeColorOnFocus=   16777215
            BackColorOnMouse=   10526880
            BackColor       =   5263440
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Alignment       =   1
            ShowFocus       =   2
            BorderStyle     =   2
         End
      End
      Begin Synapsis.DoubleLine dblDeco 
         Height          =   5295
         Index           =   4
         Left            =   1770
         TabIndex        =   14
         Top             =   0
         Width           =   30
         _ExtentX        =   53
         _ExtentY        =   53
         BackColor       =   3684408
         ForeColor       =   1579032
         LineStyle       =   1
      End
   End
   Begin Synapsis.DoublePanel dbpRight 
      Align           =   4  'Align Right
      Height          =   9105
      Left            =   8550
      TabIndex        =   6
      Top             =   0
      Width           =   135
      _ExtentX        =   238
      _ExtentY        =   16060
      BackColor       =   8421504
   End
   Begin Synapsis.MicroFooter mcfMain 
      Align           =   2  'Align Bottom
      Height          =   195
      Left            =   0
      TabIndex        =   7
      Top             =   9720
      Width           =   12660
      _ExtentX        =   22331
      _ExtentY        =   344
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Small Fonts"
         Size            =   6.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Caption         =   ""
   End
End
Attribute VB_Name = "MDIMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub ccpServer_TransferEnd()
Me.ccpServer.Visible = False
Me.mhdContext(2).Visible = False
picContext_Resize
End Sub
Private Sub ccpServer_TransferStart()
Me.ccpServer.Visible = True
Me.mhdContext(2).Visible = True
picContext_Resize
End Sub

Private Sub cmdItem_Click(Index As Integer)
On Error GoTo pscmdItem_ClickErr 'EHCG.UID.pscmdItem_Click

    Select Case Index
    Case 0
    frmMachines.WindowState = 2
    frmMachines.SetFocus

    Case 1
    frmUsers.WindowState = 2
    frmUsers.SetFocus
    
    Case 2
    frmConfig.Visible = True
    frmConfig.SetFocus
    
    Case 3
    SendBroadcast "SAY|Reconfigurando ambiente. Por favor, aguardem."
    SendBroadcast "KILLPROCESS|HL.EXE"

    Case 4
    SendBroadcast "SERVERDOWN"
    End
    
    Case 5
    frmAbout.Visible = True

    End Select

Exit Sub
pscmdItem_ClickErr:
Err.Raise Err.number, Err.Source, "ps.cmdItem_Click:" & vbCrLf & "Error: " & Err.number & vbCrLf & "Description: " & Err.Description & vbCrLf, Err.HelpFile, Err.HelpContext

End Sub
Private Sub dbpRight_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
On Error Resume Next
Dim uOrigin As POINTAPI, uNow As POINTAPI, uOriginWidth As Long
GetCursorPos uOrigin
uOriginWidth = picContext.Width

Data.OnDrag = True

    Do While Not Data.OnDrag = False
    DoEvents
    GetCursorPos uNow
    picContext.Width = uOriginWidth - (uNow.x - uOrigin.x) * Screen.TwipsPerPixelX
    Loop

End Sub
Private Sub dbpRight_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Data.OnDrag = False
End Sub
Private Sub lstQueue_DragDrop(Source As Control, x As Single, y As Single)
Dim uOrigin As String, uRemoteTag As String, uRS As Recordset

uOrigin = Source.Tag
uRemoteTag = ListViewGetSelectedList(Source)

    Select Case uOrigin
    Case "MicroUserList", "MainUserList" 'Mm... Uma transferencia de usuario. Checar se ele já não está, e colocá-lo na fila.
    Set uRS = Data.Database.Execute("SELECT * FROM [Shop_queue] WHERE UserID=" & uRemoteTag & " AND [ServiceDT] is Null")
    
        If uRS.EOF Then
        Data.Database.Execute ("INSERT INTO [Shop_queue] ([UserID], [ArrivalDT]) VALUES (" & uRemoteTag & ", " & SQLDate(Now) & ")")
        Call LoadQueueList
        End If
    
    Set uRS = Nothing
    End Select

ListViewAutoSizeByItems Me.lstQueue

End Sub
Private Sub lstQueue_KeyDown(KeyCode As Integer, Shift As Integer)
Dim uList As String, uItem As String, uCounter As Long

    If KeyCode = 46 Then
    uList = ListViewGetSelectedList(Me.lstQueue)
    
    If uList = "" Then Exit Sub
        
        Do
        uItem = ParseDataBlock(uList, uCounter, "|")
        
            If uItem = "" Then Exit Do
        
        RemoveUserFromQueue uItem, False
        uCounter = uCounter + 1
        Loop
        
    End If

End Sub

Private Sub lstQueue_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
DragList Me.lstQueue, x, y
End Sub
Private Sub lstUsers_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)

Call ListItemOrderByColumn(lstUsers, ColumnHeader)

End Sub
Private Sub lstUsers_ItemClick(ByVal Item As MSComctlLib.ListItem)

Me.txtUserFilter = Item.Text

End Sub
Private Sub lstUsers_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

DragList Me.lstUsers, x, y

End Sub
Private Sub MDIForm_Load()
On Error GoTo psMDIForm_LoadErr 'EHCG.UID.psMDIForm_Load

ApplyLanguage Me

Data.MainInterfaceLoaded = True
Me.Visible = True

Me.tmrClock.Enabled = True

Call PopulateUserList
Call LoadQueueList

ListViewAutoSize Me.lstQueue

Status "Cortex inicializado com sucesso!", uSTMessage

Exit Sub
psMDIForm_LoadErr:
Err.Raise Err.number, Err.Source, "ps.MDIForm_Load:" & vbCrLf & "Error: " & Err.number & vbCrLf & "Description: " & Err.Description & vbCrLf, Err.HelpFile, Err.HelpContext

End Sub
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
StoreFormPos frmComm
End
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
Data.MainInterfaceLoaded = False
End Sub
Private Sub picButtons_Resize()
On Error Resume Next
Me.dblDeco(4).Height = Me.picButtons.ScaleHeight
End Sub

Private Sub picContext_Resize()

    With Me.ccpServer
    .Left = 0
    .Width = Me.picContext.ScaleWidth
    .Top = Me.picContext.ScaleHeight - .Height
    End With

    With Me.mhdContext(2)
    .Left = 0
    .Width = Me.picContext.ScaleWidth
    .Top = Me.ccpServer.Top - .Height
    End With

    With mhdContext(0)
    .Left = 0
    .Top = 0
    .Width = picContext.ScaleWidth
    End With

    With mhdContext(1)
    .Left = 0
    .Top = 0
    .Width = picContext.ScaleWidth
    End With

    With picSubContainer
    .Left = 0
    .Top = picContext.ScaleHeight - .Height - IIf(Me.ccpServer.Visible, Me.ccpServer.Height + Me.mhdContext(2).Height, 0)
    .Width = picContext.ScaleWidth
    End With

    With Me.lstQueue
    .Left = 0
    .Top = Me.mhdContext(1).Height
    .Height = picSubContainer.ScaleHeight - .Top
    .Width = picContext.ScaleWidth
    End With

    With Me.txtUserFilter
    .Top = Me.mhdContext(0).Height
    .Left = 0
    .Width = picContext.ScaleWidth
    End With
    
    With Me.lstUsers
    .Left = 0
    .Top = Me.txtUserFilter.Top + Me.txtUserFilter.Height
    
    .Height = picSubContainer.Top - .Top
    .Width = picContext.ScaleWidth
    End With
    

End Sub
Private Sub picHolder_Resize()
On Error Resume Next
Me.dblDeco(3).Width = Me.picHolder.ScaleWidth
End Sub

Private Sub tmrClock_Timer()
On Error GoTo pstmrClock_TimerErr 'EHCG.UID.pstmrClock_Timer

Dim uTmp As String
uTmp = Data.Machines.CheckStatus

    If uTmp <> "" Then 'Ocorreram atualizações. Procecer com a atualização da lista.
        
        If Data.MachineListLoaded Then
        frmMachines.UpdateItem uTmp
        End If

    End If
    
    If GetTickCount > Data.Settings.ICAEventLast + Data.Settings.ICAEventPeriod Then
    Data.Settings.ICAEventLast = GetTickCount
    Data.Machine_Statuses.CheckStatus
    End If


    If Data.Settings.PingBeaconUse Then
    
        If Data.Settings.PingBeaconLast + Data.Settings.PingBeaconPeriod < GetTickCount Then
        Data.Settings.PingBeaconLast = GetTickCount
        Beep
        SendBroadcast "PING?"
        End If
    
    End If
    
    If Data.StatusMessageDisplayed Then
    Data.StatusMessageTimeLeft = Data.StatusMessageTimeLeft - 1
    
        If Data.StatusMessageTimeLeft < 1 Then
        Me.lblStatus(1) = Now
        Set Me.imgStatusIcon.Picture = Me.imgStLib(0).Picture
        Me.lblStatus(0) = ""
        Data.StatusMessageDisplayed = False
        End If
    
    Else
    Me.lblStatus(1) = Now
    
    End If

Exit Sub
pstmrClock_TimerErr:
Err.Raise Err.number, Err.Source, "ps.tmrClock_Timer:" & vbCrLf & "Error: " & Err.number & vbCrLf & "Description: " & Err.Description & vbCrLf, Err.HelpFile, Err.HelpContext

End Sub
Private Sub txtUserFilter_KeyPress(KeyAscii As Integer)

    If KeyAscii = 13 Then
    PopulateUserList
    End If

End Sub
Sub PopulateUserList()
Dim lUser As User, Count As Long, uLItem As ListItem, uParm As String, uValid As Long

uParm = Me.txtUserFilter

Me.lstUsers.ListItems.Clear
    
    If Data.Users.Count > 0 Then
        
        For Count = 1 To Data.Users.Count
        Set lUser = Data.Users.Item(Count)
            If uParm <> "" Then
                If InStr(UCase(lUser.Alias), UCase(uParm)) <> 0 Or InStr(UCase(lUser.Name), UCase(uParm)) <> 0 Then
                Set uLItem = Me.lstUsers.ListItems.Add
                Call PopulateUserListItem(uLItem, lUser)
                uValid = uValid + 1
                End If
            
            Else
            Set uLItem = Me.lstUsers.ListItems.Add
            Call PopulateUserListItem(uLItem, lUser)
            uValid = uValid + 1
            
            End If

        Next Count
    
    End If

ListViewAutoSize Me.lstUsers

Me.mhdContext(0).Caption = Replace(Data.Language.Item("MDIMain").LangControls.Item("mhdContext(0)").ctlCaption, "%N", uValid)

End Sub
Sub PopulateUserListItem(ByVal uLItem As ListItem, lUser As User)
Dim uAge As Long

uLItem.Tag = lUser.ID
uLItem.Text = Format$(lUser.ID, "00000")
uLItem.SubItems(1) = UCase(lUser.Alias)
uLItem.SubItems(2) = UCase(lUser.Name)
uAge = DateDiff("YYYY", CDate(lUser.Birth), Date)

    If DateSerial(Year(Now), Month(CDate(lUser.Birth)), Day(CDate(lUser.Birth))) > Now() Then uAge = uAge - 1

uLItem.SubItems(3) = Format$(uAge, "0 Anos")

    If uAge < 18 Then
    uLItem.SmallIcon = 1
    
    Else
    uLItem.SmallIcon = 2
    
    End If

    If lUser.Banned Then
    uLItem.ForeColor = 0
    uLItem.Ghosted = True
    uLItem.Bold = False
    uLItem.ListSubItems(1).ForeColor = 0
    uLItem.ListSubItems(2).ForeColor = 0
    uLItem.ListSubItems(3).ForeColor = 0
    End If

End Sub
Sub LoadQueueList()
Dim uRS As Recordset, uLI As ListItem, Count As Long

Set uRS = Data.Database.Execute("SELECT * FROM [Shop_queue] WHERE [ServiceDT] is Null ORDER BY [ArrivalDT]")
Me.lstQueue.ListItems.Clear

    Do While Not uRS.EOF
    Set uLI = Me.lstQueue.ListItems.Add
    uLI.Tag = uRS("UserID")
    uLI.SmallIcon = 1
    uLI.Text = Data.Users.Item("N" & uRS("UserID")).Name
    uLI.SubItems(1) = Format$(uRS("ArrivalDT"), "HH:NN")
    Count = Count + 1
    uRS.MoveNext
    Loop

Me.mhdContext(1).Caption = Replace(Data.Language.Item("MDIMain").LangControls.Item("mhdContext(1)").ctlCaption, "%N", Count)

ListViewAutoSizeMax Me.lstQueue
    
End Sub
