VERSION 5.00
Object = "{22D6F304-B0F6-11D0-94AB-0080C74C7E95}#1.0#0"; "msdxm.ocx"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmMain 
   BorderStyle     =   1  'Fixed Single
   Caption         =   ":: MXM SKINNER :: by geniusalz "
   ClientHeight    =   10080
   ClientLeft      =   45
   ClientTop       =   735
   ClientWidth     =   12765
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmMain.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   OLEDropMode     =   1  'Manual
   ScaleHeight     =   672
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   851
   Begin VB.PictureBox fraModifier 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   1755
      Index           =   2
      Left            =   3000
      ScaleHeight     =   1725
      ScaleWidth      =   5685
      TabIndex        =   71
      Top             =   1920
      Visible         =   0   'False
      Width           =   5715
      Begin VB.CheckBox chkNot 
         Caption         =   "NOT Condition (reverses the condition)"
         Height          =   555
         Left            =   3030
         TabIndex        =   179
         Top             =   690
         Width           =   2355
      End
      Begin VB.CommandButton cmdConditionOK 
         Caption         =   "OK"
         Height          =   315
         Left            =   4830
         TabIndex        =   73
         Top             =   1290
         Width           =   705
      End
      Begin VB.ComboBox lstCond 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFFFFF&
         Height          =   315
         ItemData        =   "frmMain.frx":038A
         Left            =   450
         List            =   "frmMain.frx":03A3
         Style           =   2  'Dropdown List
         TabIndex        =   72
         Top             =   660
         Width           =   2355
      End
      Begin VB.Label Label21 
         BackStyle       =   0  'Transparent
         Caption         =   "Condition"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   315
         Left            =   180
         TabIndex        =   75
         Top             =   210
         Width           =   1905
      End
      Begin VB.Label lblConditionDesc 
         BackStyle       =   0  'Transparent
         Caption         =   "Element will always show up"
         ForeColor       =   &H00000000&
         Height          =   405
         Left            =   450
         TabIndex        =   74
         Top             =   1110
         Width           =   4215
      End
      Begin VB.Shape Shape2 
         BackColor       =   &H00CE6C0A&
         BackStyle       =   1  'Opaque
         BorderColor     =   &H00FFFFFF&
         Height          =   555
         Left            =   30
         Top             =   60
         Width           =   5745
      End
   End
   Begin VB.PictureBox fraModifier 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   2685
      Index           =   1
      Left            =   2910
      ScaleHeight     =   2655
      ScaleWidth      =   6165
      TabIndex        =   76
      Top             =   2250
      Visible         =   0   'False
      Width           =   6195
      Begin VB.TextBox txtTimer 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H00000000&
         Height          =   285
         Index           =   0
         Left            =   840
         TabIndex        =   81
         Text            =   "Delay"
         Top             =   90
         Width           =   975
      End
      Begin VB.TextBox txtTimer 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H00000000&
         Height          =   285
         Index           =   1
         Left            =   840
         TabIndex        =   80
         Text            =   "CycleOn"
         Top             =   600
         Width           =   975
      End
      Begin VB.TextBox txtTimer 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H00000000&
         Height          =   285
         Index           =   2
         Left            =   840
         TabIndex        =   79
         Text            =   "CycleOff"
         Top             =   1140
         Width           =   975
      End
      Begin VB.TextBox txtTimer 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H00000000&
         Height          =   285
         Index           =   3
         Left            =   840
         TabIndex        =   78
         Text            =   "Lifetime"
         Top             =   1680
         Width           =   975
      End
      Begin VB.CommandButton cmdTimersOK 
         BackColor       =   &H00E0E0E0&
         Caption         =   "OK"
         Height          =   255
         Left            =   5400
         TabIndex        =   77
         Top             =   1950
         Width           =   705
      End
      Begin VB.Label Label13 
         Appearance      =   0  'Flat
         Caption         =   "Delay"
         ForeColor       =   &H00000000&
         Height          =   285
         Left            =   180
         TabIndex        =   90
         Top             =   90
         Width           =   615
      End
      Begin VB.Label Label14 
         Appearance      =   0  'Flat
         Caption         =   "CycleOn"
         ForeColor       =   &H00000000&
         Height          =   285
         Left            =   180
         TabIndex        =   89
         Top             =   600
         Width           =   615
      End
      Begin VB.Label Label15 
         Appearance      =   0  'Flat
         Caption         =   "CycleOff"
         ForeColor       =   &H00000000&
         Height          =   285
         Left            =   180
         TabIndex        =   88
         Top             =   1140
         Width           =   615
      End
      Begin VB.Label Label16 
         Appearance      =   0  'Flat
         Caption         =   "Liftime"
         ForeColor       =   &H00000000&
         Height          =   285
         Left            =   180
         TabIndex        =   87
         Top             =   1680
         Width           =   615
      End
      Begin VB.Label Label17 
         Appearance      =   0  'Flat
         Caption         =   "The number of milliseconds before the element appears when the screen is first activated. Defaults to '0'"
         ForeColor       =   &H00000000&
         Height          =   405
         Left            =   1860
         TabIndex        =   86
         Top             =   90
         Width           =   3495
      End
      Begin VB.Label Label18 
         Appearance      =   0  'Flat
         Caption         =   "Once it appears, the element will cycle on by this period. Defaults to 'infinite'"
         ForeColor       =   &H00000000&
         Height          =   405
         Left            =   1860
         TabIndex        =   85
         Top             =   630
         Width           =   3585
      End
      Begin VB.Label Label19 
         Appearance      =   0  'Flat
         Caption         =   "Once it appears, the element will cycle off by this period. If not defined, it will inherit from the CycleOn value."
         ForeColor       =   &H00000000&
         Height          =   405
         Left            =   1890
         TabIndex        =   84
         Top             =   1140
         Width           =   4155
      End
      Begin VB.Label Label20 
         Appearance      =   0  'Flat
         Caption         =   "The length of time the element remains on the screen. Defaults to 'infinite'"
         ForeColor       =   &H00000000&
         Height          =   405
         Left            =   1860
         TabIndex        =   83
         Top             =   1710
         Width           =   3495
      End
      Begin VB.Label lblTimersMsg 
         Appearance      =   0  'Flat
         ForeColor       =   &H008080FF&
         Height          =   225
         Left            =   180
         TabIndex        =   82
         Top             =   2340
         Width           =   5805
      End
   End
   Begin VB.PictureBox fraModifier 
      Appearance      =   0  'Flat
      ForeColor       =   &H80000008&
      Height          =   4575
      Index           =   0
      Left            =   2340
      ScaleHeight     =   4545
      ScaleWidth      =   5745
      TabIndex        =   18
      Top             =   570
      Visible         =   0   'False
      Width           =   5775
      Begin VB.CommandButton cmdModifierOK 
         Caption         =   "OK"
         Height          =   315
         Left            =   4830
         TabIndex        =   35
         Top             =   4140
         Width           =   705
      End
      Begin VB.Frame fraRange 
         Appearance      =   0  'Flat
         Caption         =   "RANGE"
         BeginProperty Font 
            Name            =   "Arial Black"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   1020
         Left            =   360
         TabIndex        =   30
         Top             =   1020
         Visible         =   0   'False
         Width           =   1545
         Begin VB.TextBox txtRangeY 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   360
            TabIndex        =   32
            Text            =   "5"
            Top             =   570
            Width           =   975
         End
         Begin VB.TextBox txtRangeX 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   360
            TabIndex        =   31
            Text            =   "5"
            Top             =   270
            Width           =   975
         End
         Begin VB.Label Label24 
            Appearance      =   0  'Flat
            Caption         =   "Y"
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   150
            TabIndex        =   34
            Top             =   570
            Width           =   165
         End
         Begin VB.Label Label23 
            Appearance      =   0  'Flat
            Caption         =   "X"
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   150
            TabIndex        =   33
            Top             =   270
            Width           =   255
         End
      End
      Begin VB.ComboBox lstMods 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFFFFF&
         Height          =   315
         ItemData        =   "frmMain.frx":03F8
         Left            =   540
         List            =   "frmMain.frx":03FA
         Style           =   2  'Dropdown List
         TabIndex        =   29
         Top             =   540
         Width           =   2355
      End
      Begin VB.ComboBox lstTargets 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFFFFF&
         Height          =   315
         ItemData        =   "frmMain.frx":03FC
         Left            =   3000
         List            =   "frmMain.frx":03FE
         Style           =   2  'Dropdown List
         TabIndex        =   28
         Top             =   540
         Visible         =   0   'False
         Width           =   2355
      End
      Begin VB.Frame fraBounds 
         Appearance      =   0  'Flat
         Caption         =   "BOUNDS"
         BeginProperty Font 
            Name            =   "Arial Black"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   1680
         Left            =   390
         TabIndex        =   19
         Top             =   1020
         Visible         =   0   'False
         Width           =   1845
         Begin VB.TextBox txtBoundsL 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   720
            TabIndex        =   23
            Text            =   "5"
            Top             =   210
            Width           =   975
         End
         Begin VB.TextBox txtBoundsT 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   720
            TabIndex        =   22
            Text            =   "5"
            Top             =   540
            Width           =   975
         End
         Begin VB.TextBox txtBoundsR 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   720
            TabIndex        =   21
            Text            =   "5"
            Top             =   870
            Width           =   975
         End
         Begin VB.TextBox txtBoundsB 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   720
            TabIndex        =   20
            Text            =   "5"
            Top             =   1230
            Width           =   975
         End
         Begin VB.Label Label25 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Left"
            ForeColor       =   &H00000000&
            Height          =   195
            Left            =   150
            TabIndex        =   27
            Top             =   210
            Width           =   285
         End
         Begin VB.Label Label26 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Top"
            ForeColor       =   &H00000000&
            Height          =   195
            Left            =   120
            TabIndex        =   26
            Top             =   540
            Width           =   270
         End
         Begin VB.Label Label27 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Right"
            ForeColor       =   &H00000000&
            Height          =   195
            Left            =   120
            TabIndex        =   25
            Top             =   870
            Width           =   375
         End
         Begin VB.Label Label28 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Bottom"
            ForeColor       =   &H00000000&
            Height          =   195
            Left            =   120
            TabIndex        =   24
            Top             =   1200
            Width           =   510
         End
      End
      Begin VB.Frame fraColor 
         Appearance      =   0  'Flat
         Caption         =   "COLOR"
         BeginProperty Font 
            Name            =   "Arial Black"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   2940
         Left            =   360
         TabIndex        =   36
         Top             =   1020
         Visible         =   0   'False
         Width           =   4725
         Begin VB.CheckBox chkColr 
            Appearance      =   0  'Flat
            Caption         =   "Alpha"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   0
            Left            =   150
            TabIndex        =   40
            Top             =   300
            Width           =   195
         End
         Begin VB.CheckBox chkColr 
            Appearance      =   0  'Flat
            Caption         =   "Red"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   1
            Left            =   1860
            TabIndex        =   39
            Top             =   330
            Width           =   195
         End
         Begin VB.CheckBox chkColr 
            Appearance      =   0  'Flat
            Caption         =   "Green"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   2
            Left            =   150
            TabIndex        =   38
            Top             =   1590
            Width           =   195
         End
         Begin VB.CheckBox chkColr 
            Appearance      =   0  'Flat
            Caption         =   "Blue"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   3
            Left            =   1860
            TabIndex        =   37
            Top             =   1590
            Width           =   195
         End
         Begin VB.Label lblMax1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Max"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   0
            Left            =   210
            TabIndex        =   69
            Top             =   930
            Width           =   300
         End
         Begin VB.Label lblMin1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Min"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   0
            Left            =   210
            TabIndex        =   68
            Top             =   600
            Width           =   240
         End
         Begin VB.Label lblPeriod1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Period"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   0
            Left            =   210
            TabIndex        =   67
            Top             =   1200
            Width           =   450
         End
         Begin VB.Label lblMin 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "0"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   900
            MousePointer    =   9  'Size W E
            TabIndex        =   66
            Top             =   600
            Width           =   555
         End
         Begin VB.Label lblMax 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "255"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   900
            MousePointer    =   9  'Size W E
            TabIndex        =   65
            Top             =   900
            Width           =   555
         End
         Begin VB.Label lblPeriod 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "50"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   900
            MousePointer    =   9  'Size W E
            TabIndex        =   64
            Top             =   1200
            Width           =   555
         End
         Begin VB.Label lblPeriod 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "50"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   1
            Left            =   2610
            MousePointer    =   9  'Size W E
            TabIndex        =   63
            Top             =   1230
            Width           =   555
         End
         Begin VB.Label lblMax 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "255"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   1
            Left            =   2610
            MousePointer    =   9  'Size W E
            TabIndex        =   62
            Top             =   930
            Width           =   555
         End
         Begin VB.Label lblMin 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "0"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   1
            Left            =   2610
            MousePointer    =   9  'Size W E
            TabIndex        =   61
            Top             =   630
            Width           =   555
         End
         Begin VB.Label lblPeriod1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Period"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   1
            Left            =   1920
            TabIndex        =   60
            Top             =   1230
            Width           =   450
         End
         Begin VB.Label lblMin1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Min"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   1
            Left            =   1920
            TabIndex        =   59
            Top             =   630
            Width           =   240
         End
         Begin VB.Label lblMax1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Max"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   1
            Left            =   1920
            TabIndex        =   58
            Top             =   930
            Width           =   300
         End
         Begin VB.Label lblPeriod 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "50"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   2
            Left            =   900
            MousePointer    =   9  'Size W E
            TabIndex        =   57
            Top             =   2490
            Width           =   555
         End
         Begin VB.Label lblMax 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "255"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   2
            Left            =   900
            MousePointer    =   9  'Size W E
            TabIndex        =   56
            Top             =   2190
            Width           =   555
         End
         Begin VB.Label lblMin 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "0"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   2
            Left            =   900
            MousePointer    =   9  'Size W E
            TabIndex        =   55
            Top             =   1890
            Width           =   555
         End
         Begin VB.Label lblPeriod1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Period"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   2
            Left            =   210
            TabIndex        =   54
            Top             =   2490
            Width           =   450
         End
         Begin VB.Label lblMin1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Min"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   2
            Left            =   210
            TabIndex        =   53
            Top             =   1890
            Width           =   240
         End
         Begin VB.Label lblMax1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Max"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   2
            Left            =   210
            TabIndex        =   52
            Top             =   2190
            Width           =   300
         End
         Begin VB.Label lblPeriod 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "50"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   3
            Left            =   2610
            MousePointer    =   9  'Size W E
            TabIndex        =   51
            Top             =   2490
            Width           =   555
         End
         Begin VB.Label lblMax 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "255"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   3
            Left            =   2610
            MousePointer    =   9  'Size W E
            TabIndex        =   50
            Top             =   2190
            Width           =   555
         End
         Begin VB.Label lblMin 
            Alignment       =   1  'Right Justify
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "0"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   3
            Left            =   2610
            MousePointer    =   9  'Size W E
            TabIndex        =   49
            Top             =   1890
            Width           =   555
         End
         Begin VB.Label lblPeriod1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Period"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   3
            Left            =   1920
            TabIndex        =   48
            Top             =   2490
            Width           =   450
         End
         Begin VB.Label lblMin1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Min"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   3
            Left            =   1920
            TabIndex        =   47
            Top             =   1890
            Width           =   240
         End
         Begin VB.Label lblMax1 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            Caption         =   "Max"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   3
            Left            =   1920
            TabIndex        =   46
            Top             =   2190
            Width           =   300
         End
         Begin VB.Label lblColr 
            AutoSize        =   -1  'True
            Caption         =   "Alpha"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   0
            Left            =   390
            MousePointer    =   15  'Size All
            TabIndex        =   45
            Top             =   330
            Width           =   405
         End
         Begin VB.Label lblColr 
            AutoSize        =   -1  'True
            Caption         =   "Red"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   1
            Left            =   2100
            MousePointer    =   15  'Size All
            TabIndex        =   44
            Top             =   360
            Width           =   285
         End
         Begin VB.Label lblColr 
            AutoSize        =   -1  'True
            Caption         =   "Green"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   2
            Left            =   390
            MousePointer    =   15  'Size All
            TabIndex        =   43
            Top             =   1620
            Width           =   435
         End
         Begin VB.Label lblColr 
            AutoSize        =   -1  'True
            Caption         =   "Blue"
            DragMode        =   1  'Automatic
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   3
            Left            =   2100
            MousePointer    =   15  'Size All
            TabIndex        =   42
            Top             =   1620
            Width           =   300
         End
         Begin VB.Label Label29 
            Caption         =   $"frmMain.frx":0400
            ForeColor       =   &H00000000&
            Height          =   2175
            Left            =   3300
            TabIndex        =   41
            Top             =   450
            Width           =   1365
         End
      End
      Begin VB.Label Label22 
         Caption         =   "MODIFIER:"
         BeginProperty Font 
            Name            =   "Arial Black"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   315
         Left            =   60
         TabIndex        =   70
         Top             =   60
         Width           =   1905
      End
   End
   Begin VB.Frame fraProperties 
      Caption         =   "Properties"
      Height          =   2265
      Left            =   1680
      TabIndex        =   133
      Top             =   7620
      Visible         =   0   'False
      Width           =   7965
      Begin VB.PictureBox fraMxm 
         BorderStyle     =   0  'None
         Height          =   1965
         Left            =   60
         ScaleHeight     =   1965
         ScaleWidth      =   7815
         TabIndex        =   149
         Top             =   210
         Width           =   7815
         Begin VB.CheckBox chkThumbVis 
            Appearance      =   0  'Flat
            Caption         =   "Thumbnails visible"
            ForeColor       =   &H00000000&
            Height          =   195
            Left            =   0
            TabIndex        =   157
            Top             =   90
            Value           =   1  'Checked
            Width           =   1635
         End
         Begin VB.ComboBox cmbTitleAlign 
            Appearance      =   0  'Flat
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   315
            ItemData        =   "frmMain.frx":04BE
            Left            =   3930
            List            =   "frmMain.frx":04CB
            Style           =   2  'Dropdown List
            TabIndex        =   156
            Top             =   240
            Width           =   1095
         End
         Begin VB.ComboBox cmbDescAlign 
            Appearance      =   0  'Flat
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   315
            ItemData        =   "frmMain.frx":04E4
            Left            =   5940
            List            =   "frmMain.frx":04F1
            Style           =   2  'Dropdown List
            TabIndex        =   155
            Top             =   240
            Width           =   1095
         End
         Begin VB.CheckBox chkSelGlow 
            Appearance      =   0  'Flat
            Caption         =   "Glow Selected items"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   0
            TabIndex        =   154
            Top             =   570
            Width           =   1935
         End
         Begin VB.TextBox txtNumItems 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   225
            Left            =   2460
            MaxLength       =   2
            TabIndex        =   153
            Text            =   "5"
            Top             =   1350
            Width           =   375
         End
         Begin VB.CheckBox chkSmoothScroll 
            Appearance      =   0  'Flat
            Caption         =   "Smooth Scrolling"
            ForeColor       =   &H00000000&
            Height          =   195
            Left            =   0
            TabIndex        =   152
            Top             =   330
            Value           =   1  'Checked
            Width           =   1635
         End
         Begin VB.TextBox txtScrollFactor 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   225
            Left            =   2460
            MaxLength       =   2
            TabIndex        =   151
            Text            =   "3"
            Top             =   1110
            Width           =   375
         End
         Begin VB.CheckBox chkShowDesc 
            Appearance      =   0  'Flat
            Caption         =   "Show Game Description"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   0
            TabIndex        =   150
            Top             =   810
            Value           =   1  'Checked
            Width           =   2055
         End
         Begin MXM_Skinner.colorBox clrSelTitle 
            Height          =   315
            Left            =   6690
            TabIndex        =   158
            Top             =   690
            Width           =   1065
            _ExtentX        =   1879
            _ExtentY        =   556
            BackColor       =   -2147483634
         End
         Begin MXM_Skinner.colorBox clrSelDesc 
            Height          =   315
            Left            =   6690
            TabIndex        =   159
            Top             =   990
            Width           =   1065
            _ExtentX        =   1879
            _ExtentY        =   556
            BackColor       =   14737632
         End
         Begin MXM_Skinner.colorBox clrUnselTitle 
            Height          =   315
            Left            =   6690
            TabIndex        =   160
            Top             =   1290
            Width           =   1065
            _ExtentX        =   1879
            _ExtentY        =   556
            BackColor       =   8421504
         End
         Begin MXM_Skinner.colorBox clrUnselDesc 
            Height          =   315
            Left            =   6690
            TabIndex        =   161
            Top             =   1590
            Width           =   1065
            _ExtentX        =   1879
            _ExtentY        =   556
            BackColor       =   8421504
         End
         Begin VB.Label Label5 
            Appearance      =   0  'Flat
            Caption         =   "Game Title"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   4110
            TabIndex        =   171
            Top             =   0
            Width           =   1095
         End
         Begin VB.Label Label4 
            Appearance      =   0  'Flat
            Caption         =   "Game Description"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   5550
            TabIndex        =   170
            Top             =   0
            Width           =   1575
         End
         Begin VB.Label lblSelTitle 
            BackColor       =   &H00000000&
            Caption         =   "Selected Title"
            ForeColor       =   &H8000000E&
            Height          =   315
            Left            =   3870
            TabIndex        =   169
            Top             =   690
            Width           =   2775
         End
         Begin VB.Label lblUnselTitle 
            BackColor       =   &H00000000&
            Caption         =   "Unselected Title"
            ForeColor       =   &H00808080&
            Height          =   315
            Left            =   3870
            TabIndex        =   168
            Top             =   1290
            Width           =   2775
         End
         Begin VB.Label Label7 
            Appearance      =   0  'Flat
            Caption         =   "# of games shown at a time"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   240
            TabIndex        =   167
            Top             =   1380
            Width           =   2475
         End
         Begin VB.Label Label8 
            Appearance      =   0  'Flat
            Caption         =   "Scroll Factor"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   270
            TabIndex        =   166
            Top             =   1110
            Width           =   1095
         End
         Begin VB.Label lblSelDesc 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00000000&
            Caption         =   "Selected Description"
            ForeColor       =   &H00E0E0E0&
            Height          =   315
            Left            =   3870
            TabIndex        =   165
            Top             =   990
            Width           =   2775
         End
         Begin VB.Label lblUnselDesc 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00000000&
            Caption         =   "Unselected Description"
            ForeColor       =   &H00808080&
            Height          =   255
            Left            =   3870
            TabIndex        =   164
            Top             =   1590
            Width           =   2775
         End
         Begin VB.Label label11 
            Appearance      =   0  'Flat
            Caption         =   "Alignment:"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   3090
            TabIndex        =   163
            Top             =   300
            Width           =   1005
         End
         Begin VB.Label Label6 
            Appearance      =   0  'Flat
            BackStyle       =   0  'Transparent
            Caption         =   "Colors:"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   3060
            TabIndex        =   162
            Top             =   720
            Width           =   1005
         End
      End
      Begin VB.PictureBox fraLine 
         BorderStyle     =   0  'None
         Height          =   1965
         Left            =   60
         ScaleHeight     =   1965
         ScaleWidth      =   7815
         TabIndex        =   146
         Top             =   210
         Width           =   7815
         Begin MXM_Skinner.colorBox clrLine 
            Height          =   315
            Left            =   1170
            TabIndex        =   147
            Top             =   180
            Width           =   1065
            _ExtentX        =   1879
            _ExtentY        =   556
            BackColor       =   16777215
         End
         Begin VB.Label Label9 
            Caption         =   "Line Color:"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   150
            TabIndex        =   148
            Top             =   210
            Width           =   1005
         End
      End
      Begin VB.PictureBox fraText 
         BorderStyle     =   0  'None
         Height          =   1965
         Left            =   60
         ScaleHeight     =   1965
         ScaleWidth      =   7815
         TabIndex        =   141
         Top             =   210
         Width           =   7815
         Begin VB.ComboBox txtText 
            Appearance      =   0  'Flat
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   315
            ItemData        =   "frmMain.frx":050A
            Left            =   90
            List            =   "frmMain.frx":05B0
            TabIndex        =   142
            Top             =   870
            Width           =   3735
         End
         Begin MXM_Skinner.colorBox clrText 
            Height          =   315
            Left            =   1170
            TabIndex        =   143
            Top             =   180
            Width           =   1065
            _ExtentX        =   1879
            _ExtentY        =   556
            BackColor       =   16777215
         End
         Begin VB.Label lblText 
            Caption         =   "Select predefined text below, or enter custom text:"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   120
            TabIndex        =   145
            Top             =   660
            Width           =   3765
         End
         Begin VB.Label Label3 
            Caption         =   "Text Color:"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   150
            TabIndex        =   144
            Top             =   210
            Width           =   1005
         End
      End
      Begin VB.PictureBox fraBox 
         BorderStyle     =   0  'None
         Height          =   1965
         Left            =   60
         ScaleHeight     =   1965
         ScaleWidth      =   7815
         TabIndex        =   134
         Top             =   210
         Width           =   7815
         Begin VB.TextBox txtAlpha 
            Height          =   255
            Left            =   2910
            MaxLength       =   3
            TabIndex        =   135
            Text            =   "100"
            Top             =   180
            Width           =   435
         End
         Begin MXM_Skinner.colorBox clrBoxFill 
            Height          =   315
            Left            =   1170
            TabIndex        =   136
            Top             =   180
            Width           =   1065
            _ExtentX        =   1879
            _ExtentY        =   556
            BackColor       =   0
         End
         Begin MXM_Skinner.colorBox clrBoxBorder 
            Height          =   315
            Left            =   1170
            TabIndex        =   137
            Top             =   540
            Width           =   1065
            _ExtentX        =   1879
            _ExtentY        =   556
            BackColor       =   16777215
         End
         Begin VB.Label lblFillColor 
            Caption         =   "Fill Color:"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   120
            TabIndex        =   140
            Top             =   210
            Width           =   1005
         End
         Begin VB.Label Label1 
            Caption         =   "Border Color:"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   120
            TabIndex        =   139
            Top             =   570
            Width           =   1005
         End
         Begin VB.Label lblAlpha 
            Caption         =   " Opacity            %"
            Height          =   255
            Left            =   2280
            TabIndex        =   138
            Top             =   210
            Width           =   1455
         End
      End
      Begin VB.PictureBox fraImg 
         BorderStyle     =   0  'None
         Height          =   1965
         Left            =   60
         ScaleHeight     =   1965
         ScaleWidth      =   7815
         TabIndex        =   172
         Top             =   210
         Width           =   7815
         Begin VB.ComboBox lstR 
            Appearance      =   0  'Flat
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   315
            ItemData        =   "frmMain.frx":082F
            Left            =   1230
            List            =   "frmMain.frx":0831
            Style           =   2  'Dropdown List
            TabIndex        =   174
            Top             =   510
            Width           =   2775
         End
         Begin VB.CommandButton cmdAddRes 
            Appearance      =   0  'Flat
            Caption         =   "Resource Manager"
            Height          =   315
            Left            =   2040
            TabIndex        =   173
            Top             =   870
            Width           =   1995
         End
         Begin VB.Image imgPreview 
            Appearance      =   0  'Flat
            BorderStyle     =   1  'Fixed Single
            Height          =   1095
            Left            =   5010
            Stretch         =   -1  'True
            Top             =   300
            Width           =   1455
         End
         Begin VB.Label lblPreview 
            Alignment       =   2  'Center
            Appearance      =   0  'Flat
            Caption         =   "Resource Preview"
            ForeColor       =   &H00000000&
            Height          =   255
            Left            =   4950
            TabIndex        =   177
            Top             =   30
            Width           =   1695
         End
         Begin MediaPlayerCtl.MediaPlayer vidPreview 
            Height          =   1095
            Left            =   5010
            TabIndex        =   176
            TabStop         =   0   'False
            Top             =   300
            Width           =   1455
            AudioStream     =   -1
            AutoSize        =   0   'False
            AutoStart       =   -1  'True
            AnimationAtStart=   0   'False
            AllowScan       =   0   'False
            AllowChangeDisplaySize=   -1  'True
            AutoRewind      =   0   'False
            Balance         =   0
            BaseURL         =   ""
            BufferingTime   =   5
            CaptioningID    =   ""
            ClickToPlay     =   -1  'True
            CursorType      =   0
            CurrentPosition =   -1
            CurrentMarker   =   0
            DefaultFrame    =   ""
            DisplayBackColor=   0
            DisplayForeColor=   16777215
            DisplayMode     =   0
            DisplaySize     =   4
            Enabled         =   -1  'True
            EnableContextMenu=   0   'False
            EnablePositionControls=   0   'False
            EnableFullScreenControls=   0   'False
            EnableTracker   =   0   'False
            Filename        =   ""
            InvokeURLs      =   0   'False
            Language        =   -1
            Mute            =   0   'False
            PlayCount       =   2
            PreviewMode     =   0   'False
            Rate            =   1
            SAMILang        =   ""
            SAMIStyle       =   ""
            SAMIFileName    =   ""
            SelectionStart  =   -1
            SelectionEnd    =   -1
            SendOpenStateChangeEvents=   -1  'True
            SendWarningEvents=   -1  'True
            SendErrorEvents =   -1  'True
            SendKeyboardEvents=   0   'False
            SendMouseClickEvents=   0   'False
            SendMouseMoveEvents=   0   'False
            SendPlayStateChangeEvents=   -1  'True
            ShowCaptioning  =   0   'False
            ShowControls    =   0   'False
            ShowAudioControls=   0   'False
            ShowDisplay     =   0   'False
            ShowGotoBar     =   0   'False
            ShowPositionControls=   -1  'True
            ShowStatusBar   =   0   'False
            ShowTracker     =   -1  'True
            TransparentAtStart=   0   'False
            VideoBorderWidth=   0
            VideoBorderColor=   0
            VideoBorder3D   =   0   'False
            Volume          =   0
            WindowlessVideo =   0   'False
         End
         Begin VB.Label lblRes 
            Appearance      =   0  'Flat
            Caption         =   "Select Resource Below:"
            ForeColor       =   &H00000000&
            Height          =   225
            Left            =   1230
            TabIndex        =   175
            Top             =   240
            Width           =   1725
         End
      End
   End
   Begin VB.CommandButton cmdStop 
      Caption         =   "Stop Vids"
      Height          =   315
      Left            =   8370
      TabIndex        =   96
      Top             =   7230
      Width           =   1245
   End
   Begin VB.CommandButton cmdApply 
      Caption         =   "Apply Changes"
      Height          =   315
      Left            =   8070
      TabIndex        =   95
      Top             =   10080
      Visible         =   0   'False
      Width           =   1605
   End
   Begin VB.PictureBox fraSel 
      Appearance      =   0  'Flat
      BackColor       =   &H00C0FFC0&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   195
      Left            =   0
      MousePointer    =   8  'Size NW SE
      ScaleHeight     =   13
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   13
      TabIndex        =   94
      Top             =   0
      Visible         =   0   'False
      Width           =   195
      Begin VB.Shape Shape1 
         Height          =   195
         Left            =   0
         Top             =   0
         Width           =   195
      End
   End
   Begin VB.Timer tmr 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   10440
      Top             =   9390
   End
   Begin VB.Frame fraPos 
      Caption         =   "Position"
      Height          =   1815
      Left            =   9810
      TabIndex        =   7
      Top             =   7020
      Visible         =   0   'False
      Width           =   2595
      Begin VB.PictureBox Picture1 
         BorderStyle     =   0  'None
         Height          =   1455
         Left            =   90
         ScaleHeight     =   1455
         ScaleWidth      =   2415
         TabIndex        =   97
         Top             =   240
         Width           =   2415
         Begin VB.TextBox txtW 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   480
            TabIndex        =   102
            Text            =   "Width"
            Top             =   690
            Width           =   585
         End
         Begin VB.TextBox txtH 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   1680
            TabIndex        =   101
            Text            =   "Height"
            Top             =   690
            Width           =   585
         End
         Begin VB.CommandButton cmdSet 
            Caption         =   "Set"
            Height          =   315
            Left            =   30
            TabIndex        =   100
            Top             =   1020
            Width           =   2235
         End
         Begin VB.TextBox txtT 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   1680
            TabIndex        =   99
            Text            =   "Top"
            Top             =   360
            Width           =   585
         End
         Begin VB.TextBox txtL 
            Alignment       =   1  'Right Justify
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   480
            TabIndex        =   98
            Text            =   "Left"
            Top             =   360
            Width           =   585
         End
         Begin VB.Label lblPos 
            Appearance      =   0  'Flat
            Caption         =   "X: 0    Y: 0"
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   0
            TabIndex        =   107
            Top             =   30
            Width           =   2415
         End
         Begin VB.Label lblWidth 
            Appearance      =   0  'Flat
            Caption         =   "Width "
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   0
            TabIndex        =   106
            Top             =   750
            Width           =   555
         End
         Begin VB.Label lblHeight 
            Appearance      =   0  'Flat
            Caption         =   "Height"
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   1200
            TabIndex        =   105
            Top             =   720
            Width           =   555
         End
         Begin VB.Label lblLeft 
            Appearance      =   0  'Flat
            Caption         =   "Left"
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   0
            TabIndex        =   104
            Top             =   360
            Width           =   555
         End
         Begin VB.Label lblTop 
            Appearance      =   0  'Flat
            Caption         =   "Top"
            ForeColor       =   &H00000000&
            Height          =   285
            Left            =   1200
            TabIndex        =   103
            Top             =   360
            Width           =   555
         End
      End
   End
   Begin VB.Frame fraResize2 
      BorderStyle     =   0  'None
      Caption         =   "fraResize2"
      Height          =   150
      Left            =   1350
      TabIndex        =   92
      Top             =   330
      Visible         =   0   'False
      Width           =   150
      Begin VB.Label lblResize2 
         Appearance      =   0  'Flat
         BackColor       =   &H00C0FFFF&
         BorderStyle     =   1  'Fixed Single
         ForeColor       =   &H80000008&
         Height          =   150
         Left            =   0
         MousePointer    =   15  'Size All
         TabIndex        =   93
         Top             =   0
         Width           =   150
      End
   End
   Begin VB.Frame fraLayout 
      Caption         =   "Currrent Screen"
      Height          =   1920
      Left            =   9810
      TabIndex        =   91
      Top             =   330
      Visible         =   0   'False
      Width           =   2655
      Begin VB.PictureBox Picture3 
         BorderStyle     =   0  'None
         Height          =   1485
         Left            =   120
         ScaleHeight     =   1485
         ScaleWidth      =   2355
         TabIndex        =   118
         Top             =   300
         Width           =   2355
         Begin VB.OptionButton optScreen 
            Appearance      =   0  'Flat
            Caption         =   "FileManager"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   5
            Left            =   0
            TabIndex        =   124
            Top             =   1200
            Width           =   1275
         End
         Begin VB.OptionButton optScreen 
            Appearance      =   0  'Flat
            Caption         =   "JukeBox"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   4
            Left            =   0
            TabIndex        =   123
            Top             =   960
            Width           =   1095
         End
         Begin VB.OptionButton optScreen 
            Appearance      =   0  'Flat
            Caption         =   "Saver"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   3
            Left            =   0
            TabIndex        =   122
            Top             =   720
            Width           =   1215
         End
         Begin VB.OptionButton optScreen 
            Appearance      =   0  'Flat
            Caption         =   "Load"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   2
            Left            =   0
            TabIndex        =   121
            Top             =   480
            Width           =   1035
         End
         Begin VB.OptionButton optScreen 
            Appearance      =   0  'Flat
            Caption         =   "Menu"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   1
            Left            =   0
            TabIndex        =   120
            Top             =   240
            Value           =   -1  'True
            Width           =   1035
         End
         Begin VB.OptionButton optScreen 
            Appearance      =   0  'Flat
            Caption         =   "Title"
            ForeColor       =   &H00000000&
            Height          =   255
            Index           =   0
            Left            =   0
            TabIndex        =   119
            Top             =   0
            Width           =   1035
         End
         Begin VB.Label Label32 
            Caption         =   " (not used yet)"
            ForeColor       =   &H00000000&
            Height          =   195
            Left            =   1230
            TabIndex        =   126
            Top             =   1230
            Width           =   1275
         End
         Begin VB.Label Label31 
            Caption         =   " (not used yet)"
            ForeColor       =   &H00000000&
            Height          =   195
            Left            =   1110
            TabIndex        =   125
            Top             =   990
            Width           =   1275
         End
      End
   End
   Begin VB.Frame fraNote 
      BorderStyle     =   0  'None
      Caption         =   "Frame2"
      Height          =   225
      Left            =   30
      TabIndex        =   10
      Top             =   7200
      Visible         =   0   'False
      Width           =   9615
      Begin VB.Label Label2 
         Caption         =   "Note: Most TV's cut off edges of the screen, so make sure you leave some extra room around your layout."
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   0
         TabIndex        =   11
         Top             =   0
         Width           =   7755
      End
   End
   Begin VB.Frame fraCreate 
      Caption         =   "Create"
      ForeColor       =   &H00000000&
      Height          =   1935
      Left            =   150
      TabIndex        =   9
      Top             =   7620
      Visible         =   0   'False
      Width           =   1455
      Begin VB.PictureBox Picture4 
         BorderStyle     =   0  'None
         Height          =   1545
         Left            =   60
         ScaleHeight     =   1545
         ScaleWidth      =   1275
         TabIndex        =   127
         Top             =   270
         Width           =   1275
         Begin VB.OptionButton optBox 
            Caption         =   "Box"
            Height          =   255
            Left            =   0
            TabIndex        =   132
            Top             =   0
            Width           =   735
         End
         Begin VB.OptionButton optLine 
            Caption         =   "Line"
            Height          =   255
            Left            =   0
            TabIndex        =   131
            Top             =   300
            Width           =   735
         End
         Begin VB.OptionButton optImg 
            Caption         =   "Image/Video"
            Height          =   255
            Left            =   0
            TabIndex        =   130
            Top             =   600
            Width           =   1455
         End
         Begin VB.OptionButton optText 
            Caption         =   "Text"
            Height          =   255
            Left            =   0
            TabIndex        =   129
            Top             =   900
            Width           =   855
         End
         Begin VB.OptionButton optMxm 
            Caption         =   "Game Menu"
            Height          =   255
            Left            =   0
            TabIndex        =   128
            Top             =   1200
            Width           =   1995
         End
      End
   End
   Begin VB.Frame fraElements 
      Caption         =   "Elements (Z-Order)"
      Height          =   4380
      Left            =   9810
      TabIndex        =   8
      Top             =   2400
      Visible         =   0   'False
      Width           =   2655
      Begin VB.PictureBox Picture2 
         BorderStyle     =   0  'None
         Height          =   3975
         Left            =   60
         ScaleHeight     =   3975
         ScaleWidth      =   2505
         TabIndex        =   108
         Top             =   270
         Width           =   2505
         Begin VB.ListBox lst 
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   2790
            Index           =   5
            ItemData        =   "frmMain.frx":0833
            Left            =   60
            List            =   "frmMain.frx":0835
            TabIndex        =   117
            Top             =   180
            Visible         =   0   'False
            Width           =   2415
         End
         Begin VB.CommandButton cmdModifier 
            Caption         =   "Condition"
            Height          =   315
            Index           =   2
            Left            =   1350
            TabIndex        =   116
            Top             =   3090
            Width           =   1095
         End
         Begin VB.CommandButton cmdModifier 
            Caption         =   "Timers"
            Height          =   315
            Index           =   1
            Left            =   690
            TabIndex        =   115
            Top             =   3540
            Width           =   1065
         End
         Begin VB.CommandButton cmdModifier 
            Caption         =   "Modifiers"
            Height          =   315
            Index           =   0
            Left            =   150
            TabIndex        =   114
            Top             =   3090
            Width           =   1035
         End
         Begin VB.ListBox lst 
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   2790
            Index           =   4
            ItemData        =   "frmMain.frx":0837
            Left            =   60
            List            =   "frmMain.frx":0839
            TabIndex        =   113
            Top             =   180
            Visible         =   0   'False
            Width           =   2415
         End
         Begin VB.ListBox lst 
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   2790
            Index           =   3
            ItemData        =   "frmMain.frx":083B
            Left            =   60
            List            =   "frmMain.frx":083D
            TabIndex        =   112
            Top             =   180
            Visible         =   0   'False
            Width           =   2415
         End
         Begin VB.ListBox lst 
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   2790
            Index           =   2
            ItemData        =   "frmMain.frx":083F
            Left            =   60
            List            =   "frmMain.frx":0841
            TabIndex        =   111
            Top             =   180
            Visible         =   0   'False
            Width           =   2415
         End
         Begin VB.ListBox lst 
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   2790
            Index           =   1
            ItemData        =   "frmMain.frx":0843
            Left            =   60
            List            =   "frmMain.frx":0845
            TabIndex        =   110
            Top             =   180
            Visible         =   0   'False
            Width           =   2415
         End
         Begin VB.ListBox lst 
            BackColor       =   &H00FFFFFF&
            ForeColor       =   &H00000000&
            Height          =   2790
            Index           =   0
            ItemData        =   "frmMain.frx":0847
            Left            =   60
            List            =   "frmMain.frx":0849
            TabIndex        =   109
            Top             =   180
            Visible         =   0   'False
            Width           =   2415
         End
      End
   End
   Begin VB.CommandButton cmdPreview 
      Caption         =   "Preview Alpha (not implemented)"
      Height          =   255
      Left            =   8940
      TabIndex        =   1
      Top             =   10680
      Visible         =   0   'False
      Width           =   2535
   End
   Begin VB.CommandButton cmdSave 
      Appearance      =   0  'Flat
      Caption         =   "Save Skin (not implemented)"
      Height          =   255
      Left            =   8940
      TabIndex        =   4
      Top             =   10440
      Visible         =   0   'False
      Width           =   2535
   End
   Begin MSComDlg.CommonDialog dialog 
      Left            =   1770
      Top             =   9810
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
   End
   Begin VB.PictureBox Pic 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ClipControls    =   0   'False
      ForeColor       =   &H80000008&
      Height          =   7200
      Left            =   0
      ScaleHeight     =   480
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   640
      TabIndex        =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   9600
      Begin VB.Frame fraResize1 
         BorderStyle     =   0  'None
         Height          =   150
         Left            =   1680
         TabIndex        =   2
         Top             =   360
         Visible         =   0   'False
         Width           =   150
         Begin VB.Label lblResize1 
            Appearance      =   0  'Flat
            BackColor       =   &H00C0FFFF&
            BorderStyle     =   1  'Fixed Single
            ForeColor       =   &H80000008&
            Height          =   150
            Left            =   0
            MousePointer    =   15  'Size All
            TabIndex        =   3
            Top             =   0
            Width           =   150
         End
      End
      Begin MXM_Skinner.png png 
         Height          =   465
         Index           =   0
         Left            =   420
         TabIndex        =   178
         Top             =   1230
         Visible         =   0   'False
         Width           =   585
         _ExtentX        =   1032
         _ExtentY        =   820
      End
      Begin VB.Label Label12 
         BackStyle       =   0  'Transparent
         Caption         =   "Objects are created on pic_mousedown; resized on pic_mousemove"
         ForeColor       =   &H00000000&
         Height          =   645
         Index           =   4
         Left            =   780
         TabIndex        =   17
         Top             =   5145
         Visible         =   0   'False
         Width           =   7620
      End
      Begin VB.Label Label12 
         BackStyle       =   0  'Transparent
         Caption         =   "Box shown while drawing an object (picturebox)"
         ForeColor       =   &H00000000&
         Height          =   225
         Index           =   3
         Left            =   2715
         TabIndex        =   16
         Top             =   3615
         Visible         =   0   'False
         Width           =   3780
      End
      Begin VB.Label Label12 
         BackStyle       =   0  'Transparent
         Caption         =   "Selection box (picturebox, with labels and stuff inside)"
         ForeColor       =   &H00000000&
         Height          =   225
         Index           =   2
         Left            =   480
         TabIndex        =   15
         Top             =   60
         Visible         =   0   'False
         Width           =   3660
      End
      Begin VB.Label Label12 
         BackStyle       =   0  'Transparent
         Caption         =   "Line selection points (are frames)"
         ForeColor       =   &H00000000&
         Height          =   390
         Index           =   1
         Left            =   630
         TabIndex        =   14
         Top             =   555
         Visible         =   0   'False
         Width           =   1485
      End
      Begin VB.Label Label12 
         BackStyle       =   0  'Transparent
         Caption         =   "(actually a picture)"
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   0
         Left            =   5955
         TabIndex        =   13
         Top             =   2520
         Visible         =   0   'False
         Width           =   1425
      End
      Begin VB.Label Label10 
         BackStyle       =   0  'Transparent
         Caption         =   $"frmMain.frx":084B
         ForeColor       =   &H00000000&
         Height          =   390
         Left            =   420
         TabIndex        =   12
         Top             =   2505
         Visible         =   0   'False
         Width           =   8790
      End
      Begin VB.Image mxm 
         Appearance      =   0  'Flat
         Height          =   1260
         Index           =   0
         Left            =   6150
         Picture         =   "frmMain.frx":08DB
         Stretch         =   -1  'True
         Top             =   1005
         Visible         =   0   'False
         Width           =   1065
      End
      Begin VB.Image img 
         Height          =   960
         Index           =   0
         Left            =   7500
         Stretch         =   -1  'True
         Top             =   1260
         Width           =   1245
      End
      Begin MediaPlayerCtl.MediaPlayer vid 
         Height          =   675
         Index           =   0
         Left            =   3570
         TabIndex        =   6
         TabStop         =   0   'False
         Top             =   1440
         Visible         =   0   'False
         Width           =   885
         AudioStream     =   -1
         AutoSize        =   0   'False
         AutoStart       =   -1  'True
         AnimationAtStart=   0   'False
         AllowScan       =   0   'False
         AllowChangeDisplaySize=   -1  'True
         AutoRewind      =   0   'False
         Balance         =   0
         BaseURL         =   ""
         BufferingTime   =   5
         CaptioningID    =   ""
         ClickToPlay     =   0   'False
         CursorType      =   0
         CurrentPosition =   -1
         CurrentMarker   =   0
         DefaultFrame    =   ""
         DisplayBackColor=   0
         DisplayForeColor=   16777215
         DisplayMode     =   0
         DisplaySize     =   4
         Enabled         =   0   'False
         EnableContextMenu=   0   'False
         EnablePositionControls=   0   'False
         EnableFullScreenControls=   0   'False
         EnableTracker   =   0   'False
         Filename        =   ""
         InvokeURLs      =   0   'False
         Language        =   -1
         Mute            =   0   'False
         PlayCount       =   2
         PreviewMode     =   0   'False
         Rate            =   1
         SAMILang        =   ""
         SAMIStyle       =   ""
         SAMIFileName    =   ""
         SelectionStart  =   -1
         SelectionEnd    =   -1
         SendOpenStateChangeEvents=   0   'False
         SendWarningEvents=   0   'False
         SendErrorEvents =   -1  'True
         SendKeyboardEvents=   0   'False
         SendMouseClickEvents=   0   'False
         SendMouseMoveEvents=   0   'False
         SendPlayStateChangeEvents=   0   'False
         ShowCaptioning  =   0   'False
         ShowControls    =   0   'False
         ShowAudioControls=   0   'False
         ShowDisplay     =   0   'False
         ShowGotoBar     =   0   'False
         ShowPositionControls=   -1  'True
         ShowStatusBar   =   0   'False
         ShowTracker     =   -1  'True
         TransparentAtStart=   0   'False
         VideoBorderWidth=   0
         VideoBorderColor=   0
         VideoBorder3D   =   0   'False
         Volume          =   0
         WindowlessVideo =   -1  'True
      End
      Begin VB.Label txt 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "Text element"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   675
         Index           =   0
         Left            =   2370
         TabIndex        =   5
         Top             =   1695
         Visible         =   0   'False
         Width           =   1140
      End
      Begin VB.Shape box 
         BorderColor     =   &H00FFFFFF&
         FillStyle       =   0  'Solid
         Height          =   1125
         Index           =   0
         Left            =   4770
         Top             =   1110
         Visible         =   0   'False
         Width           =   1170
      End
      Begin VB.Line lin 
         BorderColor     =   &H00FFFFFF&
         Index           =   0
         Visible         =   0   'False
         X1              =   92
         X2              =   139
         Y1              =   149
         Y2              =   149
      End
   End
   Begin VB.Image imgPng 
      Height          =   420
      Left            =   120
      Picture         =   "frmMain.frx":168D
      Stretch         =   -1  'True
      Top             =   10320
      Visible         =   0   'False
      Width           =   540
   End
   Begin VB.Image imgCustom 
      Height          =   420
      Left            =   120
      Picture         =   "frmMain.frx":2592
      Stretch         =   -1  'True
      Top             =   9870
      Visible         =   0   'False
      Width           =   540
   End
   Begin VB.Menu mnuSkin 
      Caption         =   "Skin"
      Begin VB.Menu mnuSaveMXM 
         Caption         =   "Save (MXM)"
      End
      Begin VB.Menu mnuSaveUnleashX 
         Caption         =   "Save (UnleashX)"
      End
      Begin VB.Menu mnuLoadMXM 
         Caption         =   "Load (MXM)"
      End
      Begin VB.Menu mnuLoadEvox 
         Caption         =   "Load (Evox)"
      End
      Begin VB.Menu mnuLoadUnleashX 
         Caption         =   "Load (UnleashX)"
      End
      Begin VB.Menu mnuView 
         Caption         =   "View XML (for testing only)"
         Visible         =   0   'False
      End
   End
   Begin VB.Menu mnuConfig 
      Caption         =   "Configuration"
      Begin VB.Menu mnuDelays 
         Caption         =   "Delays"
      End
      Begin VB.Menu mnuInfo 
         Caption         =   "Skin Info"
      End
      Begin VB.Menu mnuColors 
         Caption         =   "System Colors"
      End
      Begin VB.Menu mnuAudio 
         Caption         =   "Audio Settings"
      End
      Begin VB.Menu mnuResource 
         Caption         =   "Resource Manager"
      End
   End
   Begin VB.Menu mnuBackground 
      Caption         =   "Background"
      Visible         =   0   'False
      Begin VB.Menu mnuLoadBg 
         Caption         =   "Load Background"
      End
      Begin VB.Menu mnuUnloadBg 
         Caption         =   "Unload Background"
      End
   End
   Begin VB.Menu mnuRight2 
      Caption         =   "Right"
      Begin VB.Menu mnuUnlock 
         Caption         =   "Unlock all"
      End
   End
   Begin VB.Menu mnuRight 
      Caption         =   "Right"
      Begin VB.Menu mnuFront 
         Caption         =   "Bring to Front"
      End
      Begin VB.Menu mnuBack 
         Caption         =   "Send to Back"
      End
      Begin VB.Menu mnuForward 
         Caption         =   "Bring Forward"
      End
      Begin VB.Menu mnuBackward 
         Caption         =   "Send Backward"
      End
      Begin VB.Menu mnuDash 
         Caption         =   "-"
         Index           =   0
      End
      Begin VB.Menu mnuDeSel 
         Caption         =   "Unselect"
      End
      Begin VB.Menu mnuLocked 
         Caption         =   "Lock"
      End
      Begin VB.Menu mnuDash1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuModifier 
         Caption         =   "Modifiers"
         Index           =   0
      End
      Begin VB.Menu mnuModifier 
         Caption         =   "Timers"
         Index           =   1
      End
      Begin VB.Menu mnuModifier 
         Caption         =   "Condition"
         Index           =   2
      End
      Begin VB.Menu mnuDash2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuDelete 
         Caption         =   "Delete"
      End
   End
   Begin VB.Menu mnuOptions 
      Caption         =   "Options"
      Visible         =   0   'False
      Begin VB.Menu mnuCover 
         Caption         =   "Cover objects while moving (to prevent blinking)"
      End
      Begin VB.Menu mnuBorders 
         Caption         =   "View safe borders (customize to your TV)"
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim numObj As Integer

