Sign in to follow this  
Followers 0
ccmt19

What these scripts do?

6 posts in this topic

Func _OPENPROCESS($HWND, $USE_PID = 0)
    If $USE_PID = 0 Then
        Local $PID = DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $HWND, "int*", 0)
        If IsArray($PID) Then
            $PID = $PID[2]
        Else
            SetError(-1)
            Return
        EndIf
    Else
        Local $PID = $HWND
    EndIf
    Local $PHANDLE = DllCall("kernel32.dll", "long", "OpenProcess", "int", 2035711, "int", 0, "int", $PID)
    If IsArray($PHANDLE) And $PHANDLE[0] > 0 Then
        $PHANDLE = $PHANDLE[0]
    Else
        SetError(-2)
        Return
    EndIf
    Return $PHANDLE
EndFunc


Func _CLOSEHANDLE($PHANDLE)
    DllCall("kernel32.dll", "int", "CloseHandle", "int", $PHANDLE)
EndFunc


Func _WRITEFLOAT($PHANDLE, $ADDRESS, $VALUE)
    Local $FLOAT = DllStructCreate("float")
    DllStructSetData($FLOAT, 1, $VALUE)
    $OUTDW = 0
    DllCall("kernel32.dll", "int", "VirtualProtectEx", "int", $PHANDLE, "ptr", $ADDRESS, "int", 4, "dword", 64, "dword*", $OUTDW)
    Local $RET = DllCall("kernel32.dll", "int", "WriteProcessMemory", "int", $PHANDLE, "int", $ADDRESS, "ptr", DllStructGetPtr($FLOAT), "int", 4, "int", 0)
    If IsArray($RET) Then
        If $RET[0] <> 0 Then
            Return True
        Else
            SetError(-2)
            Return False
        EndIf
    Else
        SetError(-1)
        Return False
    EndIf
    DllCall("kernel32.dll", "int", "VirtualProtectEx", "int", $PHANDLE, "ptr", $ADDRESS, "int", 4, "dword", 64, "dword*", 1)
EndFunc


Func _READFLOAT($PHANDLE, $ADDRESS)
    Local $FLOATRETURN = 0
    Local $FLOAT = DllStructCreate("float")
    Local $RET = DllCall("kernel32.dll", "int", "ReadProcessMemory", "int", $PHANDLE, "int", $ADDRESS, "ptr", DllStructGetPtr($FLOAT), "int", 4, "int", 0)
    If IsArray($RET) Then
        If $RET[0] = 1 Then
            $FLOATRETURN = DllStructGetData($FLOAT, 1)
        Else
            SetError(-1)
        EndIf
    Else
        SetError(-2)
    EndIf
    Return $FLOATRETURN
EndFunc

#region _Memory

Func _MEMORYOPEN($IV_PID, $IV_DESIREDACCESS = 2035711, $IF_INHERITHANDLE = 1)
    If Not ProcessExists($IV_PID) Then
        SetError(1)
        Return 0
    EndIf
    Local $AH_HANDLE[2] = [DllOpen("kernel32.dll") ]
    If @error Then
        SetError(2)
        Return 0
    EndIf
    Local $AV_OPENPROCESS = DllCall($AH_HANDLE[0], "int", "OpenProcess", "int", $IV_DESIREDACCESS, "int", $IF_INHERITHANDLE, "int", $IV_PID)
    If @error Then
        DllClose($AH_HANDLE[0])
        SetError(3)
        Return 0
    EndIf
    $AH_HANDLE[1] = $AV_OPENPROCESS[0]
    Return $AH_HANDLE
EndFunc


Func _MEMORYREAD($IV_ADDRESS, $AH_HANDLE, $SV_TYPE = "dword")
    If Not IsArray($AH_HANDLE) Then
        SetError(1)
        Return 0
    EndIf
    Local $V_BUFFER = DllStructCreate($SV_TYPE)
    If @error Then
        SetError(@error + 1)
        Return 0
    EndIf
    DllCall($AH_HANDLE[0], "int", "ReadProcessMemory", "int", $AH_HANDLE[1], "int", $IV_ADDRESS, "ptr", DllStructGetPtr($V_BUFFER), "int", DllStructGetSize($V_BUFFER), "int", "")
    If Not @error Then
        Local $V_VALUE = DllStructGetData($V_BUFFER, 1)
        Return $V_VALUE
    Else
        SetError(6)
        Return 0
    EndIf
EndFunc


Func _MEMORYWRITE($IV_ADDRESS, $AH_HANDLE, $V_DATA, $SV_TYPE = "dword")
    If Not IsArray($AH_HANDLE) Then
        SetError(1)
        Return 0
    EndIf
    Local $V_BUFFER = DllStructCreate($SV_TYPE)
    If @error Then
        SetError(@error + 1)
        Return 0
    Else
        DllStructSetData($V_BUFFER, 1, $V_DATA)
        If @error Then
            SetError(6)
            Return 0
        EndIf
    EndIf
    DllCall($AH_HANDLE[0], "int", "WriteProcessMemory", "int", $AH_HANDLE[1], "int", $IV_ADDRESS, "ptr", DllStructGetPtr($V_BUFFER), "int", DllStructGetSize($V_BUFFER), "int", "")
    If Not @error Then
        Return 1
    Else
        SetError(7)
        Return 0
    EndIf
EndFunc


Func _MEMORYCLOSE($AH_HANDLE)
    If Not IsArray($AH_HANDLE) Then
        SetError(1)
        Return 0
    EndIf
    DllCall($AH_HANDLE[0], "int", "CloseHandle", "int", $AH_HANDLE[1])
    If Not @error Then
        DllClose($AH_HANDLE[0])
        Return 1
    Else
        DllClose($AH_HANDLE[0])
        SetError(2)
        Return 0
    EndIf
EndFunc


Func _MEMORYPOINTERREAD($IV_ADDRESS, $AH_HANDLE, $AV_OFFSET, $SV_TYPE = "dword")
    If IsArray($AV_OFFSET) Then
        If IsArray($AH_HANDLE) Then
            Local $IV_POINTERCOUNT = UBound($AV_OFFSET) - 1
        Else
            SetError(2)
            Return 0
        EndIf
    Else
        SetError(1)
        Return 0
    EndIf
    Local $IV_DATA[2], $I
    Local $V_BUFFER = DllStructCreate("dword")
    For $I = 0 To $IV_POINTERCOUNT
        If $I = $IV_POINTERCOUNT Then
            $V_BUFFER = DllStructCreate($SV_TYPE)
            If @error Then
                SetError(@error + 2)
                Return 0
            EndIf
            $IV_ADDRESS = "0x" & Hex($IV_DATA[1] + $AV_OFFSET[$I])
            DllCall($AH_HANDLE[0], "int", "ReadProcessMemory", "int", $AH_HANDLE[1], "int", $IV_ADDRESS, "ptr", DllStructGetPtr($V_BUFFER), "int", DllStructGetSize($V_BUFFER), "int", "")
            If @error Then
                SetError(7)
                Return 0
            EndIf
            $IV_DATA[1] = DllStructGetData($V_BUFFER, 1)
        ElseIf $I = 0 Then
            DllCall($AH_HANDLE[0], "int", "ReadProcessMemory", "int", $AH_HANDLE[1], "int", $IV_ADDRESS, "ptr", DllStructGetPtr($V_BUFFER), "int", DllStructGetSize($V_BUFFER), "int", "")
            If @error Then
                SetError(7)
                Return 0
            EndIf
            $IV_DATA[1] = DllStructGetData($V_BUFFER, 1)
        Else
            $IV_ADDRESS = "0x" & Hex($IV_DATA[1] + $AV_OFFSET[$I])
            DllCall($AH_HANDLE[0], "int", "ReadProcessMemory", "int", $AH_HANDLE[1], "int", $IV_ADDRESS, "ptr", DllStructGetPtr($V_BUFFER), "int", DllStructGetSize($V_BUFFER), "int", "")
            If @error Then
                SetError(7)
                Return 0
            EndIf
            $IV_DATA[1] = DllStructGetData($V_BUFFER, 1)
        EndIf
    Next
    $IV_DATA[0] = $IV_ADDRESS
    Return $IV_DATA
EndFunc


Func _MEMORYPOINTERWRITE($IV_ADDRESS, $AH_HANDLE, $AV_OFFSET, $V_DATA, $SV_TYPE = "dword")
    If IsArray($AV_OFFSET) Then
        If IsArray($AH_HANDLE) Then
            Local $IV_POINTERCOUNT = UBound($AV_OFFSET) - 1
        Else
            SetError(2)
            Return 0
        EndIf
    Else
        SetError(1)
        Return 0
    EndIf
    Local $IV_STRUCTDATA, $I
    Local $V_BUFFER = DllStructCreate("dword")
    For $I = 0 To $IV_POINTERCOUNT
        If $I = $IV_POINTERCOUNT Then
            $V_BUFFER = DllStructCreate($SV_TYPE)
            If @error Then
                SetError(@error + 3)
                Return 0
            EndIf
            DllStructSetData($V_BUFFER, 1, $V_DATA)
            If @error Then
                SetError(8)
                Return 0
            EndIf
            $IV_ADDRESS = "0x" & Hex($IV_STRUCTDATA + $AV_OFFSET[$I])
            DllCall($AH_HANDLE[0], "int", "WriteProcessMemory", "int", $AH_HANDLE[1], "int", $IV_ADDRESS, "ptr", DllStructGetPtr($V_BUFFER), "int", DllStructGetSize($V_BUFFER), "int", "")
            If @error Then
                SetError(9)
                Return 0
            Else
                Return $IV_ADDRESS
            EndIf
        ElseIf $I = 0 Then
            DllCall($AH_HANDLE[0], "int", "ReadProcessMemory", "int", $AH_HANDLE[1], "int", $IV_ADDRESS, "ptr", DllStructGetPtr($V_BUFFER), "int", DllStructGetSize($V_BUFFER), "int", "")
            If @error Then
                SetError(3)
                Return 0
            EndIf
            $IV_STRUCTDATA = DllStructGetData($V_BUFFER, 1)
        Else
            $IV_ADDRESS = "0x" & Hex($IV_STRUCTDATA + $AV_OFFSET[$I])
            DllCall($AH_HANDLE[0], "int", "ReadProcessMemory", "int", $AH_HANDLE[1], "int", $IV_ADDRESS, "ptr", DllStructGetPtr($V_BUFFER), "int", DllStructGetSize($V_BUFFER), "int", "")
            If @error Then
                SetError(3)
                Return 0
            EndIf
            $IV_STRUCTDATA = DllStructGetData($V_BUFFER, 1)
        EndIf
    Next
EndFunc

