Option Explicit
Const C_WorkProgress = 3
Class UI_Class
    Public Form, Tip, config, AppName
    Private Angel, hMenu1(1), hMenu2(0)
    Private Sub Create()
        Dim i, v, s, j, arr
        Set Form = Api.NewFrom()
        With Form
            Form.Caption = "软件定制337855632"
            Call Api.ECall("user32.dll", "SetWindowLongA", .hwnd, -16, Api.ECall("user32.dll", "GetWindowLongA", .hwnd, -16) And Not (&H10000 Or &H40000))
            .Move 0, 0, 0, 0
            .Width = (790 - .ScaleWidth) * Globals("Screen").TwipsPerPixelX + .Width
            .Height = (430 - .ScaleHeight) * Globals("Screen").TwipsPerPixelY + .Height
        End With
        Const Width = 100
        Const Top = 335
        Const Margin = 2
        config = "Angel.ini"
        AppName = "Angel_BP"
        Call CreateListView
        arr = Array("使用帮助", "常用功能", "会员服务", "启动游戏", "中止全部", "清除进度")
        For i = 0 To UBound(arr)
            With Form.Controls.Add("VB.CommandButton", arr(i))
                .Caption = arr(i)
                .Move 660 + 60 * (i \ 3), Top + (20 + Margin) * (i Mod 3), 60, 21
                .Visible = True
            End With
        Next
        Form.Controls("启动游戏").ToolTipText = "快捷键(F9)"
        Form.Controls("中止全部").ToolTipText = "快捷键(F10)"
        Form.Controls("清除进度").ToolTipText = "手动中止后。游戏进度会被保存以备启动继续。清除后可以完全重新开始"
        arr = Array(227, 653)   '230
        For i = 0 To UBound(arr)
            With Form.Controls.Add("VB.Line", "Line" & i)
                .X1 = arr(i)
                .X2 = .X1
                .Y1 = Top
                .Y2 = .Y1 + 65
                .BorderColor = &H555555
                .Visible = True
            End With
        Next
        arr = Array("上号间隔" & Space(6) & "秒", 5, 1, "登录重试" & Space(6) & "次", 3, 1, "服务端口" & Space(6) & "号", 8888, 0)
        For i = 0 To UBound(arr) Step 3
            s = Left(arr(i), 4)
            With Form.Controls.Add("VB.TextBox", s & "T")
                .Move 78, Top + (20 + Margin) * i \ 3, 30, 20
                .Visible = True
                .Text = File.ReadINI(AppName, s & "T.Text", config, arr(i + 1))
            End With
            With Form.Controls.Add("VB.CheckBox", s)
                .Caption = arr(i)
                .Move 10, Top + (20 + Margin) * i \ 3, 120, 20
                .Visible = True
                .Value = File.ReadINI(AppName, s & ".Value", config, arr(i + 2))
            End With
            Call Form_Event(Form.Controls(s & "T"), &H30000 * &H100, 0)
            Call Form_Event(Form.Controls(s), &H100 * &H100, 0)
        Next

        arr = Array("上号等待", 50, "同时线程", 6, "游戏降耗", 0)
        For i = 0 To UBound(arr) Step 2
            With Form.Controls.Add("VB.TextBox", arr(i))
                .Move 190, Top + (20 + Margin) * i \ 2, 30, 20
                .Visible = True
                .Text = File.ReadINI(AppName, arr(i) & ".text", config, arr(i + 1))
            End With
            With Form.Controls.Add("VB.Label", arr(i) & "L")
                .Move 130, Top + 3 + (20 + Margin) * i \ 2, 100, 20
                .Caption = arr(i) & ":"
                .Visible = True
            End With
            Call Form_Event(Form.Controls(arr(i)), &H30000 * &H100, 0)
        Next
        Form.Controls("上号等待").ToolTipText = "登录游戏时的读条时间:秒"

        arr = Array("窗口排列", "左竖叠加|左竖平铺|左横平铺|右竖叠加|右竖平铺|右横平铺", "方向按键", "上下左右|W A S D", "游戏完成", "不做处理|播放音乐|关闭电脑")
        For i = 0 To UBound(arr) Step 2
            With Form.Controls.Add("VB.Label", arr(i) & "L")
                .Move 235, Top + 3 + (20 + Margin) * i \ 2, 60, 20
                .Caption = arr(i) & ":"
                .Visible = True
            End With
            With Form.Controls.Add("VB.ComboBox", arr(i))
                .Move 235 + 60, Top + (20