Dim curLayout As Integer

Dim resiz As Boolean
Dim lockNum(5) As Integer

'Dim dun As Boolean
Dim t As Single
Dim condDesc(6, 1) As String


Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias _
    "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal _
    hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias _
    "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Type BROWSEINFO
    hOwner As Long
    pidlRoot As Long
    pszDisplayName As String
    lpszTitle As String
    ulFlags As Long
    lpfn As Long
    lParam As Long
    iImage As Long
End Type

Private Type SHITEMID
    cb As Long
    abID As Byte
End Type

Private Type ITEMIDLIST
    mkid As SHITEMID
End Type

Private Const BIF_RETURNONLYFSDIRS = &H1
Private Const BIF_DONTGOBELOWDOMAIN = &H2
Private Const BIF_STATUSTEXT = &H4
Private Const BIF_RETURNFSANCESTORS = &H8
Private Const BIF_BROWSEFORCOMPUTER = &H1000
Private Const BIF_BROWSEFORPRINTER = &H2000

Dim curTxtSet As txtSettings
Dim curImgSet As imgSettings
Dim curBoxSet As boxSettings
Dim curLinSet As linSettings
Dim curMxmSet As mxmSettings

Dim resName As String
Dim resFile As String
'Dim resFile As String

Dim bgBool As Boolean
Dim numTabs As Integer
Dim obje() As Object
Dim txtCustom() As Boolean
Dim itemType() As Integer
Dim itemLocked() As Boolean
Dim itemLayout() As Integer
Dim bgFile As String
Dim imgRes() As String
Dim mov As Boolean