#endregion
Global Const $BS_GROUPBOX = 7
Global Const $BS_BOTTOM = 2048
Global Const $BS_CENTER = 768
Global Const $BS_DEFPUSHBUTTON = 1
Global Const $BS_LEFT = 256
Global Const $BS_MULTILINE = 8192
Global Const $BS_PUSHBOX = 10
Global Const $BS_PUSHLIKE = 4096
Global Const $BS_RIGHT = 512
Global Const $BS_RIGHTBUTTON = 32
Global Const $BS_TOP = 1024
Global Const $BS_VCENTER = 3072
Global Const $BS_FLAT = 32768
Global Const $BS_ICON = 64
Global Const $BS_BITMAP = 128
Global Const $BS_NOTIFY = 16384
Global Const $BS_3STATE = 5
Global Const $BS_AUTO3STATE = 6
Global Const $BS_AUTOCHECKBOX = 3
Global Const $BS_CHECKBOX = 2
Global Const $BS_AUTORADIOBUTTON = 9
Global Const $WS_TILED = 0
Global Const $WS_OVERLAPPED = 0
Global Const $WS_MAXIMIZEBOX = 65536
Global Const $WS_MINIMIZEBOX = 131072
Global Const $WS_TABSTOP = 65536
Global Const $WS_GROUP = 131072
Global Const $WS_SIZEBOX = 262144
Global Const $WS_THICKFRAME = 262144
Global Const $WS_SYSMENU = 524288
Global Const $WS_HSCROLL = 1048576
Global Const $WS_VSCROLL = 2097152
Global Const $WS_DLGFRAME = 4194304
Global Const $WS_BORDER = 8388608
Global Const $WS_CAPTION = 12582912
Global Const $WS_OVERLAPPEDWINDOW = 13565952
Global Const $WS_TILEDWINDOW = 13565952
Global Const $WS_MAXIMIZE = 16777216
Global Const $WS_CLIPCHILDREN = 33554432
Global Const $WS_CLIPSIBLINGS = 67108864
Global Const $WS_DISABLED = 134217728
Global Const $WS_VISIBLE = 268435456
Global Const $WS_MINIMIZE = 536870912
Global Const $WS_CHILD = 1073741824
Global Const $WS_POPUP = -2147483648
Global Const $WS_POPUPWINDOW = -2138570752
Global Const $DS_MODALFRAME = 128
Global Const $DS_SETFOREGROUND = 512
Global Const $DS_CONTEXTHELP = 8192
Global Const $WS_EX_ACCEPTFILES = 16
Global Const $WS_EX_MDICHILD = 64
Global Const $WS_EX_APPWINDOW = 262144
Global Const $WS_EX_CLIENTEDGE = 512
Global Const $WS_EX_CONTEXTHELP = 1024
Global Const $WS_EX_DLGMODALFRAME = 1
Global Const $WS_EX_LEFTSCROLLBAR = 16384
Global Const $WS_EX_OVERLAPPEDWINDOW = 768
Global Const $WS_EX_RIGHT = 4096
Global Const $WS_EX_STATICEDGE = 131072
Global Const $WS_EX_TOOLWINDOW = 128
Global Const $WS_EX_TOPMOST = 8
Global Const $WS_EX_TRANSPARENT = 32
Global Const $WS_EX_WINDOWEDGE = 256
Global Const $WS_EX_LAYERED = 524288
Global Const $WS_EX_CONTROLPARENT = 65536
Global Const $WS_EX_LAYOUTRTL = 4194304
Global Const $WS_EX_RTLREADING = 8192
Global Const $WM_GETTEXTLENGTH = 14
Global Const $WM_GETTEXT = 13
Global Const $WM_SIZE = 5
Global Const $WM_SIZING = 532
Global Const $WM_USER = 1024
Global Const $WM_CREATE = 1
Global Const $WM_DESTROY = 2
Global Const $WM_MOVE = 3
Global Const $WM_ACTIVATE = 6
Global Const $WM_SETFOCUS = 7
Global Const $WM_KILLFOCUS = 8
Global Const $WM_ENABLE = 10
Global Const $WM_SETREDRAW = 11
Global Const $WM_SETTEXT = 12
Global Const $WM_PAINT = 15
Global Const $WM_CLOSE = 16
Global Const $WM_QUIT = 18
Global Const $WM_ERASEBKGND = 20
Global Const $WM_SYSCOLORCHANGE = 21
Global Const $WM_SHOWWINDOW = 24
Global Const $WM_WININICHANGE = 26
Global Const $WM_DEVMODECHANGE = 27
Global Const $WM_ACTIVATEAPP = 28
Global Const $WM_FONTCHANGE = 29
Global Const $WM_TIMECHANGE = 30
Global Const $WM_CANCELMODE = 31
Global Const $WM_SETCURSOR = 32
Global Const $WM_MOUSEACTIVATE = 33
Global Const $WM_CHILDACTIVATE = 34
Global Const $WM_QUEUESYNC = 35
Global Const $WM_GETMINMAXINFO = 36
Global Const $WM_PAINTICON = 38
Global Const $WM_ICONERASEBKGND = 39
Global Const $WM_NEXTDLGCTL = 40
Global Const $WM_SPOOLERSTATUS = 42
Global Const $WM_DRAWITEM = 43
Global Const $WM_MEASUREITEM = 44
Global Const $WM_DELETEITEM = 45
Global Const $WM_VKEYTOITEM = 46
Global Const $WM_CHARTOITEM = 47
Global Const $WM_SETFONT = 48
Global Const $WM_GETFONT = 49
Global Const $WM_SETHOTKEY = 50
Global Const $WM_GETHOTKEY = 51
Global Const $WM_QUERYDRAGICON = 55
Global Const $WM_COMPAREITEM = 57
Global Const $WM_GETOBJECT = 61
Global Const $WM_COMPACTING = 65
Global Const $WM_COMMNOTIFY = 68
Global Const $WM_WINDOWPOSCHANGING = 70
Global Const $WM_WINDOWPOSCHANGED = 71
Global Const $WM_POWER = 72
Global Const $WM_NOTIFY = 78
Global Const $WM_COPYDATA = 74
Global Const $WM_CANCELJOURNAL = 75
Global Const $WM_INPUTLANGCHANGEREQUEST = 80
Global Const $WM_INPUTLANGCHANGE = 81
Global Const $WM_TCARD = 82
Global Const $WM_HELP = 83
Global Const $WM_USERCHANGED = 84
Global Const $WM_NOTIFYFORMAT = 85
Global Const $WM_CUT = 768
Global Const $WM_COPY = 769
Global Const $WM_PASTE = 770
Global Const $WM_CLEAR = 771
Global Const $WM_UNDO = 772
Global Const $WM_CONTEXTMENU = 123
Global Const $WM_STYLECHANGING = 124
Global Const $WM_STYLECHANGED = 125
Global Const $WM_DISPLAYCHANGE = 126
Global Const $WM_GETICON = 127
Global Const $WM_SETICON = 128
Global Const $WM_NCCREATE = 129
Global Const $WM_NCDESTROY = 130
Global Const $WM_NCCALCSIZE = 131
Global Const $WM_NCHITTEST = 132
Global Const $WM_NCPAINT = 133
Global Const $WM_NCACTIVATE = 134
Global Const $WM_GETDLGCODE = 135
Global Const $WM_SYNCPAINT = 136
Global Const $WM_NCMOUSEMOVE = 160
Global Const $WM_NCLBUTTONDOWN = 161
Global Const $WM_NCLBUTTONUP = 162
Global Const $WM_NCLBUTTONDBLCLK = 163
Global Const $WM_NCRBUTTONDOWN = 164
Global Const $WM_NCRBUTTONUP = 165
Global Const $WM_NCRBUTTONDBLCLK = 166
Global Const $WM_NCMBUTTONDOWN = 167
Global Const $WM_NCMBUTTONUP = 168
Global Const $WM_NCMBUTTONDBLCLK = 169
Global Const $WM_KEYDOWN = 256
Global Const $WM_KEYUP = 257
Global Const $WM_CHAR = 258
Global Const $WM_DEADCHAR = 259
Global Const $WM_SYSKEYDOWN = 260
Global Const $WM_SYSKEYUP = 261
Global Const $WM_SYSCHAR = 262
Global Const $WM_SYSDEADCHAR = 263
Global Const $WM_INITDIALOG = 272
Global Const $WM_COMMAND = 273
Global Const $WM_SYSCOMMAND = 274
Global Const $WM_TIMER = 275
Global Const $WM_HSCROLL = 276
Global Const $WM_VSCROLL = 277
Global Const $WM_INITMENU = 278
Global Const $WM_INITMENUPOPUP = 279
Global Const $WM_MENUSELECT = 287
Global Const $WM_MENUCHAR = 288
Global Const $WM_ENTERIDLE = 289
Global Const $WM_MENURBUTTONUP = 290
Global Const $WM_MENUDRAG = 291
Global Const $WM_MENUGETOBJECT = 292
Global Const $WM_UNINITMENUPOPUP = 293
Global Const $WM_MENUCOMMAND = 294
Global Const $WM_CHANGEUISTATE = 295
Global Const $WM_UPDATEUISTATE = 296
Global Const $WM_QUERYUISTATE = 297
Global Const $WM_CTLCOLORMSGBOX = 306
Global Const $WM_CTLCOLOREDIT = 307
Global Const $WM_CTLCOLORLISTBOX = 308
Global Const $WM_CTLCOLORBTN = 309
Global Const $WM_CTLCOLORDLG = 310
Global Const $WM_CTLCOLORSCROLLBAR = 311
Global Const $WM_CTLCOLORSTATIC = 312
Global Const $WM_CTLCOLOR = 25
Global Const $MN_GETHMENU = 481
Global Const $NM_FIRST = 0
Global Const $NM_OUTOFMEMORY = $NM_FIRST - 1
Global Const $NM_CLICK = $NM_FIRST - 2
Global Const $NM_DBLCLK = $NM_FIRST - 3
Global Const $NM_RETURN = $NM_FIRST - 4
Global Const $NM_RCLICK = $NM_FIRST - 5
Global Const $NM_RDBLCLK = $NM_FIRST - 6
Global Const $NM_SETFOCUS = $NM_FIRST - 7
Global Const $NM_KILLFOCUS = $NM_FIRST - 8
Global Const $NM_CUSTOMDRAW = $NM_FIRST - 12
Global Const $NM_HOVER = $NM_FIRST - 13
Global Const $NM_NCHITTEST = $NM_FIRST - 14
Global Const $NM_KEYDOWN = $NM_FIRST - 15
Global Const $NM_RELEASEDCAPTURE = $NM_FIRST - 16
Global Const $NM_SETCURSOR = $NM_FIRST - 17
Global Const $NM_CHAR = $NM_FIRST - 18
Global Const $NM_TOOLTIPSCREATED = $NM_FIRST - 19
Global Const $NM_LDOWN = $NM_FIRST - 20
Global Const $NM_RDOWN = $NM_FIRST - 21
Global Const $NM_THEMECHANGED = $NM_FIRST - 22
Global Const $CCM_FIRST = 8192
Global Const $CCM_GETUNICODEFORMAT = ($CCM_FIRST + 6)
Global Const $CCM_SETUNICODEFORMAT = ($CCM_FIRST + 5)
Global Const $CCM_SETBKCOLOR = $CCM_FIRST + 1
Global Const $CCM_SETCOLORSCHEME = $CCM_FIRST + 2
Global Const $CCM_GETCOLORSCHEME = $CCM_FIRST + 3
Global Const $CCM_GETDROPTARGET = $CCM_FIRST + 4
Global Const $CCM_SETWINDOWTHEME = $CCM_FIRST + 11
Global Const $GA_PARENT = 1
Global Const $GA_ROOT = 2
Global Const $GA_ROOTOWNER = 3
Global Const $SM_CXSCREEN = 0
Global Const $SM_CYSCREEN = 1
Global Const $SM_CXVSCROLL = 2
Global Const $SM_CYHSCROLL = 3
Global Const $SM_CYCAPTION = 4
Global Const $SM_CXBORDER = 5
Global Const $SM_CYBORDER = 6
Global Const $SM_CXDLGFRAME = 7
Global Const $SM_CYDLGFRAME = 8
Global Const $SM_CYVTHUMB = 9
Global Const $SM_CXHTHUMB = 10
Global Const $SM_CXICON = 11
Global Const $SM_CYICON = 12
Global Const $SM_CXCURSOR = 13
Global Const $SM_CYCURSOR = 14
Global Const $SM_CYMENU = 15
Global Const $SM_CXFULLSCREEN = 16
Global Const $SM_CYFULLSCREEN = 17
Global Const $SM_CYKANJIWINDOW = 18
Global Const $SM_MOUSEPRESENT = 19
Global Const $SM_CYVSCROLL = 20
Global Const $SM_CXHSCROLL = 21
Global Const $SM_DEBUG = 22
Global Const $SM_SWAPBUTTON = 23
Global Const $SM_RESERVED1 = 24
Global Const $SM_RESERVED2 = 25
Global Const $SM_RESERVED3 = 26
Global Const $SM_RESERVED4 = 27
Global Const $SM_CXMIN = 28
Global Const $SM_CYMIN = 29
Global Const $SM_CXSIZE = 30
Global Const $SM_CYSIZE = 31
Global Const $SM_CXFRAME = 32
Global Const $SM_CYFRAME = 33
Global Const $SM_CXMINTRACK = 34
Global Const $SM_CYMINTRACK = 35
Global Const $SM_CXDOUBLECLK = 36
Global Const $SM_CYDOUBLECLK = 37
Global Const $SM_CXICONSPACING = 38
Global Const $SM_CYICONSPACING = 39
Global Const $SM_MENUDROPALIGNMENT = 40
Global Const $SM_PENWINDOWS = 41
Global Const $SM_DBCSENABLED = 42
Global Const $SM_CMOUSEBUTTONS = 43
Global Const $SM_SECURE = 44
Global Const $SM_CXEDGE = 45
Global Const $SM_CYEDGE = 46
Global Const $SM_CXMINSPACING = 47
Global Const $SM_CYMINSPACING = 48
Global Const $SM_CXSMICON = 49
Global Const $SM_CYSMICON = 50
Global Const $SM_CYSMCAPTION = 51
Global Const $SM_CXSMSIZE = 52
Global Const $SM_CYSMSIZE = 53
Global Const $SM_CXMENUSIZE = 54
Global Const $SM_CYMENUSIZE = 55
Global Const $SM_ARRANGE = 56
Global Const $SM_CXMINIMIZED = 57
Global Const $SM_CYMINIMIZED = 58
Global Const $SM_CXMAXTRACK = 59
Global Const $SM_CYMAXTRACK = 60
Global Const $SM_CXMAXIMIZED = 61
Global Const $SM_CYMAXIMIZED = 62
Global Const $SM_NETWORK = 63
Global Const $SM_CLEANBOOT = 67
Global Const $SM_CXDRAG = 68
Global Const $SM_CYDRAG = 69
Global Const $SM_SHOWSOUNDS = 70
Global Const $SM_CXMENUCHECK = 71
Global Const $SM_CYMENUCHECK = 72
Global Const $SM_SLOWMACHINE = 73
Global Const $SM_MIDEASTENABLED = 74
Global Const $SM_MOUSEWHEELPRESENT = 75
Global Const $SM_XVIRTUALSCREEN = 76
Global Const $SM_YVIRTUALSCREEN = 77
Global Const $SM_CXVIRTUALSCREEN = 78
Global Const $SM_CYVIRTUALSCREEN = 79
Global Const $SM_CMONITORS = 80
Global Const $SM_SAMEDISPLAYFORMAT = 81
Global Const $SM_IMMENABLED = 82
Global Const $SM_CXFOCUSBORDER = 83
Global Const $SM_CYFOCUSBORDER = 84
Global Const $SM_TABLETPC = 86
Global Const $SM_MEDIACENTER = 87
Global Const $SM_STARTER = 88
Global Const $SM_SERVERR2 = 89
Global Const $SM_CMETRICS = 90
Global Const $SM_REMOTESESSION = 4096
Global Const $SM_SHUTTINGDOWN = 8192
Global Const $SM_REMOTECONTROL = 8193
Global Const $SM_CARETBLINKINGENABLED = 8194
Global Const $SRCCOPY = 13369376
Global Const $SRCPAINT = 15597702
Global Const $SRCAND = 8913094
Global Const $SRCINVERT = 6684742
Global Const $SRCERASE = 4457256
Global Const $NOTSRCCOPY = 3342344
Global Const $NOTSRCERASE = 1114278
Global Const $MERGECOPY = 12583114
Global Const $MERGEPAINT = 12255782
Global Const $PATCOPY = 15728673
Global Const $PATPAINT = 16452105
Global Const $PATINVERT = 5898313
Global Const $DSTINVERT = 5570569
Global Const $BLACKNESS = 66
Global Const $WHITENESS = 16711778
Global Const $DT_TOP = 0
Global Const $DT_LEFT = 0
Global Const $DT_CENTER = 1
Global Const $DT_RIGHT = 2
Global Const $DT_VCENTER = 4
Global Const $DT_BOTTOM = 8
Global Const $DT_WORDBREAK = 16
Global Const $DT_SINGLELINE = 32
Global Const $DT_EXPANDTABS = 64
Global Const $DT_TABSTOP = 128
Global Const $DT_NOCLIP = 256
Global Const $DT_EXTERNALLEADING = 512
Global Const $DT_CALCRECT = 1024
Global Const $DT_NOPREFIX = 2048
Global Const $DT_INTERNAL = 4096
Global Const $RDW_INVALIDATE = 1
Global Const $RDW_INTERNALPAINT = 2
Global Const $RDW_ERASE = 4
Global Const $RDW_VALIDATE = 8
Global Const $RDW_NOINTERNALPAINT = 16
Global Const $RDW_NOERASE = 32
Global Const $RDW_NOCHILDREN = 64
Global Const $RDW_ALLCHILDREN = 128
Global Const $RDW_UPDATENOW = 256
Global Const $RDW_ERASENOW = 512
Global Const $RDW_FRAME = 1024
Global Const $RDW_NOFRAME = 2048
Global Const $WM_RENDERFORMAT = 773
Global Const $WM_RENDERALLFORMATS = 774
Global Const $WM_DESTROYCLIPBOARD = 775
Global Const $WM_DRAWCLIPBOARD = 776
Global Const $WM_PAINTCLIPBOARD = 777
Global Const $WM_VSCROLLCLIPBOARD = 778
Global Const $WM_SIZECLIPBOARD = 779
Global Const $WM_ASKCBFORMATNAME = 780
Global Const $WM_CHANGECBCHAIN = 781
Global Const $WM_HSCROLLCLIPBOARD = 782
Global Const $HTERROR = -2
Global Const $HTTRANSPARENT = -1
Global Const $HTNOWHERE = 0
Global Const $HTCLIENT = 1
Global Const $HTCAPTION = 2
Global Const $HTSYSMENU = 3
Global Const $HTGROWBOX = 4
Global Const $HTSIZE = $HTGROWBOX
Global Const $HTMENU = 5
Global Const $HTHSCROLL = 6
Global Const $HTVSCROLL = 7
Global Const $HTMINBUTTON = 8
Global Const $HTMAXBUTTON = 9
Global Const $HTLEFT = 10
Global Const $HTRIGHT = 11
Global Const $HTTOP = 12
Global Const $HTTOPLEFT = 13
Global Const $HTTOPRIGHT = 14
Global Const $HTBOTTOM = 15
Global Const $HTBOTTOMLEFT = 16
Global Const $HTBOTTOMRIGHT = 17
Global Const $HTBORDER = 18
Global Const $HTREDUCE = $HTMINBUTTON
Global Const $HTZOOM = $HTMAXBUTTON
Global Const $HTSIZEFIRST = $HTLEFT
Global Const $HTSIZELAST = $HTBOTTOMRIGHT
Global Const $HTOBJECT = 19
Global Const $HTCLOSE = 20
Global Const $HTHELP = 21
Global Const $COLOR_SCROLLBAR = 0
Global Const $COLOR_BACKGROUND = 1
Global Const $COLOR_ACTIVECAPTION = 2
Global Const $COLOR_INACTIVECAPTION = 3
Global Const $COLOR_MENU = 4
Global Const $COLOR_WINDOW = 5
Global Const $COLOR_WINDOWFRAME = 6
Global Const $COLOR_MENUTEXT = 7
Global Const $COLOR_WINDOWTEXT = 8
Global Const $COLOR_CAPTIONTEXT = 9
Global Const $COLOR_ACTIVEBORDER = 10
Global Const $COLOR_INACTIVEBORDER = 11
Global Const $COLOR_APPWORKSPACE = 12
Global Const $COLOR_HIGHLIGHT = 13
Global Const $COLOR_HIGHLIGHTTEXT = 14
Global Const $COLOR_BTNFACE = 15
Global Const $COLOR_BTNSHADOW = 16
Global Const $COLOR_GRAYTEXT = 17
Global Const $COLOR_BTNTEXT = 18
Global Const $COLOR_INACTIVECAPTIONTEXT = 19
Global Const $COLOR_BTNHIGHLIGHT = 20
Global Const $COLOR_3DDKSHADOW = 21
Global Const $COLOR_3DLIGHT = 22
Global Const $COLOR_INFOTEXT = 23
Global Const $COLOR_INFOBK = 24
Global Const $COLOR_HOTLIGHT = 26
Global Const $COLOR_GRADIENTACTIVECAPTION = 27
Global Const $COLOR_GRADIENTINACTIVECAPTION = 28
Global Const $COLOR_MENUHILIGHT = 29
Global Const $COLOR_MENUBAR = 30
Global Const $COLOR_DESKTOP = 1
Global Const $COLOR_3DFACE = 15
Global Const $COLOR_3DSHADOW = 16
Global Const $COLOR_3DHIGHLIGHT = 20
Global Const $COLOR_3DHILIGHT = 20
Global Const $COLOR_BTNHILIGHT = 20
Global Const $HINST_COMMCTRL = -1
Global Const $IDB_STD_SMALL_COLOR = 0
Global Const $IDB_STD_LARGE_COLOR = 1
Global Const $IDB_VIEW_SMALL_COLOR = 4
Global Const $IDB_VIEW_LARGE_COLOR = 5
Global Const $IDB_HIST_SMALL_COLOR = 8
Global Const $IDB_HIST_LARGE_COLOR = 9
Global Const $STARTF_FORCEOFFFEEDBACK = 128
Global Const $STARTF_FORCEONFEEDBACK = 64
Global Const $STARTF_RUNFULLSCREEN = 32
Global Const $STARTF_USECOUNTCHARS = 8
Global Const $STARTF_USEFILLATTRIBUTE = 16
Global Const $STARTF_USEHOTKEY = 512
Global Const $STARTF_USEPOSITION = 4
Global Const $STARTF_USESHOWWINDOW = 1
Global Const $STARTF_USESIZE = 2
Global Const $STARTF_USESTDHANDLES = 256
Global Const $OPT_COORDSRELATIVE = 0
Global Const $OPT_COORDSABSOLUTE = 1
Global Const $OPT_COORDSCLIENT = 2
Global Const $OPT_ERRORSILENT = 0
Global Const $OPT_ERRORFATAL = 1
Global Const $OPT_CAPSNOSTORE = 0
Global Const $OPT_CAPSSTORE = 1
Global Const $OPT_MATCHSTART = 1
Global Const $OPT_MATCHANY = 2
Global Const $OPT_MATCHEXACT = 3
Global Const $OPT_MATCHADVANCED = 4
Global Const $CCS_TOP = 1
Global Const $CCS_NOMOVEY = 2
Global Const $CCS_BOTTOM = 3
Global Const $CCS_NORESIZE = 4
Global Const $CCS_NOPARENTALIGN = 8
Global Const $CCS_NOHILITE = 16
Global Const $CCS_ADJUSTABLE = 32
Global Const $CCS_NODIVIDER = 64
Global Const $CCS_VERT = 128
Global Const $CCS_LEFT = 129
Global Const $CCS_NOMOVEX = 130
Global Const $CCS_RIGHT = 131
Global Const $DI_MASK = 1
Global Const $DI_IMAGE = 2
Global Const $DI_NORMAL = 3
Global Const $DI_COMPAT = 4
Global Const $DI_DEFAULTSIZE = 8
Global Const $DI_NOMIRROR = 16
Global Const $DISPLAY_DEVICE_ATTACHED_TO_DESKTOP = 1
Global Const $DISPLAY_DEVICE_MULTI_DRIVER = 2
Global Const $DISPLAY_DEVICE_PRIMARY_DEVICE = 4
Global Const $DISPLAY_DEVICE_MIRRORING_DRIVER = 8
Global Const $DISPLAY_DEVICE_VGA_COMPATIBLE = 16
Global Const $DISPLAY_DEVICE_REMOVABLE = 32
Global Const $DISPLAY_DEVICE_DISCONNECT = 33554432
Global Const $DISPLAY_DEVICE_REMOTE = 67108864
Global Const $DISPLAY_DEVICE_MODESPRUNED = 134217728
Global Const $EVENTLOG_SUCCESS = 0
Global Const $EVENTLOG_ERROR_TYPE = 1
Global Const $EVENTLOG_WARNING_TYPE = 2
Global Const $EVENTLOG_INFORMATION_TYPE = 4
Global Const $EVENTLOG_AUDIT_SUCCESS = 8
Global Const $EVENTLOG_AUDIT_FAILURE = 16
Global Const $EVENTLOG_SEQUENTIAL_READ = 1
Global Const $EVENTLOG_SEEK_READ = 2
Global Const $EVENTLOG_FORWARDS_READ = 4
Global Const $EVENTLOG_BACKWARDS_READ = 8
Global Const $DDL_ARCHIVE = 32
Global Const $DDL_DIRECTORY = 16
Global Const $DDL_DRIVES = 16384
Global Const $DDL_EXCLUSIVE = 32768
Global Const $DDL_HIDDEN = 2
Global Const $DDL_READONLY = 1
Global Const $DDL_READWRITE = 0
Global Const $DDL_SYSTEM = 4
Global Const $FC_NOOVERWRITE = 0
Global Const $FC_OVERWRITE = 1
Global Const $FT_MODIFIED = 0
Global Const $FT_CREATED = 1
Global Const $FT_ACCESSED = 2
Global Const $FO_READ = 0
Global Const $FO_APPEND = 1
Global Const $FO_OVERWRITE = 2
Global Const $FO_BINARY = 16
Global Const $FO_UNICODE = 32
Global Const $FO_UTF16_LE = 32
Global Const $FO_UTF16_BE = 64
Global Const $FO_UTF8 = 128
Global Const $EOF = -1
Global Const $FD_FILEMUSTEXIST = 1
Global Const $FD_PATHMUSTEXIST = 2
Global Const $FD_MULTISELECT = 4
Global Const $FD_PROMPTCREATENEW = 8
Global Const $FD_PROMPTOVERWRITE = 16
Global Const $CREATE_NEW = 1
Global Const $CREATE_ALWAYS = 2
Global Const $OPEN_EXISTING = 3
Global Const $OPEN_ALWAYS = 4
Global Const $TRUNCATE_EXISTING = 5
Global Const $FILE_ATTRIBUTE_READONLY = 1
Global Const $FILE_ATTRIBUTE_HIDDEN = 2
Global Const $FILE_ATTRIBUTE_SYSTEM = 4
Global Const $FILE_ATTRIBUTE_DIRECTORY = 16
Global Const $FILE_ATTRIBUTE_ARCHIVE = 32
Global Const $FILE_ATTRIBUTE_DEVICE = 64
Global Const $FILE_ATTRIBUTE_NORMAL = 128
Global Const $FILE_ATTRIBUTE_TEMPORARY = 256
Global Const $FILE_ATTRIBUTE_SPARSE_FILE = 512
Global Const $FILE_ATTRIBUTE_REPARSE_POINT = 1024
Global Const $FILE_ATTRIBUTE_COMPRESSED = 2048
Global Const $FILE_ATTRIBUTE_OFFLINE = 4096
Global Const $FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192
Global Const $FILE_ATTRIBUTE_ENCRYPTED = 16384
Global Const $FILE_SHARE_READ = 1
Global Const $FILE_SHARE_WRITE = 2
Global Const $FILE_SHARE_DELETE = 4
Global Const $GENERIC_ALL = 268435456
Global Const $GENERIC_EXECUTE = 536870912
Global Const $GENERIC_WRITE = 1073741824
Global Const $GENERIC_READ = -2147483648
Global Const $FLASHW_CAPTION = 1
Global Const $FLASHW_TRAY = 2
Global Const $FLASHW_TIMER = 4
Global Const $FLASHW_TIMERNOFG = 12
Global Const $FORMAT_MESSAGE_ALLOCATE_BUFFER = 256
Global Const $FORMAT_MESSAGE_IGNORE_INSERTS = 512
Global Const $FORMAT_MESSAGE_FROM_STRING = 1024
Global Const $FORMAT_MESSAGE_FROM_HMODULE = 2048
Global Const $FORMAT_MESSAGE_FROM_SYSTEM = 4096
Global Const $FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192
Global Const $GW_HWNDFIRST = 0
Global Const $GW_HWNDLAST = 1
Global Const $GW_HWNDNEXT = 2
Global Const $GW_HWNDPREV = 3
Global Const $GW_OWNER = 4
Global Const $GW_CHILD = 5
Global Const $GWL_WNDPROC = -4
Global Const $GWL_HINSTANCE = -6
Global Const $GWL_HWNDPARENT = -8
Global Const $GWL_ID = -12
Global Const $GWL_STYLE = -16
Global Const $GWL_EXSTYLE = -20
Global Const $GWL_USERDATA = -21
Global Const $STD_CUT = 0
Global Const $STD_COPY = 1
Global Const $STD_PASTE = 2
Global Const $STD_UNDO = 3
Global Const $STD_REDOW = 4
Global Const $STD_DELETE = 5
Global Const $STD_FILENEW = 6
Global Const $STD_FILEOPEN = 7
Global Const $STD_FILESAVE = 8
Global Const $STD_PRINTPRE = 9
Global Const $STD_PROPERTIES = 10
Global Const $STD_HELP = 11
Global Const $STD_FIND = 12
Global Const $STD_REPLACE = 13
Global Const $STD_PRINT = 14
Global Const $LR_DEFAULTCOLOR = 0
Global Const $LR_MONOCHROME = 1
Global Const $LR_COLOR = 2
Global Const $LR_COPYRETURNORG = 4
Global Const $LR_COPYDELETEORG = 8
Global Const $LR_LOADFROMFILE = 16
Global Const $LR_LOADTRANSPARENT = 32
Global Const $LR_DEFAULTSIZE = 64
Global Const $LR_VGACOLOR = 128
Global Const $LR_LOADMAP3DCOLORS = 4096
Global Const $LR_CREATEDIBSECTION = 8192
Global Const $LR_COPYFROMRESOURCE = 16384
Global Const $LR_SHARED = 32768
Global Const $IMAGE_BITMAP = 0
Global Const $IMAGE_ICON = 1
Global Const $IMAGE_CURSOR = 2
Global Const $KB_SENDSPECIAL = 0
Global Const $KB_SENDRAW = 1
Global Const $KB_CAPSOFF = 0
Global Const $KB_CAPSON = 1
Global Const $DONT_RESOLVE_DLL_REFERENCES = 1
Global Const $LOAD_LIBRARY_AS_DATAFILE = 2
Global Const $LOAD_WITH_ALTERED_SEARCH_PATH = 8
Global Const $OBJID_WINDOW = 0
Global Const $OBJID_SYSMENU = -1
Global Const $OBJID_TITLEBAR = -2
Global Const $OBJID_MENU = -3
Global Const $OBJID_CLIENT = -4
Global Const $OBJID_VSCROLL = -5
Global Const $OBJID_HSCROLL = -6
Global Const $OBJID_SIZEGRIP = -7
Global Const $OBJID_CARET = -8
Global Const $OBJID_CURSOR = -9
Global Const $OBJID_ALERT = -10
Global Const $OBJID_SOUND = -11
Global Const $VK_DOWN = 40
Global Const $VK_END = 35
Global Const $VK_HOME = 36
Global Const $VK_LEFT = 37
Global Const $VK_NEXT = 34
Global Const $VK_PRIOR = 33
Global Const $VK_RIGHT = 39
Global Const $VK_UP = 38
Global Const $MB_OK = 0
Global Const $MB_OKCANCEL = 1
Global Const $MB_ABORTRETRYIGNORE = 2
Global Const $MB_YESNOCANCEL = 3
Global Const $MB_YESNO = 4
Global Const $MB_RETRYCANCEL = 5
Global Const $MB_ICONHAND = 16
Global Const $MB_ICONQUESTION = 32
Global Const $MB_ICONEXCLAMATION = 48
Global Const $MB_ICONASTERISK = 64
Global Const $MB_DEFBUTTON1 = 0
Global Const $MB_DEFBUTTON2 = 256
Global Const $MB_DEFBUTTON3 = 512
Global Const $MB_APPLMODAL = 0
Global Const $MB_SYSTEMMODAL = 4096
Global Const $MB_TASKMODAL = 8192
Global Const $MB_TOPMOST = 262144
Global Const $MB_RIGHTJUSTIFIED = 524288
Global Const $IDTIMEOUT = -1
Global Const $IDOK = 1
Global Const $IDCANCEL = 2
Global Const $IDABORT = 3
Global Const $IDRETRY = 4
Global Const $IDIGNORE = 5
Global Const $IDYES = 6
Global Const $IDNO = 7
Global Const $IDTRYAGAIN = 10
Global Const $IDCONTINUE = 11
Global Const $DLG_NOTITLE = 1
Global Const $DLG_NOTONTOP = 2
Global Const $DLG_TEXTLEFT = 4
Global Const $DLG_TEXTRIGHT = 8
Global Const $DLG_MOVEABLE = 16
Global Const $DLG_TEXTVCENTER = 32
Global Const $TIP_ICONNONE = 0
Global Const $TIP_ICONASTERISK = 1
Global Const $TIP_ICONEXCLAMATION = 2
Global Const $TIP_ICONHAND = 3
Global Const $TIP_NOSOUND = 16
Global Const $IDC_UNKNOWN = 0
Global Const $IDC_APPSTARTING = 1
Global Const $IDC_ARROW = 2
Global Const $IDC_CROSS = 3
Global Const $IDC_HELP = 4
Global Const $IDC_IBEAM = 5
Global Const $IDC_ICON = 6
Global Const $IDC_NO = 7
Global Const $IDC_SIZE = 8
Global Const $IDC_SIZEALL = 9
Global Const $IDC_SIZENESW = 10
Global Const $IDC_SIZENS = 11
Global Const $IDC_SIZENWSE = 12
Global Const $IDC_SIZEWE = 13
Global Const $IDC_UPARROW = 14
Global Const $IDC_WAIT = 15
Global Const $SD_LOGOFF = 0
Global Const $SD_SHUTDOWN = 1
Global Const $SD_REBOOT = 2
Global Const $SD_FORCE = 4
Global Const $SD_POWERDOWN = 8
Global Const $PROCESS_TERMINATE = 1
Global Const $PROCESS_CREATE_THREAD = 2
Global Const $PROCESS_SET_SESSIONID = 4
Global Const $PROCESS_VM_OPERATION = 8
Global Const $PROCESS_VM_READ = 16
Global Const $PROCESS_VM_WRITE = 32
Global Const $PROCESS_DUP_HANDLE = 64
Global Const $PROCESS_CREATE_PROCESS = 128
Global Const $PROCESS_SET_QUOTA = 256
Global Const $PROCESS_SET_INFORMATION = 512
Global Const $PROCESS_QUERY_INFORMATION = 1024
Global Const $PROCESS_SUSPEND_RESUME = 2048
Global Const $PROCESS_ALL_ACCESS = 2035711
Global Const $STR_NOCASESENSE = 0
Global Const $STR_CASESENSE = 1
Global Const $STR_STRIPLEADING = 1
Global Const $STR_STRIPTRAILING = 2
Global Const $STR_STRIPSPACES = 4
Global Const $STR_STRIPALL = 8
Global Const $TOKEN_ASSIGN_PRIMARY = 1
Global Const $TOKEN_DUPLICATE = 2
Global Const $TOKEN_IMPERSONATE = 4
Global Const $TOKEN_QUERY = 8
Global Const $TOKEN_QUERY_SOURCE = 16
Global Const $TOKEN_ADJUST_PRIVILEGES = 32
Global Const $TOKEN_ADJUST_GROUPS = 64
Global Const $TOKEN_ADJUST_DEFAULT = 128
Global Const $TOKEN_ADJUST_SESSIONID = 256
Global Const $TRAY_ITEM_EXIT = 3
Global Const $TRAY_ITEM_PAUSE = 4
Global Const $TRAY_ITEM_FIRST = 7
Global Const $TRAY_CHECKED = 1
Global Const $TRAY_UNCHECKED = 4
Global Const $TRAY_ENABLE = 64
Global Const $TRAY_DISABLE = 128
Global Const $TRAY_FOCUS = 256
Global Const $TRAY_DEFAULT = 512
Global Const $TRAY_EVENT_SHOWICON = -3
Global Const $TRAY_EVENT_HIDEICON = -4
Global Const $TRAY_EVENT_FLASHICON = -5
Global Const $TRAY_EVENT_NOFLASHICON = -6
Global Const $TRAY_EVENT_PRIMARYDOWN = -7
Global Const $TRAY_EVENT_PRIMARYUP = -8
Global Const $TRAY_EVENT_SECONDARYDOWN = -9
Global Const $TRAY_EVENT_SECONDARYUP = -10
Global Const $TRAY_EVENT_MOUSEOVER = -11
Global Const $TRAY_EVENT_MOUSEOUT = -12
Global Const $TRAY_EVENT_PRIMARYDOUBLE = -13
Global Const $TRAY_EVENT_SECONDARYDOUBLE = -14
Global Const $STDIN_CHILD = 1
Global Const $STDOUT_CHILD = 2
Global Const $STDERR_CHILD = 4
Global Const $COLOR_AQUA = 65535
Global Const $COLOR_BLACK = 0
Global Const $COLOR_BLUE = 255
Global Const $COLOR_CREAM = 16776176
Global Const $COLOR_FUCHSIA = 16711935
Global Const $COLOR_GRAY = 8421504
Global Const $COLOR_GREEN = 32768
Global Const $COLOR_LIME = 65280
Global Const $COLOR_MAROON = 9116770
Global Const $COLOR_MEDBLUE = 708
Global Const $COLOR_MEDGRAY = 10526884
Global Const $COLOR_MONEYGREEN = 12639424
Global Const $COLOR_NAVY = 128
Global Const $COLOR_OLIVE = 8421376
Global Const $COLOR_PURPLE = 8388736
Global Const $COLOR_RED = 16711680
Global Const $COLOR_SILVER = 12632256
Global Const $COLOR_SKYBLUE = 10930928
Global Const $COLOR_TEAL = 32896
Global Const $COLOR_WHITE = 16777215
Global Const $COLOR_YELLOW = 16776960
Global Const $CLR_NONE = -1
Global Const $CLR_AQUA = 16776960
Global Const $CLR_BLACK = 0
Global Const $CLR_BLUE = 16711680
Global Const $CLR_CREAM = 15793151
Global Const $CLR_DEFAULT = -16777216
Global Const $CLR_FUCHSIA = 16711935
Global Const $CLR_GRAY = 8421504
Global Const $CLR_GREEN = 32768
Global Const $CLR_LIME = 65280
Global Const $CLR_MAROON = 6429835
Global Const $CLR_MEDBLUE = 12845568
Global Const $CLR_MEDGRAY = 10789024
Global Const $CLR_MONEYGREEN = 12639424
Global Const $CLR_NAVY = 8388608
Global Const $CLR_OLIVE = 32896
Global Const $CLR_PURPLE = 8388736
Global Const $CLR_RED = 255
Global Const $CLR_SILVER = 12632256
Global Const $CLR_SKYBLUE = 15780518
Global Const $CLR_TEAL = 8421376
Global Const $CLR_WHITE = 16777215
Global Const $CLR_YELLOW = 65535
Global Const $CC_ANYCOLOR = 256
Global Const $CC_FULLOPEN = 2
Global Const $CC_RGBINIT = 1
Global Const $REG_NONE = 0
Global Const $REG_SZ = 1
Global Const $REG_EXPAND_SZ = 2
Global Const $REG_BINARY = 3
Global Const $REG_DWORD = 4
Global Const $REG_DWORD_BIG_ENDIAN = 5
Global Const $REG_LINK = 6
Global Const $REG_MULTI_SZ = 7
Global Const $REG_RESOURCE_LIST = 8
Global Const $REG_FULL_RESOURCE_DESCRIPTOR = 9
Global Const $REG_RESOURCE_REQUIREMENTS_LIST = 10
Global Const $SWP_NOSIZE = 1
Global Const $SWP_NOMOVE = 2
Global Const $SWP_NOZORDER = 4
Global Const $SWP_NOREDRAW = 8
Global Const $SWP_NOACTIVATE = 16
Global Const $SWP_FRAMECHANGED = 32
Global Const $SWP_DRAWFRAME = 32
Global Const $SWP_SHOWWINDOW = 64
Global Const $SWP_HIDEWINDOW = 128
Global Const $SWP_NOCOPYBITS = 256
Global Const $SWP_NOOWNERZORDER = 512
Global Const $SWP_NOREPOSITION = 512
Global Const $SWP_NOSENDCHANGING = 1024
Global Const $SWP_DEFERERASE = 8192
Global Const $SWP_ASYNCWINDOWPOS = 16384
Global Const $FW_DONTCARE = 0
Global Const $FW_THIN = 100
Global Const $FW_EXTRALIGHT = 200
Global Const $FW_ULTRALIGHT = 200
Global Const $FW_LIGHT = 300
Global Const $FW_NORMAL = 400
Global Const $FW_REGULAR = 400
Global Const $FW_MEDIUM = 500
Global Const $FW_SEMIBOLD = 600
Global Const $FW_DEMIBOLD = 600
Global Const $FW_BOLD = 700
Global Const $FW_EXTRABOLD = 800
Global Const $FW_ULTRABOLD = 800
Global Const $FW_HEAVY = 900
Global Const $FW_BLACK = 900
Global Const $PROOF_QUALITY = 2
Global Const $CF_EFFECTS = 256
Global Const $CF_PRINTERFONTS = 2
Global Const $CF_SCREENFONTS = 1
Global Const $CF_NOSCRIPTSEL = 8388608
Global Const $CF_INITTOLOGFONTSTRUCT = 64
Global Const $DEFAULT_PITCH = 0
Global Const $FF_DONTCARE = 0
Global Const $LOGPIXELSX = 88
Global Const $LOGPIXELSY = 90
Global Const $SB_THUMBPOSITION = 4
Global Const $SB_THUMBTRACK = 5
Global Const $LANG_AFRIKAANS = 54
Global Const $LANG_ALBANIAN = 28
Global Const $LANG_ARABIC = 1
Global Const $LANG_ARMENIAN = 43
Global Const $LANG_ASSAMESE = 77
Global Const $LANG_AZERI = 44
Global Const $LANG_BASQUE = 45
Global Const $LANG_BELARUSIAN = 35
Global Const $LANG_BENGALI = 69
Global Const $LANG_BULGARIAN = 2
Global Const $LANG_CATALAN = 3
Global Const $LANG_CHINESE = 4
Global Const $LANG_CROATIAN = 26
Global Const $LANG_CZECH = 5
Global Const $LANG_DANISH = 6
Global Const $LANG_DUTCH = 19
Global Const $LANG_ENGLISH = 9
Global Const $LANG_ESTONIAN = 37
Global Const $LANG_FAEROESE = 56
Global Const $LANG_FARSI = 41
Global Const $LANG_FINNISH = 11
Global Const $LANG_FRENCH = 12
Global Const $LANG_GEORGIAN = 55
Global Const $LANG_GERMAN = 7
Global Const $LANG_GREEK = 8
Global Const $LANG_GUJARATI = 71
Global Const $LANG_HEBREW = 13
Global Const $LANG_HINDI = 57
Global Const $LANG_HUNGARIAN = 14
Global Const $LANG_ICELANDIC = 15
Global Const $LANG_INDONESIAN = 33
Global Const $LANG_ITALIAN = 16
Global Const $LANG_JAPANESE = 17
Global Const $LANG_KANNADA = 75
Global Const $LANG_KASHMIRI = 96
Global Const $LANG_KAZAK = 63
Global Const $LANG_KONKANI = 87
Global Const $LANG_KOREAN = 18
Global Const $LANG_LATVIAN = 38
Global Const $LANG_LITHUANIAN = 39
Global Const $LANG_MACEDONIAN = 47
Global Const $LANG_MALAY = 62
Global Const $LANG_MALAYALAM = 76
Global Const $LANG_MANIPURI = 88
Global Const $LANG_MARATHI = 78
Global Const $LANG_NEPALI = 97
Global Const $LANG_NEUTRAL = 0
Global Const $LANG_NORWEGIAN = 20
Global Const $LANG_ORIYA = 72
Global Const $LANG_POLISH = 21
Global Const $LANG_PORTUGUESE = 22
Global Const $LANG_PUNJABI = 70
Global Const $LANG_ROMANIAN = 24
Global Const $LANG_RUSSIAN = 25
Global Const $LANG_SANSKRIT = 79
Global Const $LANG_SERBIAN = 26
Global Const $LANG_SINDHI = 89
Global Const $LANG_SLOVAK = 27
Global Const $LANG_SLOVENIAN = 36
Global Const $LANG_SPANISH = 10
Global Const $LANG_SWAHILI = 65
Global Const $LANG_SWEDISH = 29
Global Const $LANG_TAMIL = 73
Global Const $LANG_TATAR = 68
Global Const $LANG_TELUGU = 74
Global Const $LANG_THAI = 30
Global Const $LANG_TURKISH = 31
Global Const $LANG_UKRAINIAN = 34
Global Const $LANG_URDU = 32
Global Const $LANG_UZBEK = 67
Global Const $LANG_VIETNAMESE = 42
Global Const $SUBLANG_ARABIC_ALGERIA = 5
Global Const $SUBLANG_ARABIC_BAHRAIN = 15
Global Const $SUBLANG_ARABIC_EGYPT = 3
Global Const $SUBLANG_ARABIC_IRAQ = 2
Global Const $SUBLANG_ARABIC_JORDAN = 11
Global Const $SUBLANG_ARABIC_KUWAIT = 13
Global Const $SUBLANG_ARABIC_LEBANON = 12
Global Const $SUBLANG_ARABIC_LIBYA = 4
Global Const $SUBLANG_ARABIC_MOROCCO = 6
Global Const $SUBLANG_ARABIC_OMAN = 8
Global Const $SUBLANG_ARABIC_QATAR = 16
Global Const $SUBLANG_ARABIC_SAUDI_ARABIA = 1
Global Const $SUBLANG_ARABIC_SYRIA = 10
Global Const $SUBLANG_ARABIC_TUNISIA = 7
Global Const $SUBLANG_ARABIC_UAE = 14
Global Const $SUBLANG_ARABIC_YEMEN = 9
Global Const $SUBLANG_AZERI_CYRILLIC = 2
Global Const $SUBLANG_AZERI_LATIN = 1
Global Const $SUBLANG_CHINESE_HONGKONG = 3
Global Const $SUBLANG_CHINESE_MACAU = 5
Global Const $SUBLANG_CHINESE_SIMPLIFIED = 2
Global Const $SUBLANG_CHINESE_SINGAPORE = 4
Global Const $SUBLANG_CHINESE_TRADITIONAL = 1
Global Const $SUBLANG_DEFAULT = 1
Global Const $SUBLANG_DUTCH = 1
Global Const $SUBLANG_DUTCH_BELGIAN = 2
Global Const $SUBLANG_ENGLISH_AUS = 3
Global Const $SUBLANG_ENGLISH_BELIZE = 10
Global Const $SUBLANG_ENGLISH_CAN = 4
Global Const $SUBLANG_ENGLISH_CARIBBEAN = 9
Global Const $SUBLANG_ENGLISH_EIRE = 6
Global Const $SUBLANG_ENGLISH_JAMAICA = 8
Global Const $SUBLANG_ENGLISH_NZ = 5
Global Const $SUBLANG_ENGLISH_PHILIPPINES = 13
Global Const $SUBLANG_ENGLISH_SOUTH_AFRICA = 7
Global Const $SUBLANG_ENGLISH_TRINIDAD = 11
Global Const $SUBLANG_ENGLISH_UK = 2
Global Const $SUBLANG_ENGLISH_US = 1
Global Const $SUBLANG_ENGLISH_ZIMBABWE = 12
Global Const $SUBLANG_FRENCH = 1
Global Const $SUBLANG_FRENCH_BELGIAN = 2
Global Const $SUBLANG_FRENCH_CANADIAN = 3
Global Const $SUBLANG_FRENCH_LUXEMBOURG = 5
Global Const $SUBLANG_FRENCH_MONACO = 6
Global Const $SUBLANG_FRENCH_SWISS = 4
Global Const $SUBLANG_GERMAN = 1
Global Const $SUBLANG_GERMAN_AUSTRIAN = 3
Global Const $SUBLANG_GERMAN_LIECHTENSTEIN = 5
Global Const $SUBLANG_GERMAN_LUXEMBOURG = 4
Global Const $SUBLANG_GERMAN_SWISS = 2
Global Const $SUBLANG_ITALIAN = 1
Global Const $SUBLANG_ITALIAN_SWISS = 2
Global Const $SUBLANG_KASHMIRI_INDIA = 2
Global Const $SUBLANG_KOREAN = 1
Global Const $SUBLANG_LITHUANIAN = 1
Global Const $SUBLANG_MALAY_BRUNEI_DARUSSALAM = 2
Global Const $SUBLANG_MALAY_MALAYSIA = 1
Global Const $SUBLANG_NEPALI_INDIA = 2
Global Const $SUBLANG_NEUTRAL = 0
Global Const $SUBLANG_NORWEGIAN_BOKMAL = 1
Global Const $SUBLANG_NORWEGIAN_NYNORSK = 2
Global Const $SUBLANG_PORTUGUESE = 2
Global Const $SUBLANG_PORTUGUESE_BRAZILIAN = 1
Global Const $SUBLANG_SERBIAN_CYRILLIC = 3
Global Const $SUBLANG_SERBIAN_LATIN = 2
Global Const $SUBLANG_SPANISH = 1
Global Const $SUBLANG_SPANISH_ARGENTINA = 11
Global Const $SUBLANG_SPANISH_BOLIVIA = 16
Global Const $SUBLANG_SPANISH_CHILE = 13
Global Const $SUBLANG_SPANISH_COLOMBIA = 9
Global Const $SUBLANG_SPANISH_COSTA_RICA = 5
Global Const $SUBLANG_SPANISH_DOMINICAN_REPUBLIC = 7
Global Const $SUBLANG_SPANISH_ECUADOR = 12
Global Const $SUBLANG_SPANISH_EL_SALVADOR = 17
Global Const $SUBLANG_SPANISH_GUATEMALA = 4
Global Const $SUBLANG_SPANISH_HONDURAS = 18
Global Const $SUBLANG_SPANISH_MEXICAN = 2
Global Const $SUBLANG_SPANISH_MODERN = 3
Global Const $SUBLANG_SPANISH_NICARAGUA = 19
Global Const $SUBLANG_SPANISH_PANAMA = 6
Global Const $SUBLANG_SPANISH_PARAGUAY = 15
Global Const $SUBLANG_SPANISH_PERU = 10
Global Const $SUBLANG_SPANISH_PUERTO_RICO = 20
Global Const $SUBLANG_SPANISH_URUGUAY = 14
Global Const $SUBLANG_SPANISH_VENEZUELA = 8
Global Const $SUBLANG_SWEDISH = 1
Global Const $SUBLANG_SWEDISH_FINLAND = 2
Global Const $SUBLANG_SYS_DEFAULT = 2
Global Const $SUBLANG_URDU_INDIA = 2
Global Const $SUBLANG_URDU_PAKISTAN = 1
Global Const $SUBLANG_UZBEK_CYRILLIC = 2
Global Const $SORT_DEFAULT = 0
Global Const $SORT_JAPANESE_XJIS = 0
Global Const $SORT_JAPANESE_UNICODE = 1
Global Const $SORT_CHINESE_BIG5 = 0
Global Const $SORT_CHINESE_PRCP = 0
Global Const $SORT_CHINESE_UNICODE = 1
Global Const $SORT_CHINESE_PRC = 2
Global Const $SORT_KOREAN_KSC = 0
Global Const $SORT_KOREAN_UNICODE = 1
Global Const $SORT_GERMAN_PHONE_BOOK = 1
Global Const $SORT_HUNGARIAN_DEFAULT = 0
Global Const $SORT_HUNGARIAN_TECHNICAL = 1
Global Const $SORT_GEORGIAN_TRADITIONAL = 0
Global Const $SORT_GEORGIAN_MODERN = 1
Global Const $CB_ERR = -1
Global Const $CB_ERRATTRIBUTE = -3
Global Const $CB_ERRREQUIRED = -4
Global Const $CB_ERRSPACE = -2
Global Const $CB_OKAY = 0
Global Const $STATE_SYSTEM_INVISIBLE = 32768
Global Const $STATE_SYSTEM_PRESSED = 8
Global Const $CB_DDL_ARCHIVE = 32
Global Const $CB_DDL_DIRECTORY = 16
Global Const $CB_DDL_DRIVES = 16384
Global Const $CB_DDL_EXCLUSIVE = 32768
Global Const $CB_DDL_HIDDEN = 2
Global Const $CB_DDL_READONLY = 1
Global Const $CB_DDL_READWRITE = 0
Global Const $CB_DDL_SYSTEM = 4
Global Const $CBS_AUTOHSCROLL = 64
Global Const $CBS_DISABLENOSCROLL = 2048
Global Const $CBS_DROPDOWN = 2
Global Const $CBS_DROPDOWNLIST = 3
Global Const $CBS_HASSTRINGS = 512
Global Const $CBS_LOWERCASE = 16384
Global Const $CBS_NOINTEGRALHEIGHT = 1024
Global Const $CBS_OEMCONVERT = 128
Global Const $CBS_OWNERDRAWFIXED = 16
Global Const $CBS_OWNERDRAWVARIABLE = 32
Global Const $CBS_SIMPLE = 1
Global Const $CBS_SORT = 256
Global Const $CBS_UPPERCASE = 8192
Global Const $CB_ADDSTRING = 323
Global Const $CB_DELETESTRING = 324
Global Const $CB_DIR = 325
Global Const $CB_FINDSTRING = 332
Global Const $CB_FINDSTRINGEXACT = 344
Global Const $CB_GETCOMBOBOXINFO = 356
Global Const $CB_GETCOUNT = 326
Global Const $CB_GETCURSEL = 327
Global Const $CB_GETDROPPEDCONTROLRECT = 338
Global Const $CB_GETDROPPEDSTATE = 343
Global Const $CB_GETDROPPEDWIDTH = 351
Global Const $CB_GETEDITSEL = 320
Global Const $CB_GETEXTENDEDUI = 342
Global Const $CB_GETHORIZONTALEXTENT = 349
Global Const $CB_GETITEMDATA = 336
Global Const $CB_GETITEMHEIGHT = 340
Global Const $CB_GETLBTEXT = 328
Global Const $CB_GETLBTEXTLEN = 329
Global Const $CB_GETLOCALE = 346
Global Const $CB_GETMINVISIBLE = 5890
Global Const $CB_GETTOPINDEX = 347
Global Const $CB_INITSTORAGE = 353
Global Const $CB_LIMITTEXT = 321
Global Const $CB_RESETCONTENT = 331
Global Const $CB_INSERTSTRING = 330
Global Const $CB_SELECTSTRING = 333
Global Const $CB_SETCURSEL = 334
Global Const $CB_SETDROPPEDWIDTH = 352
Global Const $CB_SETEDITSEL = 322
Global Const $CB_SETEXTENDEDUI = 341
Global Const $CB_SETHORIZONTALEXTENT = 350
Global Const $CB_SETITEMDATA = 337
Global Const $CB_SETITEMHEIGHT = 339
Global Const $CB_SETLOCALE = 21
Global Const $CB_SETMINVISIBLE = 5889
Global Const $CB_SETTOPINDEX = 348
Global Const $CB_SHOWDROPDOWN = 335
Global Const $CBN_CLOSEUP = 8
Global Const $CBN_DBLCLK = 2
Global Const $CBN_DROPDOWN = 7
Global Const $CBN_EDITCHANGE = 5
Global Const $CBN_EDITUPDATE = 6
Global Const $CBN_ERRSPACE = (-1)
Global Const $CBN_KILLFOCUS = 4
Global Const $CBN_SELCHANGE = 1
Global Const $CBN_SELENDCANCEL = 10
Global Const $CBN_SELENDOK = 9
Global Const $CBN_SETFOCUS = 3
Global Const $CBES_EX_CASESENSITIVE = 16
Global Const $CBES_EX_NOEDITIMAGE = 1
Global Const $CBES_EX_NOEDITIMAGEINDENT = 2
Global Const $CBES_EX_NOSIZELIMIT = 8
Global Const $CBES_EX_PATHWORDBREAKPROC = 4
Global Const $CBEM_DELETEITEM = $CB_DELETESTRING
Global Const $CBEM_GETCOMBOCONTROL = ($WM_USER + 6)
Global Const $CBEM_GETEDITCONTROL = ($WM_USER + 7)
Global Const $CBEM_GETEXSTYLE = ($WM_USER + 9)
Global Const $CBEM_GETEXTENDEDSTYLE = ($WM_USER + 9)
Global Const $CBEM_GETIMAGELIST = ($WM_USER + 3)
Global Const $CBEM_GETITEMA = ($WM_USER + 4)
Global Const $CBEM_GETITEMW = ($WM_USER + 13)
Global Const $CBEM_GETUNICODEFORMAT = $CCM_GETUNICODEFORMAT
Global Const $CBEM_HASEDITCHANGED = ($WM_USER + 10)
Global Const $CBEM_INSERTITEMA = ($WM_USER + 1)
Global Const $CBEM_INSERTITEMW = ($WM_USER + 11)
Global Const $CBEM_SETEXSTYLE = ($WM_USER + 8)
Global Const $CBEM_SETEXTENDEDSTYLE = ($WM_USER + 14)
Global Const $CBEM_SETIMAGELIST = ($WM_USER + 2)
Global Const $CBEM_SETITEMA = ($WM_USER + 5)
Global Const $CBEM_SETITEMW = ($WM_USER + 12)
Global Const $CBEM_SETUNICODEFORMAT = $CCM_SETUNICODEFORMAT
Global Const $CBEM_SETWINDOWTHEME = $CCM_SETWINDOWTHEME
Global Const $CBEN_FIRST = (-800)
Global Const $CBEN_LAST = (-830)
Global Const $CBEN_BEGINEDIT = ($CBEN_FIRST - 4)
Global Const $CBEN_DELETEITEM = ($CBEN_FIRST - 2)
Global Const $CBEN_DRAGBEGINA = ($CBEN_FIRST - 8)
Global Const $CBEN_DRAGBEGINW = ($CBEN_FIRST - 9)
Global Const $CBEN_ENDEDITA = ($CBEN_FIRST - 5)
Global Const $CBEN_ENDEDITW = ($CBEN_FIRST - 6)
Global Const $CBEN_GETDISPINFO = ($CBEN_FIRST - 0)
Global Const $CBEN_GETDISPINFOA = ($CBEN_FIRST - 0)
Global Const $CBEN_GETDISPINFOW = ($CBEN_FIRST - 7)
Global Const $CBEN_INSERTITEM = ($CBEN_FIRST - 1)
Global Const $CBEIF_DI_SETITEM = 268435456
Global Const $CBEIF_IMAGE = 2
Global Const $CBEIF_INDENT = 16
Global Const $CBEIF_LPARAM = 32
Global Const $CBEIF_OVERLAY = 8
Global Const $CBEIF_SELECTEDIMAGE = 4
Global Const $CBEIF_TEXT = 1
Global Const $ES_LEFT = 0
Global Const $ES_CENTER = 1
Global Const $ES_RIGHT = 2
Global Const $ES_MULTILINE = 4
Global Const $ES_UPPERCASE = 8
Global Const $ES_LOWERCASE = 16
Global Const $ES_PASSWORD = 32
Global Const $ES_AUTOVSCROLL = 64
Global Const $ES_AUTOHSCROLL = 128
Global Const $ES_NOHIDESEL = 256
Global Const $ES_OEMCONVERT = 1024
Global Const $ES_READONLY = 2048
Global Const $ES_WANTRETURN = 4096
Global Const $ES_NUMBER = 8192
Global Const $EC_ERR = -1
Global Const $ECM_FIRST = 5376
Global Const $EM_CANUNDO = 198
Global Const $EM_CHARFROMPOS = 215
Global Const $EM_EMPTYUNDOBUFFER = 205
Global Const $EM_FMTLINES = 200
Global Const $EM_GETFIRSTVISIBLELINE = 206
Global Const $EM_GETHANDLE = 189
Global Const $EM_GETIMESTATUS = 217
Global Const $EM_GETLIMITTEXT = 213
Global Const $EM_GETLINE = 196
Global Const $EM_GETLINECOUNT = 186
Global Const $EM_GETMARGINS = 212
Global Const $EM_GETMODIFY = 184
Global Const $EM_GETPASSWORDCHAR = 210
Global Const $EM_GETRECT = 178
Global Const $EM_GETSEL = 176
Global Const $EM_GETTHUMB = 190
Global Const $EM_GETWORDBREAKPROC = 209
Global Const $EM_LIMITTEXT = 197
Global Const $EM_LINEFROMCHAR = 201
Global Const $EM_LINEINDEX = 187
Global Const $EM_LINELENGTH = 193
Global Const $EM_LINESCROLL = 182
Global Const $EM_POSFROMCHAR = 214
Global Const $EM_REPLACESEL = 194
Global Const $EM_SCROLL = 181
Global Const $EM_SCROLLCARET = 183
Global Const $EM_SETHANDLE = 188
Global Const $EM_SETIMESTATUS = 216
Global Const $EM_SETLIMITTEXT = $EM_LIMITTEXT
Global Const $EM_SETMARGINS = 211
Global Const $EM_SETMODIFY = 185
Global Const $EM_SETREADONLY = 207
Global Const $EM_SETRECT = 179
Global Const $EM_SETRECTNP = 180
Global Const $EM_SETSEL = 177
Global Const $EM_SETTABSTOPS = 203
Global Const $EM_SHOWBALLOONTIP = ($ECM_FIRST + 3)
Global Const $EM_UNDO = 199
Global Const $EM_SETWORDBREAKPROC = 208
Global Const $EC_LEFTMARGIN = 1
Global Const $EC_RIGHTMARGIN = 2
Global Const $EC_USEFONTINFO = 65535
Global Const $EMSIS_COMPOSITIONSTRING = 1
Global Const $EIMES_GETCOMPSTRATONCE = 1
Global Const $EIMES_CANCELCOMPSTRINFOCUS = 2
Global Const $EIMES_COMPLETECOMPSTRKILLFOCUS = 4
Global Const $EN_ALIGN_LTR_EC = 1792
Global Const $EN_ALIGN_RTL_EC = 1793
Global Const $EN_CHANGE = 768
Global Const $EN_ERRSPACE = 1280
Global Const $EN_HSCROLL = 1537
Global Const $EN_KILLFOCUS = 512
Global Const $EN_MAXTEXT = 1281
Global Const $EN_SETFOCUS = 256
Global Const $EN_UPDATE = 1024
Global Const $EN_VSCROLL = 1538
Global Const $TTI_ERROR = 3
Global Const $TTI_INFO = 1
Global Const $TTI_NONE = 0
Global Const $TTI_WARNING = 2
Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_EVENT_MINIMIZE = -4
Global Const $GUI_EVENT_RESTORE = -5
Global Const $GUI_EVENT_MAXIMIZE = -6
Global Const $GUI_EVENT_PRIMARYDOWN = -7
Global Const $GUI_EVENT_PRIMARYUP = -8
Global Const $GUI_EVENT_SECONDARYDOWN = -9
Global Const $GUI_EVENT_SECONDARYUP = -10
Global Const $GUI_EVENT_MOUSEMOVE = -11
Global Const $GUI_EVENT_RESIZED = -12
Global Const $GUI_EVENT_DROPPED = -13
Global Const $GUI_RUNDEFMSG = "GUI_RUNDEFMSG"
Global Const $GUI_AVISTOP = 0
Global Const $GUI_AVISTART = 1
Global Const $GUI_AVICLOSE = 2
Global Const $GUI_CHECKED = 1
Global Const $GUI_INDETERMINATE = 2
Global Const $GUI_UNCHECKED = 4
Global Const $GUI_DROPACCEPTED = 8
Global Const $GUI_NODROPACCEPTED = 4096
Global Const $GUI_ACCEPTFILES = $GUI_DROPACCEPTED
Global Const $GUI_SHOW = 16
Global Const $GUI_HIDE = 32
Global Const $GUI_ENABLE = 64
Global Const $GUI_DISABLE = 128
Global Const $GUI_FOCUS = 256
Global Const $GUI_NOFOCUS = 8192
Global Const $GUI_DEFBUTTON = 512
Global Const $GUI_EXPAND = 1024
Global Const $GUI_ONTOP = 2048
Global Const $GUI_FONTITALIC = 2
Global Const $GUI_FONTUNDER = 4
Global Const $GUI_FONTSTRIKE = 8
Global Const $GUI_DOCKAUTO = 1
Global Const $GUI_DOCKLEFT = 2
Global Const $GUI_DOCKRIGHT = 4
Global Const $GUI_DOCKHCENTER = 8
Global Const $GUI_DOCKTOP = 32
Global Const $GUI_DOCKBOTTOM = 64
Global Const $GUI_DOCKVCENTER = 128
Global Const $GUI_DOCKWIDTH = 256
Global Const $GUI_DOCKHEIGHT = 512
Global Const $GUI_DOCKSIZE = 768
Global Const $GUI_DOCKMENUBAR = 544
Global Const $GUI_DOCKSTATEBAR = 576
Global Const $GUI_DOCKALL = 802
Global Const $GUI_DOCKBORDERS = 102
Global Const $GUI_GR_CLOSE = 1
Global Const $GUI_GR_LINE = 2
Global Const $GUI_GR_BEZIER = 4
Global Const $GUI_GR_MOVE = 6
Global Const $GUI_GR_COLOR = 8
Global Const $GUI_GR_RECT = 10
Global Const $GUI_GR_ELLIPSE = 12
Global Const $GUI_GR_PIE = 14
Global Const $GUI_GR_DOT = 16
Global Const $GUI_GR_PIXEL = 18
Global Const $GUI_GR_HINT = 20
Global Const $GUI_GR_REFRESH = 22
Global Const $GUI_GR_PENSIZE = 24
Global Const $GUI_GR_NOBKCOLOR = -2
Global Const $GUI_BKCOLOR_DEFAULT = -1
Global Const $GUI_BKCOLOR_TRANSPARENT = -2
Global Const $GUI_BKCOLOR_LV_ALTERNATE = -33554432
Global Const $GUI_WS_EX_PARENTDRAG = 1048576
Global Const $SS_LEFT = 0
Global Const $SS_CENTER = 1
Global Const $SS_RIGHT = 2
Global Const $SS_ICON = 3
Global Const $SS_BLACKRECT = 4
Global Const $SS_GRAYRECT = 5
Global Const $SS_WHITERECT = 6
Global Const $SS_BLACKFRAME = 7
Global Const $SS_GRAYFRAME = 8
Global Const $SS_WHITEFRAME = 9
Global Const $SS_SIMPLE = 11
Global Const $SS_LEFTNOWORDWRAP = 12
Global Const $SS_BITMAP = 15
Global Const $SS_ETCHEDHORZ = 16
Global Const $SS_ETCHEDVERT = 17
Global Const $SS_ETCHEDFRAME = 18
Global Const $SS_NOPREFIX = 128
Global Const $SS_NOTIFY = 256
Global Const $SS_CENTERIMAGE = 512
Global Const $SS_RIGHTJUST = 1024
Global Const $SS_SUNKEN = 4096