Dim layoutCount() As Integer

'Dim don As Boolean

Dim XM As New ChilkatXml
'Dim outXm As New ChilkatXml
Dim nod As ChilkatXml
Dim cnod As ChilkatXml
Dim ccnod As ChilkatXml
Dim cccnod As ChilkatXml
'Dim ccccnod As ChilkatXml
'Dim attr As ChilkatXml
Dim xmltag As ChilkatXml
Dim skinPath As String

'Dim picFile  As String
'Dim vidFile As String

Dim oldx As Single
Dim oldy As Single
Dim oldxe As Single
Dim oldye As Single

Dim numb As Long
'Dim numl As Long

Dim xval() As Integer
Dim yval() As Integer
Dim alph() As Integer

Dim drawing As Boolean
Dim drawl As Boolean

'Dim ll As Boolean
'Dim bb As Boolean

Dim XMLoutput As String
Dim savePath As String

'Dim undos As String

Dim curObj As Object

Dim modX As Single


'Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
'Private Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal BLENDFUNCT As Long) As Long

Private Type mxmSettings
    thumbVis As Boolean
    smoothScrolling As Boolean
    scrollFactor As Integer
    numItems As Integer
    doGlow As Boolean
    showDesc As Boolean
    titleAlign As String
    descAlign As String
    selTitleColor As String
    unSelTitleColor As String
    selDescColor As String
    unSelDescColor As String
End Type

Private Type txtSettings
    custom As Boolean
    txt As String
    fColor As String
End Type

Private Type boxSettings
    alphaVal As Integer
    fVis As Boolean
    fColor As String
    bVis As Boolean
    bColor As String
End Type

Private Type linSettings
    bColor As String
End Type

Private Type imgSettings
    fileNam As String
    custom As Boolean
End Type

Dim mxmSet() As mxmSettings


Private Sub cmdApply_Click()
    Call updateControls(curObj, 0)
    'hideSels
End Sub
Private Sub cmdModifierOK_Click()
    Dim pp As Integer

    If lstTargets.ListIndex < 0 Then
        Set modifs(curNum) = Nothing
        Call enableAll
        fraModifier(0).Visible = False
        Exit Sub
    End If
    
    Set modifs(curNum) = New ChilkatXml
    modifs(curNum).Tag = "Modifier"
    
    modifs(curNum).AddAttribute "Type", lstMods.List(lstMods.ListIndex)
    
    If Left(lstTargets.List(lstTargets.ListIndex), 1) = "(" Then
    Else
        modifs(curNum).AddAttribute "Target", lstTargets.List(lstTargets.ListIndex)
    End If
    
    If fraRange.Visible = True Then
        modifs(curNum).NewChild "Range", ""
        modifs(curNum).GetChild(0).AddAttribute "X", txtRangeX
        modifs(curNum).GetChild(0).AddAttribute "Y", txtRangeY
    ElseIf fraColor.Visible = True Then
        For pp = 0 To 3
            modifs(curNum).NewChild(lblColr(pp).Caption, "").AddAttribute "Enable", bool(-chkColr(pp).Value)
            modifs(curNum).GetChild(pp).AddAttribute "Min", lblMin(pp)
            modifs(curNum).GetChild(pp).AddAttribute "Max", lblMax(pp)
            modifs(curNum).GetChild(pp).AddAttribute "Period", lblPeriod(pp)
        Next pp
    ElseIf fraBounds.Visible = True Then
        modifs(curNum).NewChild "Bounds", ""
        modifs(curNum).GetChild(0).AddAttribute "L", txtBoundsL
        modifs(curNum).GetChild(0).AddAttribute "T", txtBoundsT
        modifs(curNum).GetChild(0).AddAttribute "R", txtBoundsR
        modifs(curNum).GetChild(0).AddAttribute "B", txtBoundsB
    End If
    
    setBolds
    Call enableAll
    fraModifier(0).Visible = False
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyDelete And lst(curLayout).ListCount > 0 And lst(curLayout).ListIndex > -1 Then
        Unload curObj
        Set curObj = Nothing
        
        lst(curLayout).RemoveItem (lst(curLayout).ListIndex)
        layoutCount(curLayout) = layoutCount(curLayout) - 1
        setLayoutBolds
        
        lst(curLayout).ListIndex = -1
        Call hideSels
    End If
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseDown(Button, Shift, X, Y)
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseMove(Button, Shift, X, Y)
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseUp(Button, Shift, X, Y)
End Sub

Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    If LCase(Right(Data.Files(1), 3)) = "xml" Then
        If lstR.ListCount <> 0 Or lst(curLayout).ListCount <> 0 Or Pic.Picture <> 0 Then
            MsgBox "Before loading, (save your work) and restart the program to clear all memory"
            Exit Sub
        End If
        
        Me.MousePointer = vbHourglass
        
        MsgBox "Put in call loadskin function "
        'call loadskin(
        Me.MousePointer = vbNormal
    End If
End Sub

Private Sub fraSel_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    'Debug.Print X, Y
    If Pic.Enabled = False Then Exit Sub
    resiz = True
    oldxe = X
    oldye = Y
    numObj = lst(curLayout).ItemData(lst(curLayout).ListIndex)
    xval(numObj) = curObj.Left
    yval(numObj) = curObj.Top
End Sub

Private Sub fraSel_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim x1 As Single, y1 As Single
    
    If Pic.Enabled = False Then Exit Sub
    lblPos.Caption = "X: " & X + fraSel.Left & "    Y: " & Y + fraSel.Top
    x1 = fraSel.Left + X
    y1 = fraSel.Top + Y
        
    'If Button = 1 And dun = True And (oldxe <> X Or oldye <> Y) And resiz = True Then
    If Button = 1 And (oldxe <> x1 Or oldye <> y1) And resiz = True Then
        With curObj
            'Debug.Print "A", x1, y1
            
            Dim newWidth As Integer
            Dim newHeight As Integer
            
            newWidth = x1 - xval(numObj) + (13 - oldxe)
            newHeight = y1 - yval(numObj) + (13 - oldye)
            If newWidth < 1 Then newWidth = 1
            If newHeight < 1 Then newHeight = 1
            
            If Shift = 1 Then
                If newWidth <= newHeight Then
                    newHeight = newWidth
                Else
                    newWidth = newHeight
                End If
            End If
            
            If newWidth <> .Width Then .Width = newWidth
            If newHeight <> .height Then .height = newHeight
            setPos
        End With
        
        'If dun = True Then setSel curObj
        setSel curObj
    End If
End Sub

Private Sub fraSel_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Pic.Enabled = False Then Exit Sub
    resiz = False
End Sub

Private Sub lblColr_DragDrop(Index As Integer, source As Control, X As Single, Y As Single)
    Dim kk As Integer

    For kk = 0 To 3
        If source.Index = kk Then
            lblMax(Index) = lblMax(kk)
            lblMin(Index) = lblMin(kk)
            lblPeriod(Index) = lblPeriod(kk)
        End If
    Next kk
    
End Sub

Private Sub lblMax1_DragDrop(Index As Integer, source As Control, X As Single, Y As Single)
    Dim tt As Integer
    
    For tt = 0 To 3
        If source.Index = tt Then
            lblMax(Index) = lblMax(tt)
        End If
    Next tt
End Sub

Private Sub lblMin_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim tem As Integer
    
    If Button = 1 Then
        tem = Val(lblMin(Index).Caption) + X / 15 - modX
        
        If tem > lblMax(Index) Then
            lblMin(Index) = lblMax(Index)
        ElseIf tem < 0 Then
            lblMin(Index) = 0
        Else
            lblMin(Index) = tem
        End If
    End If
    
    modX = X / 15
End Sub

Private Sub lblMax_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim tem As Integer
    
    If Button = 1 Then
        tem = Val(lblMax(Index).Caption) + X / 15 - modX
        
        If tem < lblMin(Index) Then
            lblMax(Index) = lblMin(Index)
        ElseIf tem > 255 Then
            lblMax(Index) = 255
        Else
            lblMax(Index) = tem
        End If
    End If
    
    modX = X / 15
End Sub

Private Sub lblMin1_DragDrop(Index As Integer, source As Control, X As Single, Y As Single)
    Dim nn As Integer
    
    For nn = 0 To 3
        If source.Index = nn Then
            lblMin(Index) = lblMin(nn)
        End If
    Next nn
End Sub

Private Sub lblPeriod_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim te As Integer
    
    If Button = 1 Then
        te = Val(lblPeriod(Index).Caption) + (X / 15 - modX) * 10
        
        If te < 50 Then
            lblPeriod(Index) = 50
        Else
            lblPeriod(Index) = te
        End If
    End If
    
    modX = X / 15
End Sub

Private Sub lblPeriod1_DragDrop(Index As Integer, source As Control, X As Single, Y As Single)
    Dim ll As Integer
    
    For ll = 0 To 3
        If source.Index = ll Then
            lblPeriod(Index) = lblPeriod(ll)
        End If
    Next ll
End Sub

Private Sub lst_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyDelete And lst(curLayout).ListCount > 0 And lst(curLayout).ListIndex > -1 Then
        Unload curObj
        
        lst(curLayout).RemoveItem (lst(curLayout).ListIndex)
        
        lst(curLayout).ListIndex = -1
        Call hideSels
    End If
End Sub

Private Sub lst_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 And lst(curLayout).ListIndex >= 0 And lst(curLayout).ListIndex >= lockNum(curLayout) Then
        mnuLocked.Checked = itemLocked(lst(curLayout).ItemData(lst(curLayout).ListIndex))
        Me.PopupMenu mnuRight
    ElseIf lst(curLayout).ListIndex >= 0 And lst(curLayout).ListIndex < lockNum(curLayout) Then
        Me.PopupMenu mnuRight2
    End If
End Sub

Private Sub lstcond_Click()
    lblConditionDesc = condDesc(lstCond.ListIndex, 0)
End Sub

Private Sub cmbDescAlign_Click()
    lblSelDesc.Alignment = cmbDescAlign.ListIndex
    lblUnselDesc.Alignment = cmbDescAlign.ListIndex
End Sub

Private Sub cmbTitleAlign_Click()
    lblSelTitle.Alignment = cmbTitleAlign.ListIndex
    lblUnselTitle.Alignment = cmbTitleAlign.ListIndex

End Sub

Private Sub cmdAddRes_Click()
    'chkRes.Value = 1
    Call mnuResource_Click
End Sub

Private Sub cmdConditionOK_Click()
    cond(lst(curLayout).ItemData(lst(curLayout).ListIndex)) = lstCond.Text
    
    setBolds
    Call enableAll
    fraModifier(2).Visible = False
End Sub

Private Sub cmdFont_Click()
On Error GoTo blahh
    'dialog.ShowFont
    dialog.Flags = 1
    dialog.ShowFont
    'cmdFont.FontName = dialog.FontName
    'cmdFont.FontSize = dialog.FontSize
    'cmdFont.FontBold = dialog.FontBold
    'cmdFont.FontUnderline = dialog.FontUnderline
    
    dialog.Flags = 0
    Exit Sub
blahh:
If Err <> 32755 Then MsgBox Err.Description
End Sub

'Private Sub cmdLoadPic_Click()
'On Error GoTo heck
    'dialog.Filter = "JPG|*.jpg|BMP|*.bmp"
    'dialog.ShowOpen
'
    'If dialog.FileName <> "" And FileExists(dialog.FileName) Then
        'imgPreview.Picture = LoadPicture(dialog.FileName)
        ''DoEvents
        'imgPreview.height = 65
        'imgPreview.Width = 97
    'End If
'
    'Exit Sub
'heck:
'If Err <> 32755 Then MsgBox Err.Description
'End Sub


'Private Sub cmdLoadVid_Click()
'On Error GoTo helk
    'dialog.Filter = "WMV|*.wmv"
    'dialog.ShowOpen
'
    'If dialog.FileName <> "" Then
        'vidPreview.FileName = dialog.FileName
        ''vidFile = dialog.FileName
    'End If
'
    'Exit Sub
'helk:
'If Err <> 32755 Then MsgBox Err.Description
'End Sub



Private Sub cmdModifier_Click(Index As Integer)
'On Error Resume Next
    Dim R As Integer
    Dim ii As Variant
    
    If lst(curLayout).ListIndex <> -1 Then
        If Index = 1 Then
            Dim q As Integer
            
            For q = 0 To 3
                txtTimer(q) = tim(q, lst(curLayout).ItemData(lst(curLayout).ListIndex))
            Next q
        ElseIf Index = 2 Then
            lstCond.ListIndex = getcondNum(cond(lst(curLayout).ItemData(lst(curLayout).ListIndex)))
        ElseIf Index = 0 Then
                    
            mods.LoadXmlFile fixPath(App.Path) & "modifiers.xml"
            
            Set types = getTag("types", mods)
            Set supports = getTag("supports", mods)
            
            Dim yy As Integer
            Dim temporary As ChilkatXml
            
            For yy = 0 To supports.NumChildren - 1
                Set temporary = supports.GetChild(yy)
                
                If Val(getAttrib(temporary, "type")) = itemType(lst(curLayout).ItemData(lst(curLayout).ListIndex)) Then
                    Set supports = temporary
                    Exit For
                End If
            Next yy
            
            lstMods.Clear
            lstMods.AddItem "None"
            
            For yy = 0 To supports.NumChildren - 1
                lstMods.AddItem supports.GetChild(yy).Tag
            Next yy
            
            'lstMods.AddItem supports.GetChild(yy).Tag
            
            lstMods.ListIndex = 0
            
            If Not modifs(curNum) Is Nothing Then
            If modifs(curNum).NumChildren <> 0 Then
                lstMods.ListIndex = getModNum(getAttrib(modifs(curNum), "Type"))
                
                For Each ii In Split(getContent(lstMods.Text, supports), ",")
                    lstTargets.AddItem ii
                Next ii
                
                lstTargets.ListIndex = getTarNum(getAttrib(modifs(curNum), "Target"))
                
                Set temporary = New ChilkatXml
                Set temporary = modifs(curNum)
                
                Select Case LCase(temporary.Tag)
                Case "range"
                    txtRangeX = getAttrib(temporary, "X")
                    txtRangeY = getAttrib(temporary, "Y")
                Case "Bounds"
                    txtBoundsL = getAttrib(temporary, "L")
                    txtBoundsT = getAttrib(temporary, "T")
                    txtBoundsR = getAttrib(temporary, "R")
                    txtBoundsB = getAttrib(temporary, "B")
                Case Else
                    For R = 0 To 3
                        chkColr(R).Value = Abs(reverseBool(getAttrib(getTag(lblColr(R), temporary), "Enable")))
                        lblMin(R) = Val(getAttrib(getTag(lblColr(R), temporary), "Min"))
                        lblMax(R) = Val(getAttrib(getTag(lblColr(R), temporary), "Max"))
                        lblPeriod(R) = Val(getAttrib(getTag(lblColr(R), temporary), "Period"))
                    Next R
                    
                    If Err <> 91 And Err <> 0 Then MsgBox Err.Description
                End Select
            End If
                
            End If
        End If
        
    Call disablex(fraModifier(Index))
    fraModifier(Index).Visible = True
    End If
End Sub

Private Sub cmdTimersOK_Click()
    Dim k As Integer
    For k = 0 To 3
        tim(k, curNum) = Val(txtTimer(k))
    Next k
    
    setBolds
    Call enableAll
    fraModifier(1).Visible = False
End Sub

Private Sub cmdSave_Click()
    'me.
End Sub

Private Sub cmdSet_Click()
    If lst(curLayout).ListIndex <> -1 Then
        If itemType(lst(curLayout).ItemData(lst(curLayout).ListIndex)) <> 2 Then
            With curObj
                .Width = Val(txtW)
                .height = Val(txtH)
                .Left = Val(txtL)
                .Top = Val(txtT)
            End With
            
            Call setCurrentSel
        Else
            With curObj
                .X2 = Val(txtW)
                .Y2 = Val(txtH)
                .x1 = Val(txtL)
                .y1 = Val(txtT)
            End With
            
            Call setCurrentSel
        End If
    End If
End Sub

Private Sub cmdStop_Click()
    Call stopAllVids
End Sub

Private Sub Form_Load()
Set clrSelTitle.TiesWithFore = lblSelTitle
Set clrUnselTitle.TiesWithFore = lblUnselTitle
Set clrSelDesc.TiesWithFore = lblSelDesc
Set clrUnselDesc.TiesWithFore = lblUnselDesc

On Error GoTo regg
    ReDim Preserve layoutCount(5) As Integer
    
    mnuRight.Visible = False
    mnuRight2.Visible = False
    
    Dim A As ChilkatXml
    Set A = New ChilkatXml
    Set mods = New ChilkatXml
    Set types = New ChilkatXml
    Set supports = New ChilkatXml
    
    'dun = True
    optScreen(1).Value = True
    Call optScreen_Click(1)
    
    Me.Caption = ":: MXM SKINNER " & App.Major & "." & App.Minor & " :: by geniusalz "
    
    delay(0) = 3000
    delay(1) = 3000
    delay(2) = 300
    
    condDesc(0, 0) = "Element will always show up"
    condDesc(1, 0) = "Element shows up if there is one or more displayable menu items not visible at the head of the item list"
    condDesc(2, 0) = "Element shows up if there is one or more displayable menu items not visible at the tail of the menu list"
    condDesc(3, 0) = "Element shows up if the currently selected menu item is NOT a sub menu entry"
    condDesc(4, 0) = "Element shows up if the currently selected menu item is a sub menu entry"
    condDesc(5, 0) = "Element shows up if the currently selected menu item requires passcode entry"
    condDesc(6, 0) = "Element shows up if the currently selected menu item does not require passcode entry"
    
    Dim qq As Integer
    For qq = 0 To 6
        condDesc(qq, 1) = lstCond.List(qq)
    Next qq
    
    cmbDescAlign.ListIndex = 1
    cmbTitleAlign.ListIndex = 0
    Load frmResources
    Load frmInfo
    Load frmColors
    'don = True
    
    Me.Show
    DoEvents
    
    Call movetoX(Pic, True)
    Call movetoX(fraNote, True)
    Call movetoX(fraCreate, True)
    Call movetoX(fraProperties, False)
    Call movetoX(fraLayout, False)
    'Call movetoX(fraBG, False)
    Call movetoX(fraElements, False)
    Call movetoX(fraPos, False)

    'Call movetoX(fraConfig, False)
    'Call movetoX(fraSkin, False)
    
    Exit Sub
regg:
    Call registerDll
    'MsgBox "ChilkatXML component was not registered.  Registering... Restart the program if you encounter problems"
    Resume Next
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Select Case MsgBox("Save before exit?", vbYesNoCancel)
    Case vbYes
        Randomize Timer
        If frmInfo.txtName = "" Then frmInfo.txtName = "myskin" & Int(Rnd * 350)
        cmdSave_Click
        
        If savePath = "" Then Cancel = True
    Case vbNo
        End
    Case vbCancel
        Cancel = True
    End Select
End Sub

'Private Sub lblSel_GotFocus()
    'lst(curlayout).SetFocus
'End Sub

Private Sub img_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseDown(Button, Shift, X / 15 + img(Index).Left, Y / 15 + img(Index).Top)
End Sub

Private Sub img_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseMove(Button, Shift, X / 15 + img(Index).Left, Y / 15 + img(Index).Top)
End Sub

Private Sub img_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseUp(Button, Shift, X / 15 + img(Index).Left, Y / 15 + img(Index).Top)
End Sub

Private Sub lst_GotFocus(Index As Integer)
    'Pic.SetFocus
End Sub

Private Sub lstMods_Click()
    lstTargets.Clear
    
    If lstMods.ListIndex > 0 Then
        Dim ii As Variant
        
        For Each ii In Split(getContent(lstMods.Text, supports), ",")
            lstTargets.AddItem ii
        Next ii
        
        lstTargets.ListIndex = 0
        
        lstTargets.Visible = True
    Else
        fraBounds.Visible = False
        fraColor.Visible = False
        fraRange.Visible = False
        lstTargets.Visible = False
    End If
End Sub

Private Sub lstTargets_Click()
    Dim ob As Object
    
    fraBounds.Visible = False
    fraRange.Visible = False
    fraColor.Visible = False
    
    Select Case getContent(lstMods.List(lstMods.ListIndex), types)
        Case "Bounds"
            fraBounds.Visible = True
        Case "Range"
            fraRange.Visible = True
        Case "Color"
            fraColor.Visible = True
    End Select
End Sub

Private Sub mnuAudio_Click()
    frmMusic.Show 1, Me
End Sub

Private Sub mnuBack_Click()
    Dim ind As Integer
    
    If lst(curLayout).ListIndex > 0 And lst(curLayout).ListCount > lockNum(curLayout) + 1 Then
        ind = lst(curLayout).ListIndex
        lst(curLayout).AddItem lst(curLayout).List(ind), lockNum(curLayout)
        lst(curLayout).ItemData(lockNum(curLayout)) = lst(curLayout).ItemData(lst(curLayout).ListIndex)
        lst(curLayout).RemoveItem lst(curLayout).ListIndex
    End If
    
    Call lst_Click(curLayout)
    
    Call reOrder
End Sub

Private Sub mnuBackward_Click()
    If lst(curLayout).ListIndex > lockNum(curLayout) And lst(curLayout).ListCount > lockNum(curLayout) + 1 Then
        lst(curLayout).AddItem lst(curLayout).List(lst(curLayout).ListIndex), lst(curLayout).ListIndex - 1
        lst(curLayout).ItemData(lst(curLayout).ListIndex - 2) = lst(curLayout).ItemData(lst(curLayout).ListIndex)
        lst(curLayout).RemoveItem lst(curLayout).ListIndex
    End If
    
    Call lst_Click(curLayout)
    
    Call reOrder
End Sub

Private Sub mnuColors_Click()
    frmColors.Show 1, Me
End Sub

Private Sub mnuCover_Click()
    mnuCover.Checked = Not mnuCover.Checked
End Sub

Private Sub mnuDelays_Click()
    frmDelays.Show 1, Me
End Sub

Private Sub mnuDelete_Click()
    Call Form_KeyDown(vbKeyDelete, 0)
End Sub

Private Sub mnuDeSel_Click()
    lst(curLayout).ListIndex = -1
    Call hideSels
End Sub

Private Sub mnuForward_Click()
    If lst(curLayout).ListIndex > -1 And lst(curLayout).ListCount > 1 And lst(curLayout).ListCount - lst(curLayout).ListIndex > 1 Then
        lst(curLayout).AddItem lst(curLayout).List(lst(curLayout).ListIndex), lst(curLayout).ListIndex + 2
        lst(curLayout).ItemData(lst(curLayout).ListIndex + 2) = lst(curLayout).ItemData(lst(curLayout).ListIndex)
        lst(curLayout).RemoveItem lst(curLayout).ListIndex
    End If
    
    Call lst_Click(curLayout)
    
    Call reOrder
End Sub

Private Sub mnuFront_Click()
    Dim ind As Integer
    
    If lst(curLayout).ListIndex < lst(curLayout).ListCount And lst(curLayout).ListCount > 1 Then
        ind = lst(curLayout).ListIndex
        lst(curLayout).AddItem lst(curLayout).List(ind)
        lst(curLayout).ItemData(lst(curLayout).ListCount - 1) = lst(curLayout).ItemData(ind)
        lst(curLayout).RemoveItem ind
    End If
    
    Call lst_Click(curLayout)
    
    Call reOrder
End Sub

Private Sub mnuInfo_Click()
    frmInfo.Show 1, Me
End Sub

Private Sub mnuLoad_Click()
End Sub

Private Sub mnuLoadBg_Click()
    On Error GoTo hec
    dialog.Filter = "JPG|*.jpg|BMP|*.bmp"
    dialog.ShowOpen

    If dialog.FileName <> "" Then
        bgBool = True
        Pic.Picture = LoadPicture(dialog.FileName)
        bgFile = dialog.FileName
    End If
    Exit Sub
hec:
    If Err <> 32755 Then MsgBox Err.Description
End Sub

Private Sub mnuLoadEvox_Click()
    If lstR.ListCount <> 0 Or lst(curLayout).ListCount <> 0 Or Pic.Picture <> 0 Then
        MsgBox "Before loading, (save your work) and restart the program to clear all memory"
        Exit Sub
    End If
    
    Me.MousePointer = vbHourglass
    
    skinPath = BrowseFolders(Me.hwnd, "Select skin folder to open")
    
    Call loadSkinEvox(skinPath)
End Sub

Private Sub mnuLoadMXM_Click()
    If lstR.ListCount <> 0 Or lst(curLayout).ListCount <> 0 Or Pic.Picture <> 0 Then
        MsgBox "Before loading, (save your work) and restart the program to clear all memory"
        Exit Sub
    End If
    
    Me.MousePointer = vbHourglass

    skinPath = BrowseFolders(Me.hwnd, "Select skin folder to open")
    
    Call loadSkin(skinPath)
End Sub

Private Sub mnuLoadUnleashX_Click()
    MsgBox "Not implemented yet"
End Sub