Func _FILECOUNTLINES($SFILEPATH)
    Local $N = FileGetSize($SFILEPATH) - 1
    If @error Or $N = -1 Then Return 0
    Return StringLen(StringAddCR(FileRead($SFILEPATH, $N))) - $N + 1
EndFunc


Func _FILECREATE($SFILEPATH)
    Local $HOPENFILE
    Local $HWRITEFILE
    $HOPENFILE = FileOpen($SFILEPATH, 2)
    If $HOPENFILE = -1 Then
        SetError(1)
        Return 0
    EndIf
    $HWRITEFILE = FileWrite($HOPENFILE, "")
    If $HWRITEFILE = -1 Then
        SetError(2)
        Return 0
    EndIf
    FileClose($HOPENFILE)
    Return 1
EndFunc


Func _FILELISTTOARRAY($SPATH, $SFILTER = "*", $IFLAG = 0)
    Local $HSEARCH, $SFILE, $ASFILELIST[1]
    If Not FileExists($SPATH) Then Return SetError(1, 1, "")
    If (StringInStr($SFILTER, "\")) Or (StringInStr($SFILTER, "/")) Or (StringInStr($SFILTER, ":")) Or (StringInStr($SFILTER, ">")) Or (StringInStr($SFILTER, "<")) Or (StringInStr($SFILTER, "|")) Or (StringStripWS($SFILTER, 8) = "") Then Return SetError(2, 2, "")
    If Not ($IFLAG = 0 Or $IFLAG = 1 Or $IFLAG = 2) Then Return SetError(3, 3, "")
    $HSEARCH = FileFindFirstFile($SPATH & "\" & $SFILTER)
    If $HSEARCH = -1 Then Return SetError(4, 4, "")
    While 1
        $SFILE = FileFindNextFile($HSEARCH)
        If @error Then
            SetError(0)
            ExitLoop
        EndIf
        If $IFLAG = 1 And StringInStr(FileGetAttrib($SPATH & "\" & $SFILE), "D") <> 0 Then ContinueLoop
        If $IFLAG = 2 And StringInStr(FileGetAttrib($SPATH & "\" & $SFILE), "D") = 0 Then ContinueLoop
        ReDim $ASFILELIST[UBound($ASFILELIST) + 1]
        $ASFILELIST[0] = $ASFILELIST[0] + 1
        $ASFILELIST[UBound($ASFILELIST) - 1] = $SFILE
    WEnd
    FileClose($HSEARCH)
    Return $ASFILELIST
EndFunc


Func _FILEPRINT($S_FILE, $I_SHOW = @SW_HIDE)
    Local $A_RET = DllCall("shell32.dll", "long", "ShellExecute", "hwnd", 0, "string", "print", "string", $S_FILE, "string", "", "string", "", "int", $I_SHOW)
    If $A_RET[0] > 32 And Not @error Then
        Return 1
    Else
        SetError($A_RET[0])
        Return 0
    EndIf
EndFunc


Func _FILEREADTOARRAY($SFILEPATH, ByRef $AARRAY)
    Local $HFILE
    $HFILE = FileOpen($SFILEPATH, 0)
    If $HFILE = -1 Then
        SetError(1)
        Return 0
    EndIf
    $AARRAY = StringSplit(StringStripCR(FileRead($HFILE, FileGetSize($SFILEPATH))), @LF)
    FileClose($HFILE)
    Return 1
EndFunc


Func _FILEWRITEFROMARRAY($FILE, $A_ARRAY, $I_BASE = 0, $I_UBOUND = 0)
    If Not IsArray($A_ARRAY) Then Return SetError(2, 0, 0)
    Local $LAST = UBound($A_ARRAY) - 1
    If $I_UBOUND < 1 Or $I_UBOUND > $LAST Then $I_UBOUND = $LAST
    If $I_BASE < 0 Or $I_BASE > $LAST Then $I_BASE = 0
    Local $HFILE
    If IsString($FILE) Then
        $HFILE = FileOpen($FILE, 2)
    Else
        $HFILE = $FILE
    EndIf
    If $HFILE = -1 Then Return SetError(1, 0, 0)
    Local $ERRORSAV = 0
    For $X = $I_BASE To $I_UBOUND
        If FileWrite($HFILE, @CRLF & $A_ARRAY[$X]) = 0 Then
            $ERRORSAV = 3
            ExitLoop
        EndIf
    Next
    If IsString($FILE) Then FileClose($HFILE)
    If $ERRORSAV Then
        Return SetError($ERRORSAV, 0, 0)
    Else
        Return 1
    EndIf
EndFunc


Func _FILEWRITELOG($SLOGPATH, $SLOGMSG)
    Local $SDATENOW
    Local $STIMENOW
    Local $SMSG
    Local $HOPENFILE
    Local $HWRITEFILE
    $SDATENOW = @YEAR & "-" & @MON & "-" & @MDAY
    $STIMENOW = @HOUR & ":" & @MIN & ":" & @SEC
    $SMSG = $SDATENOW & " " & $STIMENOW & " : " & $SLOGMSG
    $HOPENFILE = FileOpen($SLOGPATH, 1)
    If $HOPENFILE = -1 Then
        SetError(1)
        Return 0
    EndIf
    $HWRITEFILE = FileWriteLine($HOPENFILE, $SMSG)
    If $HWRITEFILE = -1 Then
        SetError(2)
        Return 0
    EndIf
    FileClose($HOPENFILE)
    Return 1
EndFunc


Func _FILEWRITETOLINE($SFILE, $ILINE, $STEXT, $FOVERWRITE = 0)
    If $ILINE <= 0 Then
        SetError(4)
        Return 0
    EndIf
    If Not IsString($STEXT) Then
        SetError(6)
        Return 0
    EndIf
    If $FOVERWRITE <> 0 And $FOVERWRITE <> 1 Then
        SetError(5)
        Return 0
    EndIf
    If Not FileExists($SFILE) Then
        SetError(2)
        Return 0
    EndIf
    Local $FILTXT = FileRead($SFILE, FileGetSize($SFILE))
    $FILTXT = StringSplit($FILTXT, @CRLF, 1)
    If UBound($FILTXT, 1) < $ILINE Then
        SetError(1)
        Return 0
    EndIf
    Local $FIL = FileOpen($SFILE, 2)
    If $FIL = -1 Then
        SetError(3)
        Return 0
    EndIf
    For $I = 1 To UBound($FILTXT) - 1
        If $I = $ILINE Then
            If $FOVERWRITE = 1 Then
                If $STEXT <> "" Then
                    FileWrite($FIL, $STEXT & @CRLF)
                Else
                    FileWrite($FIL, $STEXT)
                EndIf
            EndIf
            If $FOVERWRITE = 0 Then
                FileWrite($FIL, $STEXT & @CRLF)
                FileWrite($FIL, $FILTXT[$I] & @CRLF)
            EndIf
        ElseIf $I < UBound($FILTXT, 1) - 1 Then
            FileWrite($FIL, $FILTXT[$I] & @CRLF)
        ElseIf $I = UBound($FILTXT, 1) - 1 Then
            FileWrite($FIL, $FILTXT[$I])
        EndIf
    Next
    FileClose($FIL)
    Return 1
EndFunc


Func _PATHFULL($SRELATIVEPATH, $SBASEPATH = @WorkingDir)
    If Not $SRELATIVEPATH Or $SRELATIVEPATH = "."  Then Return $SBASEPATH
    Local $SFULLPATH = StringReplace($SRELATIVEPATH, "/", "\")
    Local $SPATH
    Local $BROOTONLY = False
    StringReplace($SFULLPATH, "\", "")
    If @extended = StringLen($SFULLPATH) Then $BROOTONLY = True
    For $I = 1 To 2
        $SPATH = StringLeft($SFULLPATH, 2)
        If $SPATH = "\\"  Then
            $SFULLPATH = StringTrimLeft($SFULLPATH, 2)
            $SPATH &= StringLeft($SFULLPATH, StringInStr($SFULLPATH, "\") - 1)
            ExitLoop
        ElseIf StringRight($SPATH, 1) = ":"  Then
            $SFULLPATH = StringTrimLeft($SFULLPATH, 2)
            ExitLoop
        Else
            $SFULLPATH = $SBASEPATH & "\" & $SFULLPATH
        EndIf
    Next
    If $I = 3 Then Return ""
    Local $ATEMP = StringSplit($SFULLPATH, "\")
    Local $APATHPARTS[$ATEMP[0]], $J = 0
    For $I = 2 To $ATEMP[0]
        If $ATEMP[$I] = ".."  Then
            If $J Then $J -= 1
        ElseIf Not ($ATEMP[$I] = "" And $I <> $ATEMP[0]) And $ATEMP[$I] <> "."  Then
            $APATHPARTS[$J] = $ATEMP[$I]
            $J += 1
        EndIf
    Next
    $SFULLPATH = $SPATH
    If Not $BROOTONLY Then
        For $I = 0 To $J - 1
            $SFULLPATH &= "\" & $APATHPARTS[$I]
        Next
    Else
        $SFULLPATH &= "\"
    EndIf
    While StringInStr($SFULLPATH, ".\")
        $SFULLPATH = StringReplace($SFULLPATH, ".\", "\")
    WEnd
    Return $SFULLPATH
EndFunc


Func _PATHMAKE($SZDRIVE, $SZDIR, $SZFNAME, $SZEXT)
    Local $SZFULLPATH
    If StringLen($SZDRIVE) Then
        If Not (StringLeft($SZDRIVE, 2) = "\\") Then $SZDRIVE = StringLeft($SZDRIVE, 1) & ":"
    EndIf
    If StringLen($SZDIR) Then
        If Not (StringRight($SZDIR, 1) = "\") And Not (StringRight($SZDIR, 1) = "/") Then $SZDIR = $SZDIR & "\"
    EndIf
    If StringLen($SZEXT) Then
        If Not (StringLeft($SZEXT, 1) = ".") Then $SZEXT = "." & $SZEXT
    EndIf
    $SZFULLPATH = $SZDRIVE & $SZDIR & $SZFNAME & $SZEXT
    Return $SZFULLPATH
EndFunc


Func _PATHSPLIT($SZPATH, ByRef $SZDRIVE, ByRef $SZDIR, ByRef $SZFNAME, ByRef $SZEXT)
    Local $DRIVE = ""
    Local $DIR = ""
    Local $FNAME = ""
    Local $EXT = ""
    Local $POS
    Local $ARRAY[5]
    $ARRAY[0] = $SZPATH
    If StringMid($SZPATH, 2, 1) = ":"  Then
        $DRIVE = StringLeft($SZPATH, 2)
        $SZPATH = StringTrimLeft($SZPATH, 2)
    ElseIf StringLeft($SZPATH, 2) = "\\"  Then
        $SZPATH = StringTrimLeft($SZPATH, 2)
        $POS = StringInStr($SZPATH, "\")
        If $POS = 0 Then $POS = StringInStr($SZPATH, "/")
        If $POS = 0 Then
            $DRIVE = "\\" & $SZPATH
            $SZPATH = ""
        Else
            $DRIVE = "\\" & StringLeft($SZPATH, $POS - 1)
            $SZPATH = StringTrimLeft($SZPATH, $POS - 1)
        EndIf
    EndIf
    Local $NPOSFORWARD = StringInStr($SZPATH, "/", 0, -1)
    Local $NPOSBACKWARD = StringInStr($SZPATH, "\", 0, -1)
    If $NPOSFORWARD >= $NPOSBACKWARD Then
        $POS = $NPOSFORWARD
    Else
        $POS = $NPOSBACKWARD
    EndIf
    $DIR = StringLeft($SZPATH, $POS)
    $FNAME = StringRight($SZPATH, StringLen($SZPATH) - $POS)
    If StringLen($DIR) = 0 Then $FNAME = $SZPATH
    $POS = StringInStr($FNAME, ".", 0, -1)
    If $POS Then
        $EXT = StringRight($FNAME, StringLen($FNAME) - ($POS - 1))
        $FNAME = StringLeft($FNAME, $POS - 1)
    EndIf
    $SZDRIVE = $DRIVE
    $SZDIR = $DIR
    $SZFNAME = $FNAME
    $SZEXT = $EXT
    $ARRAY[1] = $DRIVE
    $ARRAY[2] = $DIR
    $ARRAY[3] = $FNAME
    $ARRAY[4] = $EXT
    Return $ARRAY
EndFunc


Func _REPLACESTRINGINFILE($SZFILENAME, $SZSEARCHSTRING, $SZREPLACESTRING, $FCASENESS = 0, $FOCCURANCE = 1)
    Local $IRETVAL = 0
    Local $HWRITEHANDLE, $AFILELINES, $NCOUNT, $SENDSWITH, $HFILE
    If StringInStr(FileGetAttrib($SZFILENAME), "R") Then
        SetError(6)
        Return -1
    EndIf
    $HFILE = FileOpen($SZFILENAME, 0)
    If $HFILE = -1 Then
        SetError(1)
        Return -1
    EndIf
    Local $S_TOTFILE = FileRead($HFILE, FileGetSize($SZFILENAME))
    If StringRight($S_TOTFILE, 2) = @CRLF Then
        $SENDSWITH = @CRLF
    ElseIf StringRight($S_TOTFILE, 1) = @CR Then
        $SENDSWITH = @CR
    ElseIf StringRight($S_TOTFILE, 1) = @LF Then
        $SENDSWITH = @LF
    Else
        $SENDSWITH = ""
    EndIf
    $AFILELINES = StringSplit(StringStripCR($S_TOTFILE), @LF)
    FileClose($HFILE)
    $HWRITEHANDLE = FileOpen($SZFILENAME, 2)
    If $HWRITEHANDLE = -1 Then
        SetError(2)
        Return -1
    EndIf
    For $NCOUNT = 1 To $AFILELINES[0]
        If StringInStr($AFILELINES[$NCOUNT], $SZSEARCHSTRING, $FCASENESS) Then
            $AFILELINES[$NCOUNT] = StringReplace($AFILELINES[$NCOUNT], $SZSEARCHSTRING, $SZREPLACESTRING, 1 - $FOCCURANCE, $FCASENESS)
            $IRETVAL = $IRETVAL + 1
            If $FOCCURANCE = 0 Then
                $IRETVAL = 1
                ExitLoop
            EndIf
        EndIf
    Next
    For $NCOUNT = 1 To $AFILELINES[0] - 1
        If FileWriteLine($HWRITEHANDLE, $AFILELINES[$NCOUNT]) = 0 Then
            SetError(3)
            FileClose($HWRITEHANDLE)
            Return -1
        EndIf
    Next
    If $AFILELINES[$NCOUNT] <> "" Then FileWrite($HWRITEHANDLE, $AFILELINES[$NCOUNT] & $SENDSWITH)
    FileClose($HWRITEHANDLE)
    Return $IRETVAL
EndFunc


Func _TEMPFILE($S_DIRECTORYNAME = @TempDir, $S_FILEPREFIX = "~", $S_FILEEXTENSION = ".tmp", $I_RANDOMLENGTH = 7)
    Local $S_TEMPNAME
    If Not FileExists($S_DIRECTORYNAME) Then $S_DIRECTORYNAME = @TempDir
    If Not FileExists($S_DIRECTORYNAME) Then $S_DIRECTORYNAME = @ScriptDir
    If StringRight($S_DIRECTORYNAME, 1) <> "\"  Then $S_DIRECTORYNAME = $S_DIRECTORYNAME & "\"
    Do
        $S_TEMPNAME = ""
        While StringLen($S_TEMPNAME) < $I_RANDOMLENGTH
            $S_TEMPNAME = $S_TEMPNAME & Chr(Random(97, 122, 1))
        WEnd
        $S_TEMPNAME = $S_DIRECTORYNAME & $S_FILEPREFIX & $S_TEMPNAME & $S_FILEEXTENSION
    Until Not FileExists($S_TEMPNAME)
    Return ($S_TEMPNAME)
EndFunc

Global $CHAR1, $CHAR2, $CHAR3, $CHAR4, $CHAR5, $CHAR6, $CHAR7, $CHAR8
Global $CHAR1WINDOW, $CHAR2WINDOW, $CHAR3WINDOW, $CHAR4WINDOW, $CHAR5WINDOW, $CHAR6WINDOW, $CHAR7WINDOW, $CHAR8WINDOW
If Not FileExists(@ScriptDir & "\Addresses.ini") Then
    _FILECREATE(@ScriptDir & "\Addresses.ini")
    IniWrite(@ScriptDir & "\Addresses.ini", "DATA", "CharPointer", "cf0508")
    IniWrite(@ScriptDir & "\Addresses.ini", "DATA", "Selection", "c15e24")
EndIf
Global $CHARPOINTER = "0x" & IniRead(@ScriptDir & "\Addresses.ini", "DATA", "CharPointer", "cf0508")
Global $SETADDRESS = "0x" & IniRead(@ScriptDir & "\Addresses.ini", "DATA", "Selection", "c15e24")
$FORM1_1 = GUICreate("AutoSelect", 315, 311, 324, 151)
$GROUP1 = GUICtrlCreateGroup("pk2 Editor", 8, 8, 297, 49)
$PK2BROWSE = GUICtrlCreateButton("Browse", 216, 24, 73, 17)
$PK2DIR = GUICtrlCreateInput("C:\Users\user\Desktop\pk2\Pk2 Tools", 16, 24, 177, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$GROUP2 = GUICtrlCreateGroup("Media", 8, 64, 297, 65)
$BROWSEMEDIA = GUICtrlCreateButton("Browse", 216, 80, 73, 25)
$EDITMEDIA = GUICtrlCreateButton("Edit", 88, 104, 113, 17)
$MEDIADIR = GUICtrlCreateInput("C:\Program Files\Silkroad", 16, 80, 177, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$GROUP3 = GUICtrlCreateGroup("AutoSelect", 8, 136, 297, 121)
$DISTANCE = GUICtrlCreateInput("5000", 112, 152, 41, 21)
$LABEL1 = GUICtrlCreateLabel("Distance in feet", 24, 160, 78, 17)
$ENABLE = GUICtrlCreateButton("Enable", 32, 208, 113, 33)
$DISABLE = GUICtrlCreateButton("Disable", 168, 208, 113, 33)
$CHARCOMBO = GUICtrlCreateCombo("", 168, 152, 129, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
$REFRESH = GUICtrlCreateButton("Refresh", 200, 176, 65, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$THANKS = GUICtrlCreateInput("Thanks to Drew_Benton", 176, 264, 129, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY))
$MENU = GUICtrlCreateMenu("File")
$ABOUT = GUICtrlCreateMenuItem("About", $MENU)
GUISetState(@SW_SHOW)
UPDATECHAR()
While 1
    $MSG = GUIGetMsg()
    Switch $MSG
        Case $GUI_EVENT_CLOSE
            Exit
        Case $ABOUT
            MsgBox(64, "About...", "Drew_Benton's great tutorial that taught me how to enable silkroad's internal autoselect feature made this possible. Thanks to him again for the Pk2 tools." & @CRLF & "?asically what this program does is allow the user to simply activate the autoselect feature without any programming experience. fust make sure all files contained in the archive are in the same folder." & @CRLF & @CRLF & "Bot90210" & @CRLF & "Stealthex.org" & @CRLF & "0x33.org")
        Case $PK2BROWSE
            $PK2FILE = FileOpenDialog("Pk2 Editor", @DesktopDir, "Pk2 Editor (*.exe)", 1, "Pk2Editor.exe")
            GUICtrlSetData($PK2DIR, $PK2FILE)
        Case $BROWSEMEDIA
            $MEDIAFILE = FileOpenDialog("Media.pk2", @DesktopDir, "Media (*.pk2)", 1, "Media.pk2")
            GUICtrlSetData($MEDIADIR, $MEDIAFILE)
        Case $REFRESH
            UPDATECHAR()
        Case $EDITMEDIA
            If GUICtrlRead($PK2DIR) = "C:\Users\user\Desktop\pk2\PK2 Tools"  Then
                MsgBox(48, "Error", "Please select the Pk2Editor file...")
                ContinueLoop
            EndIf
            ShellExecute(GUICtrlRead($PK2DIR), GUICtrlRead($MEDIADIR))
            MsgBox(262144, "Instructions", "Click file, open and select your Media.pk2 file")
            $SELECT = 1
            While $SELECT = 1
                If ControlGetText("PK2 Editor", "", 1000) = @CRLF & "Welcome to the PK2 Editor!" & @CRLF & "Made by: Drew Benton" & @CRLF & "http://0x33.org" & @CRLF & @CRLF & @CRLF & "The PK2 has been loaded successfully."  Then
                    Global $SELECT = 2
                    ExitLoop
                EndIf
            WEnd
            ControlSend("PK2 Editor", "", 1001, @ScriptDir & "\actionwnddata.txt")
            Sleep(5000)
            ControlClick("PK2 Editor", "Import", 1003, "left", 1, 46, 13)
            Sleep(3000)
            MsgBox(64, "Success!", "File imported correctly. Simply restart SRO and click Enable to use")
            ProcessClose("Pk2Editor.exe")
        Case $ENABLE
            $PHANDLE = _OPENPROCESS(_GETACTIVECHAR())
            $OLD = _READFLOAT($PHANDLE, $SETADDRESS)
            _WRITEFLOAT($PHANDLE, $SETADDRESS, GUICtrlRead($DISTANCE))
            MsgBox(64, "Updated", "The autoselect range was changed from " & $OLD & "ft to " & _READFLOAT($PHANDLE, $SETADDRESS) & "ft.")
            _CLOSEHANDLE($PHANDLE)
        Case $DISABLE
            $PHANDLE = _OPENPROCESS(_GETACTIVECHAR())
            _WRITEFLOAT($PHANDLE, $SETADDRESS, 0)
            MsgBox(64, "Updated", "Autoselect is now disabled.")
            _CLOSEHANDLE($PHANDLE)
    EndSwitch
WEnd

Func _GETACTIVECHAR()
    If GUICtrlRead($CHARCOMBO) = $CHAR1 Then Return $CHAR1WINDOW
    If GUICtrlRead($CHARCOMBO) = $CHAR2 Then Return $CHAR2WINDOW
    If GUICtrlRead($CHARCOMBO) = $CHAR3 Then Return $CHAR3WINDOW
    If GUICtrlRead($CHARCOMBO) = $CHAR4 Then Return $CHAR4WINDOW
    If GUICtrlRead($CHARCOMBO) = $CHAR5 Then Return $CHAR5WINDOW
    If GUICtrlRead($CHARCOMBO) = $CHAR6 Then Return $CHAR6WINDOW
    If GUICtrlRead($CHARCOMBO) = $CHAR7 Then Return $CHAR7WINDOW
    If GUICtrlRead($CHARCOMBO) = $CHAR8 Then Return $CHAR8WINDOW
EndFunc


Func _READCLIENT($ADDRESS, ByRef $INSTANCE, $FORMAT)
    Local $READINSTANCE = WinGetProcess($INSTANCE)
    Local $READ9014 = _MEMORYOPEN($READINSTANCE)
    $DATA = _MEMORYREAD($ADDRESS, $READ9014, $FORMAT)
    _MEMORYCLOSE($READ9014)
    Return $DATA
EndFunc


Func UPDATECHAR()
    $VAR = WinList("[CLASS:CLIENT]")
    For $I = 1 To $VAR[0][0]
        Switch $VAR[0][0]
            Case 1
                $CHAR1 = _READCLIENT($CHARPOINTER, $VAR[1][1], "wchar[40]")
                GUICtrlSetData($CHARCOMBO, $CHAR1)
                Global $CHAR1PROCESS = WinGetProcess($VAR[1][1])
                Global $CHAR1WINDOW = WinGetHandle($VAR[1][1])
            Case 2
                $CHAR1 = _READCLIENT($CHARPOINTER, $VAR[1][1], "wchar[40]")
                Global $CHAR1PROCESS = WinGetProcess($VAR[1][1])
                $CHAR2 = _READCLIENT($CHARPOINTER, $VAR[2][1], "wchar[40]")
                Global $CHAR2PROCESS = WinGetProcess($VAR[2][1])
                GUICtrlSetData($CHARCOMBO, $CHAR1)
                GUICtrlSetData($CHARCOMBO, $CHAR2)
                Global $CHAR1WINDOW = WinGetHandle($VAR[1][1])
                Global $CHAR2WINDOW = WinGetHandle($VAR[2][1])
            Case 3
                $CHAR1 = _READCLIENT($CHARPOINTER, $VAR[1][1], "wchar[40]")
                Global $CHAR1PROCESS = WinGetProcess($VAR[1][1])
                $CHAR2 = _READCLIENT($CHARPOINTER, $VAR[2][1], "wchar[40]")
                Global $CHAR2PROCESS = WinGetProcess($VAR[2][1])
                $CHAR3 = _READCLIENT($CHARPOINTER, $VAR[3][1], "wchar[40]")
                Global $CHAR3PROCESS = WinGetProcess($VAR[3][1])
                GUICtrlSetData($CHARCOMBO, $CHAR1)
                GUICtrlSetData($CHARCOMBO, $CHAR2)
                GUICtrlSetData($CHARCOMBO, $CHAR3)
                Global $CHAR1WINDOW = WinGetHandle($VAR[1][1])
                Global $CHAR2WINDOW = WinGetHandle($VAR[2][1])
                Global $CHAR3WINDOW = WinGetHandle($VAR[3][1])
            Case 4
                $CHAR1 = _READCLIENT($CHARPOINTER, $VAR[1][1], "wchar[40]")
                Global $CHAR1PROCESS = WinGetProcess($VAR[1][1])
                $CHAR2 = _READCLIENT($CHARPOINTER, $VAR[2][1], "wchar[40]")
                Global $CHAR2PROCESS = WinGetProcess($VAR[2][1])
                $CHAR3 = _READCLIENT($CHARPOINTER, $VAR[3][1], "wchar[40]")
                Global $CHAR3PROCESS = WinGetProcess($VAR[3][1])
                $CHAR4 = _READCLIENT($CHARPOINTER, $VAR[4][1], "wchar[40]")
                Global $CHAR4PROCESS = WinGetProcess($VAR[4][1])
                GUICtrlSetData($CHARCOMBO, $CHAR1)
                GUICtrlSetData($CHARCOMBO, $CHAR2)
                GUICtrlSetData($CHARCOMBO, $CHAR3)
                GUICtrlSetData($CHARCOMBO, $CHAR4)
                Global $CHAR1WINDOW = WinGetHandle($VAR[1][1])
                Global $CHAR2WINDOW = WinGetHandle($VAR[2][1])
                Global $CHAR3WINDOW = WinGetHandle($VAR[3][1])
                Global $CHAR4WINDOW = WinGetHandle($VAR[4][1])
            Case 5
                $CHAR1 = _READCLIENT($CHARPOINTER, $VAR[1][1], "wchar[40]")
                Global $CHAR1PROCESS = WinGetProcess($VAR[1][1])
                $CHAR2 = _READCLIENT($CHARPOINTER, $VAR[2][1], "wchar[40]")
                Global $CHAR2PROCESS = WinGetProcess($VAR[2][1])
                $CHAR3 = _READCLIENT($CHARPOINTER, $VAR[3][1], "wchar[40]")
                Global $CHAR3PROCESS = WinGetProcess($VAR[3][1])
                $CHAR4 = _READCLIENT($CHARPOINTER, $VAR[4][1], "wchar[40]")
                Global $CHAR4PROCESS = WinGetProcess($VAR[4][1])
                $CHAR5 = _READCLIENT($CHARPOINTER, $VAR[5][1], "wchar[40]")
                Global $CHAR5PROCESS = WinGetProcess($VAR[5][1])
                GUICtrlSetData($CHARCOMBO, $CHAR1)
                GUICtrlSetData($CHARCOMBO, $CHAR2)
                GUICtrlSetData($CHARCOMBO, $CHAR3)
                GUICtrlSetData($CHARCOMBO, $CHAR4)
                GUICtrlSetData($CHARCOMBO, $CHAR5)
                Global $CHAR1WINDOW = WinGetHandle($VAR[1][1])
                Global $CHAR2WINDOW = WinGetHandle($VAR[2][1])
                Global $CHAR3WINDOW = WinGetHandle($VAR[3][1])
                Global $CHAR4WINDOW = WinGetHandle($VAR[4][1])
                Global $CHAR5WINDOW = WinGetHandle($VAR[5][1])
            Case 6
                $CHAR1 = _READCLIENT($CHARPOINTER, $VAR[1][1], "wchar[40]")
                Global $CHAR1PROCESS = WinGetProcess($VAR[1][1])
                $CHAR2 = _READCLIENT($CHARPOINTER, $VAR[2][1], "wchar[40]")
                Global $CHAR2PROCESS = WinGetProcess($VAR[2][1])
                $CHAR3 = _READCLIENT($CHARPOINTER, $VAR[3][1], "wchar[40]")
                Global $CHAR3PROCESS = WinGetProcess($VAR[3][1])
                $CHAR4 = _READCLIENT($CHARPOINTER, $VAR[4][1], "wchar[40]")
                Global $CHAR4PROCESS = WinGetProcess($VAR[4][1])
                $CHAR5 = _READCLIENT($CHARPOINTER, $VAR[5][1], "wchar[40]")
                Global $CHAR5PROCESS = WinGetProcess($VAR[5][1])
                $CHAR6 = _READCLIENT($CHARPOINTER, $VAR[6][1], "wchar[40]")
                Global $CHAR6PROCESS = WinGetProcess($VAR[6][1])
                GUICtrlSetData($CHARCOMBO, $CHAR1)
                GUICtrlSetData($CHARCOMBO, $CHAR2)
                GUICtrlSetData($CHARCOMBO, $CHAR3)
                GUICtrlSetData($CHARCOMBO, $CHAR4)
                GUICtrlSetData($CHARCOMBO, $CHAR5)
                GUICtrlSetData($CHARCOMBO, $CHAR6)
                Global $CHAR1WINDOW = WinGetHandle($VAR[1][1])
                Global $CHAR2WINDOW = WinGetHandle($VAR[2][1])
                Global $CHAR3WINDOW = WinGetHandle($VAR[3][1])
                Global $CHAR4WINDOW = WinGetHandle($VAR[4][1])
                Global $CHAR5WINDOW = WinGetHandle($VAR[5][1])
                Global $CHAR6WINDOW = WinGetHandle($VAR[6][1])
            Case 7
                $CHAR1 = _READCLIENT($CHARPOINTER, $VAR[1][1], "wchar[40]")
                Global $CHAR1PROCESS = WinGetProcess($VAR[1][1])
                $CHAR2 = _READCLIENT($CHARPOINTER, $VAR[2][1], "wchar[40]")
                Global $CHAR2PROCESS = WinGetProcess($VAR[2][1])
                $CHAR3 = _READCLIENT($CHARPOINTER, $VAR[3][1], "wchar[40]")
                Global $CHAR3PROCESS = WinGetProcess($VAR[3][1])
                $CHAR4 = _READCLIENT($CHARPOINTER, $VAR[4][1], "wchar[40]")
                Global $CHAR4PROCESS = WinGetProcess($VAR[4][1])
                $CHAR5 = _READCLIENT($CHARPOINTER, $VAR[5][1], "wchar[40]")
                Global $CHAR5PROCESS = WinGetProcess($VAR[5][1])
                $CHAR6 = _READCLIENT($CHARPOINTER, $VAR[6][1], "wchar[40]")
                Global $CHAR6PROCESS = WinGetProcess($VAR[6][1])
                $CHAR7 = _READCLIENT($CHARPOINTER, $VAR[7][1], "wchar[40]")
                Global $CHAR7PROCESS = WinGetProcess($VAR[7][1])
                GUICtrlSetData($CHARCOMBO, $CHAR1)
                GUICtrlSetData($CHARCOMBO, $CHAR2)
                GUICtrlSetData($CHARCOMBO, $CHAR3)
                GUICtrlSetData($CHARCOMBO, $CHAR4)
                GUICtrlSetData($CHARCOMBO, $CHAR5)
                GUICtrlSetData($CHARCOMBO, $CHAR6)
                GUICtrlSetData($CHARCOMBO, $CHAR7)
                Global $CHAR1WINDOW = WinGetHandle($VAR[1][1])
                Global $CHAR2WINDOW = WinGetHandle($VAR[2][1])
                Global $CHAR3WINDOW = WinGetHandle($VAR[3][1])
                Global $CHAR4WINDOW = WinGetHandle($VAR[4][1])
                Global $CHAR5WINDOW = WinGetHandle($VAR[5][1])
                Global $CHAR6WINDOW = WinGetHandle($VAR[6][1])
                Global $CHAR7WINDOW = WinGetHandle($VAR[7][1])
            Case 8
                $CHAR1 = _READCLIENT($CHARPOINTER, $VAR[1][1], "wchar[40]")
                Global $CHAR1PROCESS = WinGetProcess($VAR[1][1])
                $CHAR2 = _READCLIENT($CHARPOINTER, $VAR[2][1], "wchar[40]")
                Global $CHAR2PROCESS = WinGetProcess($VAR[2][1])
                $CHAR3 = _READCLIENT($CHARPOINTER, $VAR[3][1], "wchar[40]")
                Global $CHAR3PROCESS = WinGetProcess($VAR[3][1])
                $CHAR4 = _READCLIENT($CHARPOINTER, $VAR[4][1], "wchar[40]")
                Global $CHAR4PROCESS = WinGetProcess($VAR[4][1])
                $CHAR5 = _READCLIENT($CHARPOINTER, $VAR[5][1], "wchar[40]")
                Global $CHAR5PROCESS = WinGetProcess($VAR[5][1])
                $CHAR6 = _READCLIENT($CHARPOINTER, $VAR[6][1], "wchar[40]")
                Global $CHAR6PROCESS = WinGetProcess($VAR[6][1])
                $CHAR7 = _READCLIENT($CHARPOINTER, $VAR[7][1], "wchar[40]")
                Global $CHAR7PROCESS = WinGetProcess($VAR[7][1])
                $CHAR8 = _READCLIENT($CHARPOINTER, $VAR[8][1], "wchar[40]")
                Global $CHAR8PROCESS = WinGetProcess($VAR[8][1])
                GUICtrlSetData($CHARCOMBO, $CHAR1)
                GUICtrlSetData($CHARCOMBO, $CHAR2)
                GUICtrlSetData($CHARCOMBO, $CHAR3)
                GUICtrlSetData($CHARCOMBO, $CHAR4)
                GUICtrlSetData($CHARCOMBO, $CHAR5)
                GUICtrlSetData($CHARCOMBO, $CHAR6)
                GUICtrlSetData($CHARCOMBO, $CHAR7)
                GUICtrlSetData($CHARCOMBO, $CHAR8)
                Global $CHAR1WINDOW = WinGetHandle($VAR[1][1])
                Global $CHAR2WINDOW = WinGetHandle($VAR[2][1])
                Global $CHAR3WINDOW = WinGetHandle($VAR[3][1])
                Global $CHAR4WINDOW = WinGetHandle($VAR[4][1])
                Global $CHAR5WINDOW = WinGetHandle($VAR[5][1])
                Global $CHAR6WINDOW = WinGetHandle($VAR[6][1])
                Global $CHAR7WINDOW = WinGetHandle($VAR[7][1])
                Global $CHAR8WINDOW = WinGetHandle($VAR[8][1])
        EndSwitch
    Next
EndFunc

my friend sent it to me yesterday. And it just... too long :) .

S.O can tell me what exactly it does? (step by step, please)

Share this post


Link to post
Share on other sites



id ask drew benton haha

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

It's something called AutoSelect, I ran it.

What it has/does:

Browse for a pk2 Editor / I have no idea

Browse:Edit Media / I have no idea

Autoselct

Distance in feet? / what?

Enable and disable button!

But I cannont explain the code, I don't feel like reading all of that, doesn't look harmful with at a quick glance at the code though!

Edit:

Found this in the code...

MsgBox(64, "About...", "Drew_Benton's great tutorial that taught me how to enable silkroad's internal autoselect feature made this possible. Thanks to him again for the Pk2 tools." & @CRLF & "?asically what this program does is allow the user to simply activate the autoselect feature without any programming experience. fust make sure all files contained in the archive are in the same folder."

Edited by Coolw

My ProgramsMy WIP'sSteam Server Restarter

Share this post


Link to post
Share on other sites

run it, it sure must have a guide on using


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

It appears you decompiled someones code.

Share this post


Link to post
Share on other sites

i asked her and she said it some stuff for isro. And she want to have 1 for our sro, i asked them but they say no support.

i just need to understand what they do, may be the guild said something about pk2 edit :)

P/s: i'm new and just want to learn more, if i did s.t wrong, srr i didn't know the rule :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0