Private Sub mnuLocked_Click()
    Call unlockAll
    lockNum(curLayout) = lst(curLayout).ListIndex + 1
    Call lockFrom(lockNum(curLayout))
End Sub

Private Sub mnuModifier_Click(Index As Integer)
    Call cmdModifier_Click(Index)
End Sub

Private Sub mnuResource_Click()
    frmResources.height = 2897
    frmResources.optCustom.Value = False
    frmResources.optPreset.Value = False
    frmResources.Show 1, Me
End Sub

Private Sub mnuSave_Click()
End Sub

Private Sub mnuSaveMXM_Click()
    On Error Resume Next
    
    If frmInfo.txtName = "" Then
        MsgBox "Enter a name for the skin, and then click save again"
        frmInfo.Show 1, Me
        Exit Sub
    End If
    
    savePath = BrowseFolders(Me.hwnd, "Select an EMPTY folder to save your skin in")
    
    If savePath = "" Then Exit Sub
    
    If Right(savePath, 1) <> "\" Then savePath = savePath & "\"
    
    Dim mediaPath As String
    Dim musicPath As String
    
    'MsgBox savePath
    Call generateXML
    
    Open savePath & "MXM_Skin.xml" For Output As #5
        Print #5, XMLoutput
    Close #5
    
    Err.Clear
    
    MkDir savePath & "Media\"
    
    If Err <> 0 And Err <> 75 Then
        MsgBox Err.Description
        'Err.Raise Err
    End If
    
    Err.Clear
    MkDir savePath & "Music\"
    
    If Err <> 0 And Err <> 75 Then
        MsgBox Err.Description
        'Err.Raise Err
    End If
    
    mediaPath = savePath & "Media\"
    musicPath = savePath & "Music\"
    
    Dim j As Integer
    
    For j = 0 To lstR.ListCount - 1
        If resCustom(j) = True Then
            If res(j) <> mediaPath & trimtofile(res(j)) Then
                Err.Clear
                
                'If LCase(Right(res(j), 3)) <> "xbe" Then
                FileCopy res(j), mediaPath & trimtofile(res(j))

                If Err <> 0 Then
                    MsgBox Err.Description
                    Err.Raise Err
                    Exit Sub
                End If
            End If
        End If
    Next j
    
    If bgBool = True Then
        FileCopy bgFile, mediaPath & trimtofile(bgFile)
    End If
    
    With frmMusic
        For j = 0 To .lstMusic.ListCount - 1
            If music(.lstMusic.ItemData(j)) <> musicPath & trimtofile(music(.lstMusic.ItemData(j))) Then
                Err.Clear
                FileCopy music(.lstMusic.ItemData(j)), musicPath & trimtofile(music(.lstMusic.ItemData(j)))
                
                If Err <> 0 Then
                    MsgBox Err.Description
                    Err.Raise Err
                    Exit Sub
                End If
            End If
        Next j
    End With
    
    frmInstructions.Show 1, Me
End Sub

Private Sub mnuSaveUnleashX_Click()
    'On Error Resume Next
    
    If frmInfo.txtName = "" Then
        MsgBox "Enter a name for the skin, and then click save again"
        frmInfo.Show 1, Me
        Exit Sub
    End If
    
    savePath = BrowseFolders(Me.hwnd, "Select an EMPTY folder to save your skin in")
    
    If savePath = "" Then Exit Sub
    
    If Right(savePath, 1) <> "\" Then savePath = savePath & "\"
    
    Dim mediaPath As String
    
    'MsgBox savePath
    Call generateXMLUX
    
    Open savePath & "Skin.xml" For Output As #5
        Print #5, XMLoutput
    Close #5
    
    Err.Clear
    
    MkDir savePath & "Media\"
    
    If Err <> 0 And Err <> 75 Then
        MsgBox Err.Description
        'Err.Raise Err
    End If
    
    Err.Clear
    
    mediaPath = savePath & "Media\"
    
    Dim j As Integer
    
    For j = 0 To lstR.ListCount - 1
        If resCustom(j) = True Then
            If res(j) <> mediaPath & trimtofile(res(j)) Then
                Err.Clear
                
                'If LCase(Right(res(j), 3)) <> "xbe" Then
                FileCopy res(j), mediaPath & trimtofile(res(j))

                If Err <> 0 Then
                    MsgBox Err.Description
                    Err.Raise Err
                    Exit Sub
                End If
            End If
        End If
    Next j
    
    If bgBool = True Then
        FileCopy bgFile, mediaPath & trimtofile(bgFile)
    End If
    
    frmInstructions.Show 1, Me

End Sub

Private Sub mnuUnloadBg_Click()
    Set Pic.Picture = Nothing
    bgBool = False
End Sub

Private Sub mnuUnlock_Click()
    Call unlockAll
End Sub

Private Sub mnuView_Click()
    generateXML
    MsgBox XMLoutput
End Sub

Private Sub mxm_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseDown(Button, Shift, X / 15 + mxm(Index).Left, Y / 15 + mxm(Index).Top)
End Sub

Private Sub mxm_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseMove(Button, Shift, X / 15 + mxm(Index).Left, Y / 15 + mxm(Index).Top)
End Sub

Private Sub mxm_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseUp(Button, Shift, X / 15 + mxm(Index).Left, Y / 15 + mxm(Index).Top)
End Sub

Private Sub lblResize_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

End Sub

Private Sub lblResize_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

End Sub

Private Sub lblResize1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Pic.Enabled = False Then Exit Sub
    oldx = X / 15
    oldy = Y / 15
End Sub

Private Sub lblResize1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Pic.Enabled = False Then Exit Sub
    If Button = 1 Then
        With curObj
            .x1 = .x1 - oldx + X / 15
            .y1 = .y1 - oldy + Y / 15
            
            If .x1 < 0 Then .x1 = 0
            If .x1 > 640 Then .x1 = 640
            If .y1 < 0 Then .y1 = 0
            If .y1 > 480 Then .y1 = 480
            setPosLine
        End With
        
        'oldx = x / 15
        'oldy = Y / 15
        
        setSelLine curObj
    End If
End Sub

Private Sub lblResize2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Pic.Enabled = False Then Exit Sub
    oldx = X / 15
    oldy = Y / 15
End Sub

Private Sub lblResize2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Pic.Enabled = False Then Exit Sub
    If Button = 1 Then
        With curObj
            .X2 = .X2 - oldx + X / 15
            .Y2 = .Y2 - oldy + Y / 15
            
            If .X2 < 0 Then .X2 = 0
            If .X2 > 640 Then .X2 = 640
            If .Y2 < 0 Then .Y2 = 0
            If .Y2 > 480 Then .Y2 = 480
            setPosLine
            
            'oldx = x / 15
            'oldy = Y / 15
            lblPos.Caption = "X: " & X / 15 + fraResize2.Left & "    Y: " & Y / 15 + fraResize2.Top
        End With
        
        setSelLine curObj
    End If
End Sub

Private Sub lblSel_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Pic.Enabled = False Then Exit Sub
    If Button = 2 Then
        'lst(curlayout).ListIndex = -1
        'hideSels
        
        Me.PopupMenu mnuRight
    End If
    
    oldx = X / 15
    oldy = Y / 15
End Sub

Private Sub lst_Click(Index As Integer)
    Debug.Print "Need to hide sels, but dont use hidesels function"
    'Debug.Print curObj.Name
    'Call hideSels
    setCurrentSel
    setBolds
End Sub


Private Sub lstR_Click()
    If lstR.Text <> "" Then
        vidPreview.FileName = res(lstR.ListIndex)
    End If
End Sub

Private Sub optBox_Click()
    hideSels
    Call dispControls
End Sub

Private Sub optImg_Click()
    hideSels
    Call dispControls
End Sub

Private Sub optLine_Click()
    hideSels
    Call dispControls
End Sub

'Private Sub optVid_Click()
    'vidPreview.FileName = ""
    'vidFile = ""
    'Call dispControls
'End Sub

Private Sub optMxm_Click()
    hideSels
    Call dispControls
End Sub

Private Sub optScreen_Click(Index As Integer)
    curLayout = Index
    
    lst(curLayout).ListIndex = -1
    lst(curLayout).Visible = True
    lst(curLayout).ZOrder 0
    Call hideSels
    
    Dim i As Integer
    Dim k As Integer
    
    For k = 0 To 5
        For i = 0 To lst(k).ListCount - 1
            If k = curLayout Then obje(lst(curLayout).ItemData(i)).Visible = True Else obje(lst(k).ItemData(i)).Visible = False
        Next i
    Next k
    
    setLayoutBolds
End Sub

Private Sub optText_Click()
    hideSels
    Call dispControls
End Sub

Private Sub Pic_KeyDown(KeyCode As Integer, Shift As Integer)
    If fraSel.Visible = True Then
        With curObj
            Select Case KeyCode
                Case vbKeyLeft
                    .Left = .Left - 1 - Abs(Shift) * 8
                Case vbKeyRight
                    .Left = .Left + 1 + Abs(Shift) * 8
                Case vbKeyUp
                    .Top = .Top - 1 - Abs(Shift) * 8
                Case vbKeyDown
                    .Top = .Top + 1 + Abs(Shift) * 8
            End Select
            
            setCurrentSel
        End With
    End If
End Sub

'Loads objects when drawn, and sets all properties of the object
Private Sub Pic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Pic.Enabled = False Then Exit Sub
    'LockWindowUpdate Pic.hwnd
    'For moving stuff
    oldx = X
    oldy = Y
    
    'If the left or right button is held down
    If Button = 1 Or Button = 2 Then
        vidPreview.Stop
        If isInvalid = True Then Exit Sub
        'don = False
        
        'Unselects
        Call hideSels
        lst(curLayout).ListIndex = -1
        
        'Checks for invalid values
        'Loads the object
        'Sets curObj: current object
        If optBox.Value = True Then
            'Box
            'lst(curLayout).AddItem numb + 1 & " Box: Alpha " & txtAlpha
            lst(curLayout).AddItem "Box: Alpha " & txtAlpha
            Load box(numb + 1)
            Set curObj = box(numb + 1)
        ElseIf optLine.Value = True Then
            'Line
            lst(curLayout).AddItem "Line"
            Load lin(numb + 1)
            Set curObj = lin(numb + 1)
            drawl = True
        ElseIf optImg.Value = True Then
            'Image
            lst(curLayout).AddItem "Image: " & lstR.Text
            
            'Stores the resource name in an array
            ReDim Preserve imgRes(numb + 1) As String
            imgRes(numb + 1) = lstR.Text
                
            'Loads either an image object or a mediaplayer (video) object
            If isPic(res(lstR.ListIndex)) Then
                Load img(numb + 1)
                Set curObj = img(numb + 1)
            ElseIf isPng(res(lstR.ListIndex)) Then
                Load png(numb + 1)
                Set curObj = png(numb + 1)
            Else
                Load vid(numb + 1)
                Set curObj = vid(numb + 1)
            End If
        ElseIf optText.Value = True Then
            'Text
            lst(curLayout).AddItem "Text: " & txtText
            Load txt(numb + 1)
            Set curObj = txt(numb + 1)
        ElseIf optMxm.Value = True Then
            lst(curLayout).AddItem "Menu"
            Load mxm(numb + 1)
            Set curObj = mxm(numb + 1)
        Else
            Call selClick(X, Y)
            
            If Button = 2 And (Not (curObj Is Nothing)) Then
                optBox.Value = False
                optLine.Value = False
                optImg.Value = False
                optText.Value = False
                optMxm.Value = False
                
                mnuLocked.Checked = itemLocked(lst(curLayout).ItemData(lst(curLayout).ListIndex))
                Me.PopupMenu mnuRight
            End If
                
            Exit Sub
        End If
        
        'Means that an object is being drawn; checked in mouseMove to resize object
        drawing = True
        'Increments total number of objects
        numb = numb + 1
        
        'Stores the item type
        ReDim Preserve itemType(numb) As Integer
        ReDim Preserve itemLocked(numb) As Boolean
        ReDim Preserve itemLayout(numb) As Integer
        ReDim Preserve tim(3, numb) As Long
        ReDim Preserve cond(numb) As String
        lst(curLayout).ItemData(lst(curLayout).ListCount - 1) = numb
        ReDim Preserve obje(numb) As Object
        ReDim Preserve modifs(numb) As ChilkatXml
        ReDim Preserve mxmSet(numb) As mxmSettings
        ReDim Preserve txtCustom(numb) As Boolean
        ReDim Preserve xval(numb) As Integer
        ReDim Preserve yval(numb) As Integer
        ReDim Preserve alph(numb) As Integer
        
        Set obje(numb) = curObj
        
        itemLayout(numb) = curLayout
        itemLocked(numb) = False
        layoutCount(curLayout) = layoutCount(curLayout) + 1
        setLayoutBolds
        
        'Sets all properties of the current object
        With curObj
            If optLine.Value = True Then
                'To position the line being drawn
                xval(numb) = X
                yval(numb) = Y
                .x1 = X
                .y1 = Y
                drawing = False
                drawl = True
            Else
                'To position all other types of objects
                .Left = X
                .Top = Y
                .Width = 1
                .height = 1
                
                xval(numb) = X
                yval(numb) = Y
                alph(numb) = Val(txtAlpha)
            End If
            
            If optBox.Value = True Then
                itemType(numb) = 1
                box(numb).BackColor = clrBoxFill.BackColor
                box(numb).BorderColor = clrBoxBorder.BackColor
            ElseIf optLine.Value = True Then
                itemType(numb) = 2

                .ZOrder (0)
                .Visible = True
            ElseIf optImg.Value = True Then '
                itemType(numb) = 3
            ElseIf optText.Value = True Then
                itemType(numb) = 4
            ElseIf optMxm.Value = True Then
                'MXM menu
                itemType(numb) = 5
            End If
        End With
        
        Call updateControls(curObj, numb)
        
        curObj.ZOrder 0

        If optLine.Value = False Then
            curObj.Visible = True
            setPos
        Else
            setPosLine
        End If
    End If
End Sub

'Resizes objects being drawn as the mouse moves
Private Sub Pic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Pic.Enabled = False Then Exit Sub
    
    lblPos.Caption = "X: " & X & "    Y: " & Y
    
    If Button = 1 Then ' And don = True Then
        'If an object is being drawn
        If drawing = True Then 'And (oldx <> X Or oldy <> Y) Then
            With curObj
                Dim newWidth As Integer
                Dim newHeight As Integer
                Dim newTop As Integer
                Dim newLeft As Integer
                
                newWidth = Abs(xval(numb) - X)
                
                'Same, but for Y
                newHeight = Abs(yval(numb) - Y)
                
                If Shift = 1 Then
                    If newWidth < newHeight Then
                        newHeight = newWidth
                    Else
                        newWidth = newHeight
                    End If
                End If
                
                If Y > yval(numb) Then
                    newTop = yval(numb)
                Else
                    newTop = yval(numb) - newHeight
                End If
                
                If X > xval(numb) Then
                    newLeft = xval(numb)
                Else
                    newLeft = xval(numb) - newWidth
                End If
                
                If newWidth <> 0 And newWidth <> .Width Then .Width = newWidth
                If newHeight <> 0 And newHeight <> .height Then .height = newHeight
                If newLeft <> 0 And newLeft <> .Left Then .Left = newLeft
                If newTop <> 0 And newTop <> .Top Then .Top = newTop
                
                oldx = X
                oldy = Y
                
                'Debug.Print X, Y
                
                'Sets values for the position textboxes at the right
                setPos
                lblPos.Caption = "X: " & X & "    Y: " & Y
            End With
        ElseIf drawl = True Then
            'Drawing lines
            With curObj
                Dim newX2 As Integer
                Dim newY2 As Integer
                newX2 = X
                newY2 = Y
                
                If Shift = 1 Then
                    'if
                End If
                
                .X2 = newX2
                .Y2 = newY2
                
                setPosLine
                lblPos.Caption = "X: " & X & "    Y: " & Y
            End With
        End If
    End If
    
    If Button = 1 And fraSel.Visible = True And (oldx <> X Or oldy <> Y) Then
        'If an object is being moved
        With curObj
            If oldx <> X Or oldy <> Y Then
                .Left = .Left + X - oldx
                .Top = .Top + Y - oldy
                setPos
                lblPos.Caption = "X: " & X & "    Y: " & Y
            
                oldx = X
                oldy = Y
            End If
        End With
        
        setSel curObj
    End If
    
End Sub
    
'When the user leaves the mouse button; hides the drawing box and shows the
'object being drawn
Private Sub Pic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Pic.Enabled = False Then Exit Sub
        Pic.MousePointer = 0
        
        If Button = 1 Then
            If drawing = True Then
                Call setSel(curObj)
                Call showEditControls(curObj, numb)
            ElseIf drawl = True Then
                Call setSelLine(curObj)
                Call showEditControls(curObj, numb)
            End If
            
            drawing = False
            drawl = False
        Else
            'Call hideSels
        End If
        
        'Unselects all "create" option buttons
        optBox.Value = False
        optLine.Value = False
        optImg.Value = False
        optText.Value = False
        optMxm.Value = False
        
        Pic.MousePointer = 0
        
        If optLine.Value = True Or optBox.Value = True Or optMxm.Value = True Or optImg.Value = True Or optText.Value = True Then
        'Call dispControls 'Shows appropriate property controls on the bottom
    End If
End Sub

'Adds the given string to the XMLoutput string
Private Sub xml(inp As String)
    Dim o As Integer
    
    'Reduces 1 tab if a tag is closing
    If Left$(inp, 2) = "</" Then
        numTabs = numTabs - 1
    End If
    
    'Adds required number of tabs to the output string
    For o = 1 To numTabs
        XMLoutput = XMLoutput & vbTab
    Next o
    
    'If a tag is opened and not closed on the current line
    If InStr(1, inp, "<") <> 0 And Not (InStr(1, inp, "</") <> 0 Or InStr(1, inp, "/>") <> 0) Then
        'This will indent the next line
        numTabs = numTabs + 1
    End If

    XMLoutput = XMLoutput & inp & vbCrLf
End Sub

'Turns something like 100 (%) to "FF", or 0 to "00"
Function makeAlpha(inp As Integer) As String
    Dim w As Integer
    w = inp * 2.55
    
    makeAlpha = Hex$(w)
    
    Do While Len(makeAlpha) < 2
        makeAlpha = "0" & makeAlpha
    Loop
End Function

Private Function makecolor(ByVal lngColor As Long) As String
  Dim sHex As String
  Dim sReturn As String
  sHex = Right$("000000" & Hex(lngColor), 6)
  sReturn = Mid$(sHex, 5, 2) & Mid$(sHex, 3, 2) & Mid$(sHex, 1, 2)
  makecolor = sReturn
End Function

Sub setSel(oBj As Object)
    'dun = False
    
    With oBj
        Call setPos
        
        fraSel.Top = .Top + .height - 14
        fraSel.Left = .Left + .Width - 14
        fraSel.Visible = True
        fraSel.ZOrder (0)
    End With
    
    'dun = True
    
    setBolds
End Sub

Sub setCurrentSel()
    Debug.Print "selected"; lst(curLayout).ListIndex
    
    If lst(curLayout).ListIndex >= lockNum(curLayout) Then
        Set curObj = obje(lst(curLayout).ItemData(lst(curLayout).ListIndex))
        
        If itemType(lst(curLayout).ItemData(lst(curLayout).ListIndex)) = 2 Then
            'Selects a line
            setSelLine curObj
        Else
            'Selects an object
            setSel curObj
        End If
        
        Call showEditControls(curObj, lst(curLayout).ItemData(lst(curLayout).ListIndex))
        cmdApply.Visible = True
    Else
        Set curObj = Nothing
        hideSels
    End If
End Sub

Sub setSelLine(oBj As Object)
    With oBj
        'Positions the first small yellow box at the first point
        fraResize1.Top = .y1 - 5
        fraResize1.Left = .x1 - 5
        fraResize1.Visible = True
        fraResize1.ZOrder (0)
        
        Call setPosLine
        
        'Positions the second small yellow box at the second point
        fraResize2.Top = .Y2 - 5
        fraResize2.Left = .X2 - 5
        fraResize2.Visible = True
        fraResize2.ZOrder (0)
    End With
End Sub

'Deletes the item
Sub delItem(numr As Integer)
    Unload curObj
    lst(curLayout).RemoveItem (numr)
End Sub

Sub dispControls()
    Call boxVis(optBox.Value)
    Call lineVis(optLine.Value)
    Call imgVis(optImg.Value)
    Call txtVis(optText.Value)
    Call MxmVis(optMxm.Value)
    'fraBox.Visible = optBox.Value
    'fraMxm.Visible = optMxm.Value
    'fraImg.Visible = optImg.Value
    'fraText.Visible = optText.Value
    'fraLine.Visible = optLine.Value
    
    Pic.MousePointer = 2
End Sub

'Controls to be visible when drawing an object
Private Sub boxVis(inp As Boolean)
'    lblFillColor.Visible = inp
'    lblF.Visible = inp
'    cmdClearF.Visible = inp
'    cmdClearL.Visible = inp
'    fColor.Visible = inp
'    lblAlpha.Visible = inp
'    txtAlpha.Visible = inp
'
'    fraBox.Visible = inp
'    fraShared.Visible = inp
    fraBox.Visible = inp
End Sub

Private Sub lineVis(inp As Boolean)
'    lblBorderColor.Visible = inp
'    lColor.Visible = inp
'    lblL.Visible = inp
'    fraShared.Visible = inp
    fraLine.Visible = inp
End Sub

Private Sub imgVis(inp As Boolean)
    fraImg.Visible = inp
End Sub

Private Sub txtVis(inp As Boolean)
'    lblText.Visible = inp
'    txtText.Visible = inp
'    cmdFont.Visible = inp
'
    fraText.Visible = inp
End Sub

Private Sub MxmVis(inp As Boolean)
    fraMxm.Visible = inp
End Sub

Sub hideSels()
    fraSel.Visible = False
    fraResize1.Visible = False
    fraResize2.Visible = False
    cmdApply.Visible = False
    Call boxVis(False)
    Call lineVis(False)
    Call imgVis(False)
    Call txtVis(False)
    Call MxmVis(False)

    'Call dispControls
End Sub

'Passes mouse events onto the picturebox; i.e. makes all text elements click-through-able
Private Sub txt_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseDown(Button, Shift, X / 15 + txt(Index).Left, Y / 15 + txt(Index).Top)
End Sub

Private Sub txt_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseMove(Button, Shift, X / 15 + txt(Index).Left, Y / 15 + txt(Index).Top)
End Sub

Private Sub txt_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call Pic_MouseUp(Button, Shift, X / 15 + txt(Index).Left, Y / 15 + txt(Index).Top)
End Sub

'Checks which object the user has clicked on, and selects it
Private Sub selClick(X As Single, Y As Single)
    Dim p As Integer
    
    For p = lst(curLayout).ListCount - 1 To 0 Step -1
        If itemType(lst(curLayout).ItemData(p)) <> 2 Then
            If onElement(X, Y, obje(lst(curLayout).ItemData(p))) = True And itemLayout(lst(curLayout).ItemData(p)) = curLayout And itemLocked(lst(curLayout).ItemData(p)) = False Then
                lst(curLayout).ListIndex = p
                Set curObj = obje(lst(curLayout).ItemData(lst(curLayout).ListIndex))
                'Call lst_Click(curLayout)
                Exit Sub
            End If
        Else
            If onElementLine(X, Y, obje(lst(curLayout).ItemData(p))) = True And itemLayout(lst(curLayout).ItemData(p)) = curLayout And itemLocked(lst(curLayout).ItemData(p)) = False Then
                lst(curLayout).ListIndex = p
                Set curObj = obje(lst(curLayout).ItemData(lst(curLayout).ListIndex))
                'Call lst_Click(curLayout)
                Exit Sub
            End If
        End If
    Next p
End Sub

'Returns whether the x and y values lie inside an object
Function onElement(X As Single, Y As Single, ele As Object) As Boolean
    If X >= ele.Left And X <= ele.Left + ele.Width And Y >= ele.Top And Y <= ele.Top + ele.height Then
        onElement = True
    Else
        onElement = False
    End If
End Function

'Returns whether the x and y values lie near the endpoints of a line
Function onElementLine(X As Single, Y As Single, ele As Object) As Boolean
    
    If ((Abs(X - ele.x1) < 7 And Abs(Y - ele.y1) < 7)) Or ((Abs(X - ele.X2) < 7 And Abs(Y - ele.Y2) < 7)) Then
        onElementLine = True
    End If
    
End Function

'Selects all text inside the box
Private Sub txtH_gotfocus()
    Call sel(txtH)
End Sub

Private Sub txtL_gotfocus()
    Call sel(txtL)
End Sub

Private Sub txtT_gotfocus()
    Call sel(txtT)
End Sub

Sub sel(oBj As Object)
    oBj.SelStart = 0
    oBj.SelLength = Len(oBj)
End Sub

Private Sub txtTimer_Change(Index As Integer)
    If (Val(txtTimer(0)) > 0 And Val(txtTimer(0)) < 30) Or (Val(txtTimer(1)) > 0 And Val(txtTimer(1)) < 30) Or (Val(txtTimer(2)) > 0 And Val(txtTimer(2)) < 30) Or (Val(txtTimer(3)) > 0 And Val(txtTimer(3)) < 30) Then
        lblTimersMsg = "The values are in milliseconds.  i.e. 1s = 1000 ms.  Double-check your values"
    Else
        lblTimersMsg = ""
    End If
End Sub

Private Sub txtTimer_GotFocus(Index As Integer)
    Call sel(txtTimer(Index))
End Sub

Private Sub txtTimer_KeyPress(Index As Integer, KeyAscii As Integer)
    KeyAscii = numsonly(KeyAscii)
End Sub

Private Sub txtW_gotfocus()
    Call sel(txtW)
End Sub

'Returns the filename from a complete path
Function trimtofile(inp As String) As String
    Dim B As Integer
    
    Do While InStr(B + 1, inp, "\") <> 0
        B = InStr(B + 1, inp, "\")
    Loop
    
    trimtofile = Mid(inp, B + 1, Len(inp) - B)
End Function

'Sets the z-order of elements according to the listbox
Sub reOrder()
    Dim j As Integer
    
    For j = 0 To lst(curLayout).ListCount - 1
        obje(lst(curLayout).ItemData(j)).ZOrder 0
    Next j
End Sub

'Converts true/false to strings
Function bool(inpu As Boolean) As String
    If inpu Then bool = "True" Else bool = "False"
End Function

'Converts a true/false to "On"/"Off"
Function onOff(inpu As Boolean) As String
    If inpu Then onOff = "On" Else onOff = "Off"
End Function

'Reverse of the 2 functions above
Function reverseBool(inp As String) As Boolean
    If LCase(inp) = "true" Then reverseBool = True Else reverseBool = False
End Function

Function reverseOnOff(inp As String) As Boolean
    If LCase(inp) = "on" Then reverseOnOff = True Else reverseOnOff = False
End Function

'Updates position values on the right
Sub setPosLine()
    With curObj
        lblLeft.Caption = "X1"
        lblTop.Caption = "Y1"
        lblHeight.Caption = "Y2"
        lblWidth.Caption = "X2"
        
        txtH = .Y2
        txtL = .x1
        txtT = .y1
        txtW = .X2
    End With
End Sub

'Updates position values on the right
Sub setPos()
    With curObj
        lblLeft.Caption = "Left"
        lblTop.Caption = "Top"
        lblHeight.Caption = "Height"
        lblWidth.Caption = "Width"
        txtH = .height
        txtL = .Left
        txtT = .Top
        txtW = .Width
    End With
End Sub

Sub makeElement(x1 As Variant, y1 As Variant, w1 As Variant, h1 As Variant, type1 As Integer, layoutNum As Integer)
    If type1 = 1 Then
        lst(curLayout).AddItem "Box: Alpha " & getAlpha(getContent("Color", cnod))
        Load box(numb + 1)
        Set curObj = box(numb + 1)
    ElseIf type1 = 2 Then
        lst(curLayout).AddItem "Line"
        Load lin(numb + 1)
        Set curObj = lin(numb + 1)
    ElseIf type1 = 3 Then
        lst(curLayout).AddItem "Image: " & resName
        resFile = resF(resName)
        
        ReDim Preserve imgRes(numb + 1) As String
        
        Select Case Left(resFile, 2)
            Case "::"
                imgRes(numb + 1) = Right(resFile, Len(resFile) - 2)
            Case Else
                imgRes(numb + 1) = resName
        End Select
        
        If isPic(resFile) Then
            Load img(numb + 1)
            Set curObj = img(numb + 1)
        ElseIf isPng(resFile) Then
            Load png(numb + 1)
            Set curObj = png(numb + 1)
        Else
            Load vid(numb + 1)
            Set curObj = vid(numb + 1)
        End If
    ElseIf type1 = 4 Then
        If resName = "" Then
            lst(curLayout).AddItem "Text: " & getContent("constant", cnod)
        Else
            lst(curLayout).AddItem "Text: " & resName
        End If
            
        Load txt(numb + 1)
        Set curObj = txt(numb + 1)
    ElseIf type1 = 5 Then
        lst(curLayout).AddItem "Menu"
        Load mxm(numb + 1)
        Set curObj = mxm(numb + 1)
    End If
    
    numb = numb + 1
    
    ReDim Preserve itemType(numb) As Integer
    ReDim Preserve itemLocked(numb) As Boolean
    ReDim Preserve itemLayout(numb) As Integer
    ReDim Preserve cond(numb) As String
    ReDim Preserve tim(3, numb) As Long
    ReDim Preserve modifs(numb) As ChilkatXml
    lst(curLayout).ItemData(lst(curLayout).ListCount - 1) = numb
    ReDim Preserve obje(numb) As Object
    ReDim Preserve txtCustom(numb) As Boolean
    Set obje(numb) = curObj
    
    itemLayout(numb) = curLayout
    itemLocked(numb) = False
    layoutCount(curLayout) = layoutCount(curLayout) + 1
    setLayoutBolds
    cond(numb) = getContent("Condition", cnod)
    
    tim(0, numb) = Val(getContentInTag(cnod, "Delay", "timer"))
    tim(1, numb) = Val(getContentInTag(cnod, "CycleOn", "timer"))
    tim(2, numb) = Val(getContentInTag(cnod, "CycleOff", "timer"))
    tim(3, numb) = Val(getContentInTag(cnod, "Lifetime", "timer"))
    
    Set modifs(numb) = getTag("Modifier", cnod)
    If modifs(numb).NumChildren < 1 Then Set modifs(numb) = Nothing
    
    With curObj
        If type1 = 2 Then
            .x1 = Val(x1)
            .X2 = Val(w1)
            .y1 = Val(y1)
            .Y2 = Val(h1)
        Else
            .Left = Val(x1)
            .Top = Val(y1)
            .Width = Val(w1)
            .height = Val(h1)
            
            ReDim Preserve alph(numb) As Integer
            ReDim Preserve mxmSet(numb) As mxmSettings
            
            alph(numb) = getAlpha(getContent("Color", cnod))
        End If
        
        If type1 = 1 Then
            If getContent("Color", cnod) = "" Then
                .FillStyle = 1
            Else
                .FillStyle = 0
                .FillColor = getColor(getContent("Color", cnod))
            End If
            
            If getContent("BorderColor", cnod) = "" Then
                .BorderStyle = 0
            Else
                .BorderStyle = 1
                .BorderColor = getColor(getContent("BorderColor", cnod))
            End If
            
            itemType(numb) = 1
        ElseIf type1 = 2 Then
            .BorderColor = getColor(getContent("Color", cnod))
            itemType(numb) = 2
        ElseIf type1 = 3 Then
            If isPic(resFile) Then
                If Left(Right(resFile, 4), 1) = "." And LCase(Right(resFile, 3)) <> "xbe" Then
                    .Picture = LoadPicture(resFile)
                Else
                    .Picture = imgCustom.Picture
                End If
            ElseIf isPng(resFile) Then
                .setFile resFile
            Else
                .FileName = resFile
            End If
            
            itemType(numb) = 3
        ElseIf type1 = 4 Then
            .Caption = resName
            .ForeColor = getColor(getContent("TextColor", cnod)) Or getColor(getContent("Color", cnod))
            
            If getContent("Constant", cnod) <> "" Then
                txtCustom(numb) = True
                .Caption = getContent("Constant", cnod)
            End If
            
            itemType(numb) = 4
        ElseIf type1 = 5 Then
            itemType(numb) = 5
            
            With mxmSet(numb)
                .numItems = Val(getContent("numitems", cnod))
                .scrollFactor = Val(getContent("scrollfactor", cnod))
                .smoothScrolling = reverseBool(getContent("smoothscroll", cnod))
                .showDesc = reverseBool(getContent("drawsecondary", cnod))
                .thumbVis = reverseBool(getContent("thumbnails", cnod))
                
                Set ccnod = getTag("primary", cnod)
                If getContent("justifyx", ccnod) <> "" Then .titleAlign = getContent("justifyx", ccnod) Else .descAlign = "left"
                
                Set ccnod = getTag("secondary", cnod)
                If Not (ccnod Is Nothing) Then
                    If getContent("justifyx", ccnod) <> "" Then .descAlign = getContent("justifyx", ccnod) Else .descAlign = "right"
                End If
                    
                Set ccnod = getTag("selection", cnod)
                If Not (ccnod Is Nothing) Then
                    .doGlow = reverseBool(getContent("doglow", ccnod))
                    .selTitleColor = hextodec(Right(getContent("textcolor", ccnod), 6))
                    
                    
                    Set cccnod = getTag("secondary", ccnod)
                    If Not (cccnod Is Nothing) Then
                        .selDescColor = hextodec(Right(getContent("textcolor", cccnod), 6))
                    Else
                        .selDescColor = RGB(200, 200, 200)
                    End If
                Else
                    .selDescColor = RGB(200, 200, 200)
                    .selTitleColor = RGB(255, 255, 255)
                End If
                
                Set ccnod = getTag("unselitem", cnod)
                If Not (ccnod Is Nothing) Then
                    .unSelTitleColor = hextodec(Right(getContent("textcolor", ccnod), 6))
                    
                    Set cccnod = getTag("secondary", ccnod)
                    If Not (cccnod Is Nothing) Then
                        .unSelDescColor = hextodec(Right(getContent("textcolor", cccnod), 6))
                    Else
                        .unSelDescColor = RGB(150, 150, 150)
                    End If
                Else
                    .unSelDescColor = RGB(150, 150, 150)
                    .unSelTitleColor = RGB(150, 150, 150)
                End If
            End With
        End If
        
        .Visible = True
        .ZOrder (0)
        
        If type1 = 3 And isPic(resFile) = False Then
            Pic.Refresh
        End If
    End With
End Sub

Sub drawScreen()
    Dim layoutNum As Integer
    curLayout = getLayoutNum(LCase(getAttrib(nod, "Screen")))
    Dim t As Integer
        
    'Goes through all layoutelements
    For t = 1 To nod.NumChildren
        Set cnod = nod.GetChild(t - 1)
        
        Set xmltag = getTag("Pos", cnod)
            
        'Checks the type of layout element
        Select Case LCase(getAttrib(cnod, "Type"))
            Case "image"
                resName = ""
                resName = getAttrib(cnod, "Source")
                
                If Not (xmltag Is Nothing) Then
                    Call makeElement(Val(getAttrib(xmltag, "x")) + Val(getAttrib(xmltag, "l")), Val(getAttrib(xmltag, "y")) + Val(getAttrib(xmltag, "t")), Val(getAttrib(xmltag, "w")), Val(getAttrib(xmltag, "h")), 3, curLayout)
                End If
               
            Case "box"
                If Not (xmltag Is Nothing) Then
                    Call makeElement(Val(getAttrib(xmltag, "x")) + Val(getAttrib(xmltag, "l")), Val(getAttrib(xmltag, "y")) + Val(getAttrib(xmltag, "t")), Val(getAttrib(xmltag, "w")), Val(getAttrib(xmltag, "h")), 1, curLayout)
                End If

            Case "line"
                If Not (xmltag Is Nothing) Then
                    Call makeElement(getAttrib(xmltag, "X1"), getAttrib(xmltag, "Y1"), getAttrib(xmltag, "X2"), getAttrib(xmltag, "Y2"), 2, curLayout)
                End If
            Case "text"
                resName = getAttrib(cnod, "Source")
                
                If Not (xmltag Is Nothing) Then
                    Call makeElement(getAttrib(xmltag, "X") + getAttrib(xmltag, "L"), getAttrib(xmltag, "Y") + getAttrib(xmltag, "T"), getAttrib(xmltag, "W"), getAttrib(xmltag, "H"), 4, curLayout)
                End If
            Case "menu"
                resName = getAttrib(cnod, "Source")
                
                If Not (xmltag Is Nothing) Then
                    Call makeElement(getAttrib(xmltag, "X") + getAttrib(xmltag, "L"), getAttrib(xmltag, "Y") + getAttrib(xmltag, "T"), getAttrib(xmltag, "W"), getAttrib(xmltag, "H"), 5, curLayout)
                End If
        End Select
    Next t
End Sub

Function getContentInTag(xmll As ChilkatXml, attr1 As String, tagg As String) As String
    Dim p As Integer
    Dim xm2 As ChilkatXml
            
    For p = 1 To xmll.NumChildren
        Set xm2 = xmll.GetChild(p - 1)
        
        If xm2.NumAttributes > 0 Then
            
            If LCase(xm2.GetAttributeValue(0)) = LCase(attr1) And LCase(tagg) = LCase(xm2.Tag) Then
                getContentInTag = xm2.Content
            End If
        End If
    Next p
End Function

Function getAttrib(xmll As ChilkatXml, attr1 As String) As String
    Dim p As Integer
    
    For p = 1 To xmll.NumAttributes
        If LCase(xmll.GetAttributeName(p - 1)) = LCase(attr1) Then
            getAttrib = xmll.GetAttributeValue(p - 1)
        End If
    Next p
End Function

'Case insensitive search in specified node for the content of a specified tag
Function getContent(inp As String, xm1 As ChilkatXml) As String
    Dim o As Integer
    Dim xm2 As ChilkatXml
    
    For o = 1 To xm1.NumChildren
        Set xm2 = xm1.GetChild(o - 1)
    
        If Not (xm2 Is Nothing) Then
            If LCase(xm2.Tag) = LCase(inp) Then
                getContent = xm2.Content
            End If
        End If
    Next o
End Function

'Case insensitive search for a apecified tag name
Function getTag(inp As String, nn As ChilkatXml) As ChilkatXml
    Dim o As Integer
    
    Set getTag = New ChilkatXml
    
    For o = 1 To nn.NumChildren
        Set getTag = nn.GetChild(o - 1)
    
        If Not (getTag Is Nothing) Then
            If LCase(getTag.Tag) = LCase(inp) Then
                Exit Function
            End If
        End If
    Next o
End Function

'Gets resource file corresponding to the specified resource name
Function resF(resN As String) As String
    Dim G As Integer
    
    For G = 0 To lstR.ListCount - 1
        If LCase(lstR.List(G)) = LCase(resN) Then
            resF = res(G)
        End If
    Next G
End Function

'Converts hex to decimal
Function hextodec(inp As String) As Long
    Dim v As Integer
    
    For v = 1 To Len(inp)
        Select Case Mid(LCase(inp), v, 1)
        Case "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"
            hextodec = hextodec + Val(Mid(inp, v, 1)) * 16 ^ (Len(inp) - v)
        Case "a"
            hextodec = hextodec + 10 * 16 ^ (Len(inp) - v)
        Case "b"
            hextodec = hextodec + 11 * 16 ^ (Len(inp) - v)
        Case "c"
            hextodec = hextodec + 12 * 16 ^ (Len(inp) - v)
        Case "d"
            hextodec = hextodec + 13 * 16 ^ (Len(inp) - v)
        Case "e"
            hextodec = hextodec + 14 * 16 ^ (Len(inp) - v)
        Case "f"
            hextodec = hextodec + 15 * 16 ^ (Len(inp) - v)
        End Select
    Next v
End Function

'As it says
Sub stopAllVids()
    Dim G As Integer
    
    For G = 1 To lst(curLayout).ListCount
        If itemType(G) = 3 Then
            If isPic(resF(imgRes(G))) = False Then
                vid(G).Stop
            End If
        End If
    Next G
End Sub

'Generates XML
Sub generateXML()
    Dim i As Integer
    Dim numE As Integer
    Dim modStr As String
    Dim modTmp() As String
    Dim vv As Integer
    XMLoutput = ""
    numTabs = 0
    
    xml "<Skin name=""" & frmInfo.txtName & """>"

    'Skin information
    With frmInfo
        xml "<Information>"
        
        For i = 0 To .lstFields.ListCount - 1
            If Dat(i) <> "" And LCase(.lstFields.List(i)) <> "madeusing" Then xml makeTag(.lstFields.List(i), Dat(i))
        Next i
        
        xml makeTag("MadeUsing", "MXM Skinner " & App.Major & "." & App.Minor)
        
        xml "</Information>"
    End With
    
    'Music information
    With frmMusic
        If .optYesMusic.Value = True Then
            xml "<Music>"
                xml makeTag("PlayGlobal", onOff(.chkGlobal.Value))
                xml makeTag("PlayRandom", onOff(.chkRandom.Value))
                
                If .chkCustom.Value = True And .lstMusic.ListCount > 0 Then
                    xml makeTag("Directory", "Music")
                End If
            xml "</Music>"
        End If
    End With
    
    'Delays
    xml "<Delays>"
        xml makeTag("Title", Trim(Str(delay(0))))
        xml makeTag("Load", Trim(Str(delay(1))))
        xml makeTag("Saver", Trim(Str(delay(2))))
    xml "</Delays>"
    
    'System Colors
    With frmColors
        xml "<MessageBox>"
            xml makeTag("BoxColor", "0xFF" & makecolor(.shp(0).FillColor))
            xml makeTag("BorderColor", "0xFF" & makecolor(.shp(0).BorderColor))
            xml makeTag("TextColor", "0xFF" & makecolor(.txt(0).ForeColor))
            xml makeTag("ShadowColor", "0xFF" & makecolor(.txt(1).ForeColor))
        xml "</MessageBox>"
        
        xml "<SystemMenu>"
            xml makeTag("BoxColor", "0xFF" & makecolor(.shp(1).FillColor))
            xml makeTag("BorderColor", "0xFF" & makecolor(.shp(1).BorderColor))
            xml makeTag("TextColor", "0xFF" & makecolor(.txt(4).ForeColor))
            xml makeTag("SelectColor", "0xFF" & makecolor(.txt(2).ForeColor))
            xml makeTag("ValueColor", "0xFF" & makecolor(.txt(5).ForeColor))
            xml makeTag("SelectValueColor", "0xFF" & makecolor(.txt(3).ForeColor))
        xml "</SystemMenu>"
    End With
    
    'Resources
    With frmResources
        If bgBool = True Then
            xml "<Resource Type=""Image"" Name=""bground"">"
            xml makeTag("File", "Media\" & trimtofile(bgFile))
            xml "</Resource>"
        End If
        
        
        For i = 0 To .lstRes.ListCount - 1
            'Files
            If resCustom(i) = True Then
                xml "<Resource Type=""Image"" Name=""" & .lstRes.List(i) & """>"
                    xml makeTag("File", "Media\" & trimtofile(res(i)))
                xml "</Resource>"
            'Dynamic resources
            Else
                xml "<Resource Type=""Image"" Name=""" & .lstRes.List(i) & """>"
                    xml res(i)
                xml "</Resource>"
            End If
        Next i
    End With
    
    'Layouts
    Dim k As Integer
    
    For k = 0 To 5
        If layoutCount(k) <> 0 Then
            curLayout = k
            
            xml "<Layout Screen=""" & optScreen(k).Caption & """>"
                If bgBool = True And optScreen(k).Caption = "Menu" Then
                    xml "<LayoutElement Type=""Image"" Source=""bground"">"
                    xml "<Pos L=""0""  T=""0"" W=""640""  H=""480""/>"
                    xml "</LayoutElement>"
                End If
                
                'Elements
                For i = 0 To lst(curLayout).ListCount - 1
                    'Getting object #
                    numE = lst(curLayout).ItemData(i)
                'If itemLayout(numE) = k Then
                    'Setting current object
                    Set curObj = obje(numE)
                
                    If itemType(numE) <> 2 Then
                        If itemType(numE) = 1 Then
                            'Box
                            xml "<LayoutElement Type=""Box"">"
                        ElseIf itemType(numE) = 3 Then
                            'Image
                            xml "<LayoutElement Type=""Image"" Source=""" & imgRes(numE) & """>"
                            xml "<Scaling X=""True"" Y=""True""/>"
                        ElseIf itemType(numE) = 4 Then
                            'Text
                            If txtCustom(numE) = False Then
                                xml "<LayoutElement Type=""Text"" Source=""" & txt(numE).Caption & """>"
                            Else
                                xml "<LayoutElement Type=""Text"">"
                                xml makeTag("Constant", txt(numE))
                            End If
                        Else
                            'Menu
                            xml "<LayoutElement Type=""Menu"" Source=""MXM"">"
                        End If
                        
                        With curObj
                            Select Case itemType(numE)
                                Case 1
                                    'Box
                                    If .FillStyle = 0 Then xml makeTag("Color", "0x" & makeAlpha(alph(numE)) & makecolor(.FillColor))
                                    If .BorderStyle = 1 Then xml makeTag("BorderColor", "0xFF" & makecolor(.BorderColor))
                                Case 4
                                    'Text
                                    xml makeTag("TextColor", "0x" & makeAlpha(alph(numE)) & makecolor(.ForeColor))
                                Case 5
                                    'Menu
                                    xml "<Thumbnails Align=""Left"">" & mxmSet(numE).thumbVis & "</Thumbnails>"
                                    xml "<Primary Source=""Title"">"
                                        xml makeTag("OffsetY", 0)
                                        xml makeTag("JustifyX", mxmSet(numE).titleAlign)
                                    xml "</Primary>"
                                    
                                    xml "<Secondary Source=""Descr"">"
                                        xml makeTag("OffsetY", 0)
                                        xml makeTag("JustifyX", mxmSet(numE).descAlign)
                                    xml "</Secondary>"
                                    
                                    xml "<Selection>"
                                        xml makeTag("DoGlow", bool(mxmSet(numE).doGlow))
                                        xml makeTag("TextColor", "0xFF" & makecolor(Val(mxmSet(numE).selTitleColor)))
                                        xml "<Secondary>"
                                            xml makeTag("TextColor", "0xFF" & makecolor(Val(mxmSet(numE).selDescColor)))
                                        xml "</Secondary>"
                                    xml "</Selection>"
                                    
                                    xml "<UnSelItem>"
                                        xml makeTag("TextColor", "0xFF" & makecolor(Val(mxmSet(numE).unSelTitleColor)))
                                        xml "<Secondary>"
                                            xml makeTag("TextColor", "0xFF" & makecolor(Val(mxmSet(numE).unSelDescColor)))
                                        xml "</Secondary>"
                                    xml "</UnSelItem>"
                                    
                                    xml makeTag("NumItems", Trim(Str(mxmSet(numE).numItems)))
                                    xml makeTag("SelPos", "0")
                                    xml makeTag("ScrollFactor", Trim(Str(mxmSet(numE).scrollFactor)))
                                    xml makeTag("SmoothScroll", bool(mxmSet(numE).smoothScrolling))
                                    xml makeTag("DrawSecondary", bool(mxmSet(numE).showDesc))
                            End Select
        
                            'Position tag
                            xml "<Pos L=""" & .Left & """ T=""" & .Top & """ W=""" & .Width & """ H=""" & .height & """/>"
                            
                            'Modifiers
                        End With
                    Else
                        'Line
                        With lin(numE)
                            xml "<LayoutElement Type=""Line"">"
                            xml "<Pos X1=""" & .x1 & """ Y1=""" & .y1 & """ X2=""" & .X2 & """ Y2=""" & .Y2 & """/>"
                            xml makeTag("Color", "0xFF" & makecolor(.BorderColor))
                        End With
                    End If
                                
                    'Conditionals
                    If LCase(cond(numE)) <> "none" And cond(numE) <> "" Then xml makeTag("Condition", cond(numE))
                    
                    'Timers
                    If tim(0, numE) <> 0 Then xml makeTagWithAttrib("Timer", Trim(Str(tim(0, numE))), "Type=""Delay""")
                    If tim(1, numE) <> 0 Then xml makeTagWithAttrib("Timer", Trim(Str(tim(1, numE))), "Type=""CycleOn""")
                    If tim(2, numE) <> 0 Then xml makeTagWithAttrib("Timer", Trim(Str(tim(2, numE))), "Type=""CycleOff""")
                    If tim(3, numE) <> 0 Then xml makeTagWithAttrib("Timer", Trim(Str(tim(3, numE))), "Type=""Lifetime""")
                    
                    'Modifiers
                    If Not modifs(numE) Is Nothing Then
                        modifs(numE).SaveXml fixPath(App.Path) & "temp.xml"
                        
                        Open fixPath(App.Path) & "temp.xml" For Input As #2
                            modStr = Input(LOF(2), 2)
                        Close #2
                        
                        Kill fixPath(App.Path) & "temp.xml"
                        
                        
                        If LCase(Left(modStr, 2)) = "<?" Then
                            modStr = Mid(modStr, InStr(2, modStr, "<", vbTextCompare), Len(modStr) - InStr(2, modStr, "<", vbTextCompare))
                        End If
                        
                        modStr = Replace(modStr, Chr$(13), vbCrLf)
                        modStr = Replace(modStr, Chr$(10), vbCrLf)
                        modStr = Replace(modStr, "><", ">" & vbCrLf & "<")
                        modStr = Replace(modStr, ">" & vbCrLf & "</", "></")
                        modStr = Replace(modStr, "</Modifier>", vbCrLf & "</Modifier>")
                        modTmp = Split(modStr, vbCrLf)
                        
                        For vv = LBound(modTmp) To UBound(modTmp)
                            xml modTmp(vv)
                        Next vv
                    End If
        
                    xml "</LayoutElement>"
                Next i
            xml "</Layout>"
        End If
    Next k
    
    xml "</Skin>"
    
    optScreen(1).Value = True
End Sub

Sub generateXMLUX()
    Dim i As Integer
    Dim numE As Integer
    Dim modStr As String
    Dim modTmp() As String
    Dim vv As Integer
    XMLoutput = ""
    numTabs = 0
    
    xml "<Skin name=""" & frmInfo.txtName & """>"

    'Skin information
    With frmInfo
        xml "<Information>"
        
        For i = 0 To .lstFields.ListCount - 1
            If Dat(i) <> "" And LCase(.lstFields.List(i)) <> "madeusing" Then xml makeTag(.lstFields.List(i), Dat(i))
        Next i
        
        xml makeTag("MadeUsing", "MXM Skinner " & App.Major & "." & App.Minor)
        
        xml "</Information>"
    End With
    
    
    'System Colors
'    With frmColors
'        xml "<MessageBox>"
'            xml makeTag("BoxColor", "0xFF" & makecolor(.shp(0).FillColor))
'            xml makeTag("BorderColor", "0xFF" & makecolor(.shp(0).BorderColor))
'            xml makeTag("TextColor", "0xFF" & makecolor(.txt(0).ForeColor))
'            xml makeTag("ShadowColor", "0xFF" & makecolor(.txt(1).ForeColor))
'        xml "</MessageBox>"
'
'        xml "<SystemMenu>"
'            xml makeTag("BoxColor", "0xFF" & makecolor(.shp(1).FillColor))
'            xml makeTag("BorderColor", "0xFF" & makecolor(.shp(1).BorderColor))
'            xml makeTag("TextColor", "0xFF" & makecolor(.txt(4).ForeColor))
'            xml makeTag("SelectColor", "0xFF" & makecolor(.txt(2).ForeColor))
'            xml makeTag("ValueColor", "0xFF" & makecolor(.txt(5).ForeColor))
'            xml makeTag("SelectValueColor", "0xFF" & makecolor(.txt(3).ForeColor))
'        xml "</SystemMenu>"
'    End With
    
    'Layouts
    Dim k As Integer
    k = 1
    
    curLayout = k
    
    xml "<Main>"
        If bgBool = True Then xml makeTag("<Background>", getResFile(bgFile))
        
        'Elements
        For i = 0 To lst(curLayout).ListCount - 1
            'Getting object #
            numE = lst(curLayout).ItemData(i)
            Set curObj = obje(numE)
            With curObj
                Select Case itemType(numE)
                    Case 3
                        'Image
                        xml "<Image Left=""" & .Left & """ Top=""" & .Top & """ Width=""" & .Width & """ Height =""" & .height & """>" & "Media\" & getfile(getResFile(imgRes(numE))) & "</Image>"
                    Case 4
                        'Text
                        xml "<Text Left=""" & .Left & """ Top=""" & .Top & """ Color=""0x" & makeAlpha(alph(numE)) & makecolor(.ForeColor) & """ Source=""" & getUXSource(.Caption) & """></Text>"
                    Case 5
                        'Menu
                        xml "<Menu Smooth=""" & mxmSet(numE).smoothScrolling & """ ShowIcon=""" & mxmSet(numE).thumbVis & """>"
                        xml "<Position Left=""" & .Left & """ Top=""" & .Top & """ Width=""" & .Width & """ Height=""" & .height & """ Fixed=""False"" MaxItem=""" & mxmSet(numE).numItems & """>"
                        xml "</Position>"
                        xml "</Menu>"
                End Select

                'Position tag
                'xml "<Pos L=""" & .Left & """ T=""" & .Top & """ W=""" & .Width & """ H=""" & .height & """/>"
            End With
        Next i
    xml "</Main>"
    
    xml "</Skin>"
    
    optScreen(1).Value = True
End Sub


' From some site i forgot :D
' Show the standard "BrowseForFolder" dialog to select a folder.
' hWnd is the handle of the parent form
' DialogText is an optional message to show on the dialog
'
' Example: MsgBox "You selected " & BrowseFolders(Me.hwnd,
'  "Select your favourite folder")

Function BrowseFolders(ByVal hwnd As Long, Optional ByVal DialogText As String = _
    "@@@") As String
    Dim BI As BROWSEINFO
    Dim lID As Long
    Dim szPath As String
    
    BI.hOwner = Me.hwnd
    ' if specified, set the dialog's descriptive text
    If DialogText <> "@@@" Then BI.lpszTitle = DialogText
    ' return physical folders only
    BI.ulFlags = BIF_RETURNONLYFSDIRS
    szPath = Space$(1024)
    ' show the dialog
    lID = SHBrowseForFolder(BI)
    
    ' get the path from the returned ID, otherwise return a null string
    If SHGetPathFromIDList(ByVal lID, ByVal szPath) Then
        BrowseFolders = Left$(szPath, InStr(szPath, vbNullChar) - 1)
    End If
End Function

Function FileExists(FileName As String) As Boolean
    On Error GoTo ErrorHandler
    ' get the attributes and ensure that it isn't a directory
    FileExists = (GetAttr(FileName) And vbDirectory) = 0
ErrorHandler:
    ' if an error occurs, this function returns False
End Function


'Moves the specified object outside the screen (left or right depending on boolean "left" value)
'Sets it visible
'Then moves it back to its original position in a "decelerating" style
Sub movetoX(objec As Object, Left As Boolean)
    Dim posX As Single
    
    posX = objec.Left
    
    If Left = True Then
        objec.Left = -objec.Width
    Else
        objec.Left = Me.Width
    End If
    
    objec.Visible = True
    
    'Deceleration
    Do While Abs(objec.Left - posX) > 3
        'Object moves a fifteenth of the way between its current position
        'and the target position every time the loop is executed
        'resulting in deceleration
        objec.Left = objec.Left - (objec.Left - posX) / 15
        DoEvents
    Loop
    
    objec.Left = posX
End Sub

Sub setBoxColor(Col As String, numb As Integer)
    If Col <> "" Then
        With frmColors
            .fColor(numb).BackColor = getColor(Col)
            .shp(numb).BackColor = getColor(Col)
            .txtAlpha(numb).Text = getAlpha(Col)
        End With
    End If
End Sub

Sub setBorderColor(Col As String, numb As Integer)
    If Col <> "" Then
        With frmColors
            .bColor(numb).BackColor = getColor(Col)
            .shp(numb).BorderColor = getColor(Col)
        End With
    End If
End Sub

Sub setTextColor(Col As String, numb As Integer)
    If Col <> "" Then
        With frmColors
            .Col(numb).BackColor = getColor(Col)
            .txt(numb).ForeColor = getColor(Col)
        End With
    End If
End Sub

'Returns color value from hex string
Function getColor(inp As String) As Long
    If inp <> "" Then
        getColor = RGB(Int(hextodec(Mid(inp, 5, 2))), Int(hextodec(Mid(inp, 7, 2))), Int(hextodec(Mid(inp, 9, 2))))
    End If
End Function

'Gets the alpha value from the hex color string
Function getAlpha(inp As String) As Integer
    If inp <> "" Then
        getAlpha = Val(hextodec(Mid(inp, 3, 2))) * 100 / 255
    Else
        getAlpha = 100
    End If
End Function

Sub disablex(thing As Object)
On Error Resume Next
    Dim bbb As Variant
    
    'Pic.Enabled = False
    'fraSel.Enabled = False
    If bbb.Name = "cmdStop" Then
        Dim wertytwe As Integer
        wertytwe = 1
    End If
    
    For Each bbb In Me.Controls
    
        If bbb.Name <> thing.Name And bbb.Container.Name <> thing.Name Then
            bbb.Enabled = False
        End If
        If bbb.Container.Name <> "frmMain" Then
            If bbb.Container.Container.Name = thing.Name Then
                bbb.Enabled = True
            End If
        End If
    Next bbb
    
    Pic.Enabled = False
End Sub

Sub enableAll()
On Error Resume Next
    'Pic.Enabled = True
    
    Dim qwe As Variant
    
    For Each qwe In Me.Controls
        qwe.Enabled = True
    Next qwe
    
    Pic.Enabled = True
    
End Sub

Function getcondNum(inp As String) As Integer
    Dim u As Integer
    
    For u = 0 To lstCond.ListCount - 1
        If LCase(lstCond.List(u)) = LCase(inp) Then
            getcondNum = u
        End If
    Next u
End Function

Function numsonly(inp As Integer) As Integer
    If Val(Chr$(inp)) = 0 And Chr$(inp) <> "0" And inp <> 8 Then
        inp = 0
    End If
    
    numsonly = inp
End Function

Function curNum() As Integer
    curNum = lst(curLayout).ItemData(lst(curLayout).ListIndex)
End Function


Function getModNum(inp As String) As Integer
    Dim qq As Integer
    
    For qq = 0 To lstMods.ListCount - 1
        If inp = lstMods.List(qq) Then getModNum = qq
    Next qq
End Function

Function getTarNum(inp As String) As Integer
    Dim qq As Integer
    
    For qq = 0 To lstTargets.ListCount - 1
        If inp = lstTargets.List(qq) Then getTarNum = qq
    Next qq
End Function

Function SetCurLayout() As Integer
    Dim i As Integer
    
    For i = 0 To 5
        If optScreen(i).Value = True Then curLayout = i
    Next i
End Function

Function getLayoutNum(layoutName As String) As Integer
    Dim i As Integer
    
    For i = 0 To 5
        If LCase(optScreen(i).Caption) = layoutName Then getLayoutNum = i
    Next i
End Function

Sub setBolds()
    Dim i As Integer
    If lst(curLayout).ListIndex <> -1 Then
        i = lst(curLayout).ItemData(lst(curLayout).ListIndex)
    Else
        i = 0
    End If
    
    If tim(0, i) = 0 And tim(1, i) = 0 And tim(2, i) = 0 And tim(3, i) = 0 Then
        cmdModifier(1).FontBold = False
    Else
        cmdModifier(1).FontBold = True
    End If
    
    If cond(i) = "" Or LCase(cond(i)) = "none" Then
        cmdModifier(2).FontBold = False
    Else
        cmdModifier(2).FontBold = True
    End If
    
    If modifs(i) Is Nothing Then
        cmdModifier(0).FontBold = False
    Else
        cmdModifier(0).FontBold = True
    End If
    
    For i = 0 To 2
        If cmdModifier(i).FontBold = True And Right(mnuModifier(i).Caption, 1) <> "*" Then
            mnuModifier(i).Caption = mnuModifier(i).Caption & "*"
        Else
            If Right(mnuModifier(i).Caption, 1) = "*" Then
                mnuModifier(i).Caption = Left(mnuModifier(i).Caption, Len(mnuModifier(i).Caption) - 1)
            End If
        End If
    Next i
End Sub

Sub setLayoutBolds()
    Dim i As Integer
    
    For i = 0 To 4
        If layoutCount(i) > 0 Then
            optScreen(i).FontBold = True
        Else
            optScreen(i).FontBold = False
        End If
    Next i
End Sub

Sub showEditControls(oBj As Object, num As Long)
    With oBj
    
    If oBj Is Nothing Then
        'MsgBox "obj is nothing"
        Exit Sub
    End If
    
    Select Case oBj.Name
        Case "lin"
            Set clrLine.TiesWithBorder = oBj
            txtAlpha = alph(num)
        Case "box"
                clrBoxFill.BackStyle = Abs(1 - .FillStyle)
                Set clrBoxFill.TiesWithFill = oBj
                clrBoxBorder.BackStyle = Abs(Not -Abs(1 - .BorderStyle))
                Set clrBoxBorder.TiesWithBorder = oBj
                txtAlpha = alph(num)
        Case "vid", "img", "png"
            lstR.ListIndex = getListIndex(lstR, imgRes(num))
        Case "mxm"
            'Menu settings
            With mxmSet(num)
                cmbDescAlign.ListIndex = getListIndex(cmbDescAlign, .descAlign)
                chkSelGlow = Abs(.doGlow)
                txtNumItems = .numItems
                
                txtScrollFactor = .scrollFactor
                clrSelTitle.BackColor = .selTitleColor
                clrSelDesc.BackColor = .selDescColor
                chkShowDesc = Abs(.showDesc)
                chkSmoothScroll = Abs(.smoothScrolling)
                chkThumbVis = Abs(.thumbVis)
                cmbTitleAlign.ListIndex = getListIndex(cmbTitleAlign, .titleAlign)
                clrUnselDesc.BackColor = .unSelDescColor
                clrUnselTitle.BackColor = .unSelTitleColor
            End With
        Case "txt"
            txtText = .Caption
            Set clrText.TiesWithFore = oBj
            txtAlpha = alph(num)
    End Select
    
    End With
    
    editControls oBj
    'uncover
End Sub

Sub updateControls(oBj As Object, nu As Long)
    If lst(curLayout).ListIndex >= 0 Or nu <> 0 Then
    If oBj Is Nothing Then Exit Sub
    If lst(curLayout).ListIndex >= 0 Then nu = lst(curLayout).ItemData(lst(curLayout).ListIndex)
        With oBj
            Select Case oBj.Name
                Case "lin"
                    .BorderColor = clrLine.BackColor
                Case "box"
                        .FillStyle = Abs(1 - clrBoxFill.BackStyle)
                        Set clrBoxFill.TiesWithFill = oBj
                        '.FillColor = clrBoxFill.BackColor
                        .BorderStyle = Abs(Not -Abs(1 - clrBoxBorder.BackStyle))
                        Set clrBoxBorder.TiesWithBorder = oBj
                        '.BorderColor = clrBoxBorder.BackColor
                Case "vid", "img", "png"
                    If isPic(res(lstR.ListIndex)) Then
                        'Picture
                        If resCustom(lstR.ListIndex) = True Then
                            .Picture = LoadPicture(res(lstR.ListIndex))
                        Else
                            .Picture = imgCustom.Picture
                        End If
                    ElseIf isPng(res(lstR.ListIndex)) Then
                        .setFile res(lstR.ListIndex)
                    Else
                        'Video
                        If resCustom(lstR.ListIndex) = True Then
                            .FileName = res(lstR.ListIndex)
                        End If
                    End If
                Case "mxm"
                    'Menu settings
                    With mxmSet(nu)
                        .descAlign = cmbDescAlign.Text
                        .doGlow = chkSelGlow
                        .numItems = Val(txtNumItems)
                        
                        If Val(txtNumItems) = 0 Then
                            .numItems = 1
                        End If
                        
                        .scrollFactor = Val(txtScrollFactor)
                        
                        If Val(txtScrollFactor) = 0 Then
                            .scrollFactor = 1
                        End If
                        
                        .selTitleColor = clrSelTitle.BackColor
                        .selDescColor = clrSelDesc.BackColor
                        .showDesc = chkShowDesc
                        .smoothScrolling = chkSmoothScroll
                        .thumbVis = chkThumbVis
                        .titleAlign = cmbTitleAlign.Text
                        .unSelDescColor = clrUnselDesc.BackColor
                        .unSelTitleColor = clrUnselTitle.BackColor
                    End With
                Case "txt"
                    .Caption = txtText
                    .ForeColor = clrText.BackColor
                    'Not implemented
                    'Set .Font = cmdFont.Font
                                    
                    If txtText.ListIndex < 0 Then
                        'User-entered text
                        txtCustom(nu) = True
                    Else
                        'Predefined text
                        txtCustom(nu) = False
                    End If
            End Select
        End With
        If nu <> 0 Then
            alph(nu) = Val(txtAlpha)
        Else
            alph(lst(curLayout).ItemData(lst(curLayout).ListIndex)) = Val(txtAlpha)
        End If
    End If
    'cover
End Sub

Sub editControls(oBj As Object)
'    Call dispControls
    boxVis (False)
    lineVis (False)
    imgVis (False)
    txtVis (False)
    MxmVis (False)
    If Not oBj Is Nothing Then
        Select Case oBj.Name
            Case "box"
'                lblBorderColor.Visible = True
'                lColor.Visible = True
'                lblL.Visible = True
'                lblFillColor.Caption = "Fill Color"
'                lblFillColor.Visible = True
'                fColor.Visible = True
'                lblF.Visible = True
'                lblAlpha.Visible = True
'                txtAlpha.Visible = True
'                lblBorderColor.Caption = "Border Color"
'                fraShared.Visible = True
'
                boxVis (True)
            Case "lin"
'                lblBorderColor.Caption = "Line Color"
'                lColor.FillStyle = 0
'                fraShared.Visible = True
'
                lineVis (True)
            Case "img", "vid"
'
                imgVis (True)
            Case "txt"
'                lblFillColor.Caption = "Font Color"
'                lblFillColor.Visible = True
'                fColor.FillStyle = 0
'                fColor.FillColor = RGB(255, 255, 255)
'                fColor.Visible = True
'                lblF.Visible = True
'                lblAlpha.Visible = True
'                txtAlpha.Visible = True
'                fraBox.Visible = True
'
                txtVis (True)
            Case "mxm"
                MxmVis (True)
        End Select
    End If
End Sub

Function getListIndex(ls As Object, valu As String) As Long
    Dim i As Long
    
    For i = 0 To ls.ListCount - 1
        If LCase(ls.List(i)) = LCase(valu) Then
            getListIndex = i
        End If
    Next i
End Function

Private Sub unlockAll()
    Dim i As Integer
    
    For i = 0 To lst(curLayout).ListCount - 1
        If itemLocked(lst(curLayout).ItemData(i)) = True Then
            itemLocked(lst(curLayout).ItemData(i)) = False
            lst(curLayout).List(i) = Right(lst(curLayout).List(i), Len(lst(curLayout).List(i)) - 4)
            obje(lst(curLayout).ItemData(i)).Visible = True
        End If
    Next i
    
    lockNum(curLayout) = 0
    
    Set Pic.Picture = Nothing
End Sub

Private Sub lockFrom(ind As Integer)
    
    hideSels
    DoEvents
    
    Dim i As Integer
    For i = ind To lst(curLayout).ListCount - 1
        obje(lst(curLayout).ItemData(i)).Visible = False
    Next i
    
    Pic.Refresh
    
    frmPic.AutoRedraw = True
    BitBlt Pic.hDC, 0, 0, 640, 480, Me.hDC, 0, 0, vbSrcCopy
    Set Pic.Picture = Pic.Image

    For i = 0 To ind - 1
        If itemLocked(lst(curLayout).ItemData(i)) = False Then
            itemLocked(lst(curLayout).ItemData(i)) = True
            lst(curLayout).List(i) = "(L) " & lst(curLayout).List(i)
            obje(lst(curLayout).ItemData(i)).Visible = False
        End If
    Next i
    
    For i = ind To lst(curLayout).ListCount - 1
        obje(lst(curLayout).ItemData(i)).Visible = True
    Next i
    
    hideSels
End Sub

Function isInvalid() As Boolean
    If optBox.Value = True Then
        'Box
        If clrBoxFill.BackStyle = 0 And clrBoxBorder.BackStyle = 0 Then
            MsgBox "Choose a color for either the border or the fill"
            isInvalid = True
        End If
        
        If (Val(txtAlpha) = 0 And txtAlpha <> "0") Or Val(txtAlpha) > 100 Then
            MsgBox ("Select an opacity from 1-100")
            isInvalid = True
        End If
        
        If Val(lblAlpha) > 255 Or Val(lblAlpha) < 0 Then
            MsgBox "Alpha value should be from 0 to 255"
            isInvalid = True
        End If
    ElseIf optLine.Value = True Then
        'Line
        If clrLine.BackStyle = 0 Then
            MsgBox "Choose a line color"
            isInvalid = True
        End If
    ElseIf optImg.Value = True Then
        'Image
        If lstR.ListIndex < 0 Then
            MsgBox "Select a resource"
            isInvalid = True
        End If
    ElseIf optText.Value = True Then
        'Text
        If txtText = "" Then
            MsgBox "Enter some text"
            isInvalid = True
        End If
    End If
End Function

Sub loadSkin(skinPath As String)
    If skinPath <> "" Then
        If Right(skinPath, 1) <> "\" Then skinPath = skinPath & "\"
        
        Dim xmlFile As String
        
        xmlFile = skinPath & "MXM_Skin.xml"
        
        If FileExists(xmlFile) Then
            XM.LoadXmlFile xmlFile
            
            'Getting skin name into frmInfo
            frmInfo.txtName = getAttrib(XM, "name")
            'Clearing info list
            frmInfo.lstFields.Clear
            
            Dim R As Integer
            Dim s As Integer
            
            'Skin node
            For s = 1 To XM.NumChildren
                Set nod = XM.GetChild(s - 1)
                
                Select Case LCase(nod.Tag)
                    'Music node
                    Case "music"
                        With frmMusic
                            .optYesMusic.Value = True
                            .chkGlobal.Value = Abs(reverseOnOff(getContent("PlayGlobal", nod)))
                            .chkRandom.Value = Abs(reverseOnOff(getContent("PlayRandom", nod)))
                            
                            If LCase(getContent("directory", nod)) = "music" Then
                                'NEED CODE HERE!
                                'List files
                                'Check for .wma
                                'Add to .lstmusic
                                'Set variable coun
                                'set music() value
                            End If
                        End With
                    'Information node
                    Case "information"
                        If nod.NumChildren > 3 Then ReDim Preserve Dat(nod.NumChildren) As String
                        
                        For R = 0 To nod.NumChildren - 1
                            Set cnod = nod.GetChild(R)
                            
                            'Adding information fields to the listbox in frmInfo
                            frmInfo.lstFields.AddItem cnod.Tag
                            'Storing values for each field
                            
                            Dat(R) = cnod.Content
                        Next R
                    Case "messagebox"
                        setBoxColor getContent("BoxColor", nod), 0
                        setBorderColor getContent("BorderColor", nod), 0
                        setTextColor getContent("TextColor", nod), 0
                        setTextColor getContent("ShadowColor", nod), 1
                    Case "systemmenu"
                        setBoxColor getContent("BoxColor", nod), 1
                        setBorderColor getContent("BorderColor", nod), 1
                        setTextColor getContent("SelectColor", nod), 2
                        setTextColor getContent("SelectValueColor", nod), 3
                        setTextColor getContent("TextColor", nod), 4
                        setTextColor getContent("ValueColor", nod), 5
                    Case "delays"
                        delay(0) = Val(getContent("Title", nod))
                        delay(1) = Val(getContent("Load", nod))
                        delay(2) = Val(getContent("Saver", nod))
                    Case "resource"
                        'Resource node
                        If LCase(getAttrib(nod, "Type")) = "image" Then
                            'Images
                            'Get the "file" tag
                            Set xmltag = getTag("File", nod)
                            If xmltag.Tag <> "File" Then Set xmltag = Nothing
                            
                            If Not (xmltag Is Nothing) Then
                                If Left(xmltag.Content, 2) <> "::" Then
                                    'Builtin resources
                                    'Calls sub to add a builtin resource
                                    Call frmResources.addRes(getAttrib(nod, "Name"), skinPath & xmltag.Content)
                                Else
                                    'Custom resources
                                    'Calls sub to add a custom resource
                                    Call frmResources.addcRes(makeTag(xmltag.Tag, xmltag.Content), getAttrib(nod, "Name"))
                                End If
                            Else
                                'If no "file" tag is found. i.e. if "Entry", "EntryBaseName", "FileBaseName" etc are used
                                Set xmltag = nod.GetChild(0)
                                'Calls sub to add a custom resource
                                Call frmResources.addcRes(makeTag(xmltag.Tag, xmltag.Content), getAttrib(nod, "Name"))
                            End If
                        End If
                End Select
            Next s
            
            'Goes through all nodes checking for layouts
            For s = 1 To XM.NumChildren
                Set nod = XM.GetChild(s - 1)
                
                Select Case LCase(nod.Tag)
                    'Layout nodes
                    Case "layout"
                        Call drawScreen
                End Select
            Next s
            
            'cmdStop.SetFocus
        Else
            MsgBox "The selected folder does not contain a MXM_Skin.xml file"
        End If
    End If
    
    Set XM = Nothing
    Set nod = Nothing
    Set cnod = Nothing
    Set ccnod = Nothing
    Set cccnod = Nothing
    Set xmltag = Nothing
    
    optScreen(1).Value = True
    Call optScreen_Click(1)
    
    Me.MousePointer = vbNormal
    
    Exit Sub
asd:
    Me.MousePointer = vbNormal
    If Err <> 32755 Then MsgBox Err.Description
End Sub

Sub loadSkinEvox(skinPath As String)
    Dim fileContent As String
    Dim lin() As String
     
    If skinPath <> "" Then
        If Right(skinPath, 1) <> "\" Then skinPath = skinPath & "\"
        
        Dim iniFile As String
        
        iniFile = skinPath & "skin.ini"
        
        If FileExists(iniFile) Then
            Open iniFile For Input As #1
                fileContent = Input(LOF(1), 1)
            Close #1
            
            lin = Split(fileContent, vbCrLf)
            
            Dim i As Integer
            For i = 0 To UBound(lin)
                Select Case LCase(getfirstword(lin(i)))
                    Case "text"
                        MsgBox getValue(lin(i))
                    Case ""
                    Case "skinname"
                    Case "main"
                    Case "launch"
                    Case "barcolor1"
                    Case "barcolor2"
                    Case "baralpha"
                    Case "menucolor1"
                    Case "menucolor2"
                    
                    Case Else
                        MsgBox lin(i)
                End Select
            Next i
        Else
            MsgBox "The selected folder does not contain a skin.ini file"
        End If
    End If
    
    optScreen(1).Value = True
    Call optScreen_Click(1)
    
    Me.MousePointer = vbNormal
    
    Exit Sub
asd:
    Me.MousePointer = vbNormal
    
    If Err <> 32755 Then MsgBox Err.Description
End Sub

Private Function getfirstword(inp As String) As String
    Dim wor() As String
    
    wor = Split(inp, " ")
    If UBound(wor()) > -1 Then getfirstword = LCase(wor(0))
    
End Function

Private Function getValue(inp As String) As String
    Dim wor() As String
    
    wor = Split(inp, " ")
    Dim i As Integer
    
    For i = LBound(wor) To UBound(wor)
        If wor(i) = "=" Then
            i = i + 1
            Exit For
        ElseIf Left(wor(i), 1) = "=" Then
            wor(i) = Right(wor(i), Len(wor(i)) - 1)
            Exit For
        End If
    Next i
    
    getValue = wor(i)
End Function

Sub loadSkinUX(skinPath As String)
    If skinPath <> "" Then
        If Right(skinPath, 1) <> "\" Then skinPath = skinPath & "\"
        
        Dim xmlFile As String
        
        xmlFile = skinPath & "MXM_Skin.xml"
        
        If FileExists(xmlFile) Then
            XM.LoadXmlFile xmlFile
            
            'Getting skin name into frmInfo
            frmInfo.txtName = getAttrib(XM, "name")
            'Clearing info list
            frmInfo.lstFields.Clear
            
            Dim R As Integer
            Dim s As Integer
            
            'Skin node
            For s = 1 To XM.NumChildren
                Set nod = XM.GetChild(s - 1)
                
                Select Case LCase(nod.Tag)
                    'Information node
                    Case "information"
                        If nod.NumChildren > 3 Then ReDim Preserve Dat(nod.NumChildren) As String
                        
                        For R = 0 To nod.NumChildren - 1
                            Set cnod = nod.GetChild(R)
                            
                            'Adding information fields to the listbox in frmInfo
                            frmInfo.lstFields.AddItem cnod.Tag
                            'Storing values for each field
                            
                            Dat(R) = cnod.Content
                        Next R
                End Select
            Next s
            
            'Goes through all nodes checking for layouts
            For s = 1 To XM.NumChildren
                Set nod = XM.GetChild(s - 1)
                
                Select Case LCase(nod.Tag)
                    'Layout nodes
                    Case "layout"
                        Call drawScreen
                End Select
            Next s
            
            'cmdStop.SetFocus
        Else
            MsgBox "The selected folder does not contain a MXM_Skin.xml file"
        End If
    End If
    
    Set XM = Nothing
    Set nod = Nothing
    Set cnod = Nothing
    Set ccnod = Nothing
    Set cccnod = Nothing
    Set xmltag = Nothing
    
    optScreen(1).Value = True
    Call optScreen_Click(1)
    
    Me.MousePointer = vbNormal
    
    Exit Sub
asd:
    Me.MousePointer = vbNormal
    If Err <> 32755 Then MsgBox Err.Description
End Sub
