[TLBB] Lập team code auto game sạch+free
Follow us on
Follow us on Facebook Follow us on Twitter Linked In Flickr Watch us on YouTube My Space Blogger
 
Kết quả 1 đến 9 của 9
  1. #1
    Thành Viên GameZone thienphuc86's Avatar
    Ngày tham gia
    Jul 2015
    Đang ở
    In the Hell
    Bài viết
    183
    Thanks
    55
    Thanked 21 Times in 20 Posts

    Lập team code auto game sạch+free

    Có anh em cô dì chú bác nào hứng thú với công việc này không , viết auto cho tlbb sạch và free cho cộng đồng , càng ngày thấy chán nãn lợi dụng auto để trục lợi . Anh em nào có nhu cầu mình sẽ hội ý tiếp về vấn đề này .
    Khách viếng thăm hãy cùng thienphuc86 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  2. #2
    Thành Viên Dark.Hades's Avatar
    Ngày tham gia
    Apr 2014
    Đang ở
    cd /tmp/
    Bài viết
    646
    Thanks
    205
    Thanked 628 Times in 146 Posts

    Ðề: Lập team code auto game sạch+free

    Không mở online thì viết làm gì.
    Mình nói thẳng là cái này chỉ trục lợi cho cá nhân và tổ chức chứ chả có ích gì cho cộng đồng.
    Khách viếng thăm hãy cùng Dark.Hades xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  3. #3
    Thành Viên GameZone thienphuc86's Avatar
    Ngày tham gia
    Jul 2015
    Đang ở
    In the Hell
    Bài viết
    183
    Thanks
    55
    Thanked 21 Times in 20 Posts

    Ðề: Lập team code auto game sạch+free

    Không phải ai cũng như bạn nghĩ chỉ biết lợi cho bản thân đâu . chỉ là mình thấy auto bay giờ toàn keylog ăn cắp tài khoản ,nên chỉ muốn lập team nghiên cứu về auto thôi , có gì mà bạn phải cay cú vậy ?
    Khách viếng thăm hãy cùng thienphuc86 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  4. #4
    Thành Viên
    Ngày tham gia
    Dec 2014
    Bài viết
    231
    Thanks
    50
    Thanked 84 Times in 61 Posts

    Ðề: Lập team code auto game sạch+free

    Code:
    #AutoIt3Wrapper_Run_Obfuscator = y
    #Obfuscator_Ignore_Variables=
    #Obfuscator_Ignore_Funcs=
    #Obfuscator_On
    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 $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 $cbm_first = 5888
    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_getcuebanner = ($cbm_first + 4)
    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_setcuebanner = ($cbm_first + 3)
    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 = 345
    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 $__comboboxconstant_wm_user = 1024
    Global Const $cbem_deleteitem = $cb_deletestring
    Global Const $cbem_getcombocontrol = ($__comboboxconstant_wm_user + 6)
    Global Const $cbem_geteditcontrol = ($__comboboxconstant_wm_user + 7)
    Global Const $cbem_getexstyle = ($__comboboxconstant_wm_user + 9)
    Global Const $cbem_getextendedstyle = ($__comboboxconstant_wm_user + 9)
    Global Const $cbem_getimagelist = ($__comboboxconstant_wm_user + 3)
    Global Const $cbem_getitema = ($__comboboxconstant_wm_user + 4)
    Global Const $cbem_getitemw = ($__comboboxconstant_wm_user + 13)
    Global Const $cbem_getunicodeformat = 8192 + 6
    Global Const $cbem_haseditchanged = ($__comboboxconstant_wm_user + 10)
    Global Const $cbem_insertitema = ($__comboboxconstant_wm_user + 1)
    Global Const $cbem_insertitemw = ($__comboboxconstant_wm_user + 11)
    Global Const $cbem_setexstyle = ($__comboboxconstant_wm_user + 8)
    Global Const $cbem_setextendedstyle = ($__comboboxconstant_wm_user + 14)
    Global Const $cbem_setimagelist = ($__comboboxconstant_wm_user + 2)
    Global Const $cbem_setitema = ($__comboboxconstant_wm_user + 5)
    Global Const $cbem_setitemw = ($__comboboxconstant_wm_user + 12)
    Global Const $cbem_setunicodeformat = 8192 + 5
    Global Const $cbem_setwindowtheme = 8192 + 11
    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 $__comboboxconstant_ws_vscroll = 2097152
    Global Const $gui_ss_default_combo = BitOR($cbs_dropdown, $cbs_autohscroll, $__comboboxconstant_ws_vscroll)
    #Region _Memory
    
    Func _memoryopen($iv_pid, $iv_desiredaccess = 2035711, $iv_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", $iv_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 setprivilege($privilege, $benable)
    	Const $token_adjust_privileges = 32
    	Const $token_query = 8
    	Const $se_privilege_enabled = 2
    	Local $htoken, $sp_auxret, $sp_ret, $hcurrprocess, $ntokens, $ntokenindex, $priv
    	$ntokens = 1
    	$luid = DllStructCreate("dword;int")
    	If IsArray($privilege) Then $ntokens = UBound($privilege)
    	$token_privileges = DllStructCreate("dword;dword[" & (3 * $ntokens) & "]")
    	$newtoken_privileges = DllStructCreate("dword;dword[" & (3 * $ntokens) & "]")
    	$hcurrprocess = DllCall("kernel32.dll", "hwnd", "GetCurrentProcess")
    	$sp_auxret = DllCall("advapi32.dll", "int", "OpenProcessToken", "hwnd", $hcurrprocess[0], "int", BitOR($token_adjust_privileges, $token_query), "int_ptr", 0)
    	If $sp_auxret[0] Then
    		$htoken = $sp_auxret[3]
    		DllStructSetData($token_privileges, 1, 1)
    		$ntokenindex = 1
    		While $ntokenindex <= $ntokens
    			If IsArray($privilege) Then
    				$priv = $privilege[$ntokenindex - 1]
    			Else
    				$priv = $privilege
    			EndIf
    			$ret = DllCall("advapi32.dll", "int", "LookupPrivilegeValue", "str", "", "str", $priv, "ptr", DllStructGetPtr($luid))
    			If $ret[0] Then
    				If $benable Then
    					DllStructSetData($token_privileges, 2, $se_privilege_enabled, (3 * $ntokenindex))
    				Else
    					DllStructSetData($token_privileges, 2, 0, (3 * $ntokenindex))
    				EndIf
    				DllStructSetData($token_privileges, 2, DllStructGetData($luid, 1), (3 * ($ntokenindex - 1)) + 1)
    				DllStructSetData($token_privileges, 2, DllStructGetData($luid, 2), (3 * ($ntokenindex - 1)) + 2)
    				DllStructSetData($luid, 1, 0)
    				DllStructSetData($luid, 2, 0)
    			EndIf
    			$ntokenindex += 1
    		WEnd
    		$ret = DllCall("advapi32.dll", "int", "AdjustTokenPrivileges", "hwnd", $htoken, "int", 0, "ptr", DllStructGetPtr($token_privileges), "int", DllStructGetSize($newtoken_privileges), "ptr", DllStructGetPtr($newtoken_privileges), "int_ptr", 0)
    		$f = DllCall("kernel32.dll", "int", "GetLastError")
    	EndIf
    	$newtoken_privileges = 0
    	$token_privileges = 0
    	$luid = 0
    	If $sp_auxret[0] = 0 Then Return 0
    	$sp_auxret = DllCall("kernel32.dll", "int", "CloseHandle", "hwnd", $htoken)
    	If NOT $ret[0] AND NOT $sp_auxret[0] Then Return 0
    	Return $ret[0]
    EndFunc
    
    #EndRegion _Memory
    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 StdDate[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;int 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;int TextMax;int Image;" & "int SelectedImage;int OverlayImage;int Indent;lparam Param"
    Global Const $tagdtprange = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;" & "word MinSecond;word MinMSecond;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;" & "word MaxMinute;word MaxSecond;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;long SizeY"
    Global Const $tagnmdatetimekeydown = $tagnmhdr & ";int VirtKey;ptr Format;" & $tagsystemtime
    Global Const $tagnmdatetimestring = $tagnmhdr & ";ptr UserString;" & $tagsystemtime & ";dword Flags"
    Global Const $tageventlogrecord = "dword Length;dword Reserved;dword RecordNumber;dword TimeGenerated;dword TimeWritten;dword EventID;" & "word EventType;word NumStrings;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 Values"
    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;bool NoCodecs"
    Global Const $taggdipstartupoutput = "ptr HookProc;ptr UnhookProc"
    Global Const $taggdipimagecodecinfo = "byte CLSID[16];byte FormatID[16];ptr CodecName;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 TextMax;int Image;lparam lParam"
    Global Const $tagnmhdfilterbtnclick = $tagnmhdr & ";int Item;" & $tagrect
    Global Const $tagnmheader = $tagnmhdr & ";int Item;int Button;ptr pItem"
    Global Const $taggetipaddress = "byte Field4;byte Field3;byte Field2;byte Field1"
    Global Const $tagnmipaddress = $tagnmhdr & ";int Field;int Value"
    Global Const $taglvfindinfo = "uint Flags;ptr Text;lparam Param;" & $tagpoint & ";uint Direction"
    Global Const $taglvhittestinfo = $tagpoint & ";uint Flags;int Item;int SubItem"
    Global Const $taglvitem = "uint Mask;int Item;int SubItem;uint State;uint StateMask;ptr Text;int TextMax;int Image;lparam Param;" & "int Indent;int GroupID;uint Columns;ptr pColumns"
    Global Const $tagnmlistview = $tagnmhdr & ";int Item;int SubItem;uint NewState;uint OldState;uint Changed;" & "long ActionX;long ActionY;lparam Param"
    Global Const $tagnmlvcustomdraw = $tagnmhdr & ";dword dwDrawStage;handle hdc;long Left;long Top;long Right;long Bottom;" & "dword_ptr dwItemSpec;uint uItemState;lparam lItemlParam" & ";dword clrText;dword clrTextBk;int iSubItem;dword dwItemType;dword clrFace;int iIconEffect;" & "int iIconPhase;int iPartId;int iStateId;long TextLeft;long TextTop;long TextRight;long TextBottom;uint uAlign"
    Global Const $tagnmlvdispinfo = $tagnmhdr & ";" & $taglvitem
    Global Const $tagnmlvfinditem = $tagnmhdr & ";" & $taglvfindinfo
    Global Const $tagnmlvgetinfotip = $tagnmhdr & ";dword Flags;ptr Text;int TextMax;int Item;int SubItem;lparam lParam"
    Global Const $tagnmitemactivate = $tagnmhdr & ";int Index;int SubItem;uint NewState;uint OldState;uint Changed;" & $tagpoint & ";lparam lParam;uint KeyFlags"
    Global Const $tagnmlvkeydown = $tagnmhdr & ";align 1;word VKey;uint Flags"
    Global Const $tagnmlvscroll = $tagnmhdr & ";int DX;int DY"
    Global Const $tagmchittestinfo = "uint Size;" & $tagpoint & ";uint Hit;" & $tagsystemtime
    Global Const $tagmcmonthrange = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;" & "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;" & "word MaxMSeconds;short Span"
    Global Const $tagmcrange = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;" & "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;" & "word MaxMSeconds;short MinSet;short MaxSet"
    Global Const $tagmcselrange = "word MinYear;word MinMonth;word MinDOW;word MinDay;word MinHour;word MinMinute;word MinSecond;" & "word MinMSeconds;word MaxYear;word MaxMonth;word MaxDOW;word MaxDay;word MaxHour;word MaxMinute;word MaxSecond;" & "word MaxMSeconds"
    Global Const $tagnmdaystate = $tagnmhdr & ";" & $tagsystemtime & ";int DayState;ptr pDayState"
    Global Const $tagnmselchange = $tagnmhdr & ";word BegYear;word BegMonth;word BegDOW;word BegDay;" & "word BegHour;word BegMinute;word BegSecond;word BegMSeconds;word EndYear;word EndMonth;word EndDOW;" & "word EndDay;word EndHour;word EndMinute;word EndSecond;word EndMSeconds"
    Global Const $tagnmobjectnotify = $tagnmhdr & ";int Item;ptr piid;ptr pObject;long Result"
    Global Const $tagnmtckeydown = $tagnmhdr & ";word VKey;uint Flags"
    Global Const $tagtvitem = "uint Mask;handle hItem;uint State;uint StateMask;ptr Text;int TextMax;int Image;int SelectedImage;" & "int Children;lparam Param"
    Global Const $tagtvitemex = $tagtvitem & ";int Integral"
    Global Const $tagnmtreeview = $tagnmhdr & ";uint Action;uint OldMask;handle OldhItem;uint OldState;uint OldStateMask;" & "ptr OldText;int OldTextMax;int OldImage;int OldSelectedImage;int OldChildren;lparam OldParam;uint NewMask;handle NewhItem;" & "uint NewState;uint NewStateMask;ptr NewText;int NewTextMax;int NewImage;int NewSelectedImage;int NewChildren;" & "lparam NewParam;long PointX;long PointY"
    Global Const $tagnmtvcustomdraw = $tagnmhdr & ";dword DrawStage;handle HDC;long Left;long Top;long Right;long Bottom;" & "dword_ptr ItemSpec;uint ItemState;lparam ItemParam;dword ClrText;dword ClrTextBk;int Level"
    Global Const $tagnmtvdispinfo = $tagnmhdr & ";" & $tagtvitem
    Global Const $tagnmtvgetinfotip = $tagnmhdr & ";ptr Text;int TextMax;handle hItem;lparam lParam"
    Global Const $tagtvhittestinfo = $tagpoint & ";uint Flags;handle Item"
    Global Const $tagnmtvkeydown = $tagnmhdr & ";word VKey;uint Flags"
    Global Const $tagnmmouse = $tagnmhdr & ";dword_ptr ItemSpec;dword_ptr ItemData;" & $tagpoint & ";lparam HitInfo"
    Global Const $tagtoken_privileges = "dword Count;int64 LUID;dword Attributes"
    Global Const $tagimageinfo = "handle hBitmap;handle hMask;int Unused1;int Unused2;" & $tagrect
    Global Const $tagmenuinfo = "dword Size;INT Mask;dword Style;uint YMax;handle hBack;dword ContextHelpID;ulong_ptr MenuData"
    Global Const $tagmenuiteminfo = "uint Size;uint Mask;uint Type;uint State;uint ID;handle SubMenu;handle BmpChecked;handle BmpUnchecked;" & "ulong_ptr ItemData;ptr TypeData;uint CCH;handle BmpItem"
    Global Const $tagrebarbandinfo = "uint cbSize;uint fMask;uint fStyle;dword clrFore;dword clrBack;ptr lpText;uint cch;" & "int iImage;hwnd hwndChild;uint cxMinChild;uint cyMinChild;uint cx;handle hbmBack;uint wID;uint cyChild;uint cyMaxChild;" & "uint cyIntegral;uint cxIdeal;lparam lParam;uint cxHeader"
    Global Const $tagnmrebarautobreak = $tagnmhdr & ";uint uBand;uint wID;lparam lParam;uint uMsg;uint fStyleCurrent;bool fAutoBreak"
    Global Const $tagnmrbautosize = $tagnmhdr & ";bool fChanged;long TargetLeft;long TargetTop;long TargetRight;long TargetBottom;" & "long ActualLeft;long ActualTop;long ActualRight;long ActualBottom"
    Global Const $tagnmrebar = $tagnmhdr & ";dword dwMask;uint uBand;uint fStyle;uint wID;laram lParam"
    Global Const $tagnmrebarchevron = $tagnmhdr & ";uint uBand;uint wID;lparam lParam;" & $tagrect & ";lparam lParamNM"
    Global Const $tagnmrebarchildsize = $tagnmhdr & ";uint uBand;uint wID;long CLeft;long CTop;long CRight;long CBottom;" & "long BLeft;long BTop;long BRight;long BBottom"
    Global Const $tagcolorscheme = "dword Size;dword BtnHighlight;dword BtnShadow"
    Global Const $tagnmtoolbar = $tagnmhdr & ";int iItem;" & "int iBitmap;int idCommand;byte fsState;byte fsStyle;align;dword_ptr dwData;int_ptr iString" & ";int cchText;ptr pszText;" & $tagrect
    Global Const $tagnmtbhotitem = $tagnmhdr & ";int idOld;int idNew;dword dwFlags"
    Global Const $tagtbbutton = "int Bitmap;int Command;byte State;byte Style;align;dword_ptr Param;int_ptr String"
    Global Const $tagtbbuttoninfo = "uint Size;dword Mask;int Command;int Image;byte State;byte Style;word CX;dword_ptr Param;ptr Text;int TextMax"
    Global Const $tagnetresource = "dword Scope;dword Type;dword DisplayType;dword Usage;ptr LocalName;ptr RemoteName;ptr Comment;ptr Provider"
    Global Const $tagoverlapped = "ulong_ptr Internal;ulong_ptr InternalHigh;dword Offset;dword OffsetHigh;handle hEvent"
    Global Const $tagopenfilename = "dword StructSize;hwnd hwndOwner;handle hInstance;ptr lpstrFilter;ptr lpstrCustomFilter;" & "dword nMaxCustFilter;dword nFilterIndex;ptr lpstrFile;dword nMaxFile;ptr lpstrFileTitle;dword nMaxFileTitle;" & "ptr lpstrInitialDir;ptr lpstrTitle;dword Flags;word nFileOffset;word nFileExtension;ptr lpstrDefExt;lparam lCustData;" & "ptr lpfnHook;ptr lpTemplateName;ptr pvReserved;dword dwReserved;dword FlagsEx"
    Global Const $tagbitmapinfo = "dword Size;long Width;long Height;word Planes;word BitCount;dword Compression;dword SizeImage;" & "long XPelsPerMeter;long YPelsPerMeter;dword ClrUsed;dword ClrImportant;dword RGBQuad"
    Global Const $tagblendfunction = "byte Op;byte Flags;byte Alpha;byte Format"
    Global Const $tagguid = "dword Data1;word Data2;word Data3;byte Data4[8]"
    Global Const $tagwindowplacement = "uint length; uint flags;uint showCmd;long ptMinPosition[2];long ptMaxPosition[2];long rcNormalPosition[4]"
    Global Const $tagwindowpos = "hwnd hWnd;hwnd InsertAfter;int X;int Y;int CX;int CY;uint Flags"
    Global Const $tagscrollinfo = "uint cbSize;uint fMask;int  nMin;int  nMax;uint nPage;int  nPos;int  nTrackPos"
    Global Const $tagscrollbarinfo = "dword cbSize;" & $tagrect & ";int dxyLineButton;int xyThumbTop;" & "int xyThumbBottom;int reserved;dword rgstate[6]"
    Global Const $taglogfont = "long Height;long Width;long Escapement;long Orientation;long Weight;byte Italic;byte Underline;" & "byte Strikeout;byte CharSet;byte OutPrecision;byte ClipPrecision;byte Quality;byte PitchAndFamily;wchar FaceName[32]"
    Global Const $tagkbdllhookstruct = "dword vkCode;dword scanCode;dword flags;dword time;ulong_ptr dwExtraInfo"
    Global Const $tagprocess_information = "handle hProcess;handle hThread;dword ProcessID;dword ThreadID"
    Global Const $tagstartupinfo = "dword Size;ptr Reserved1;ptr Desktop;ptr Title;dword X;dword Y;dword XSize;dword YSize;dword XCountChars;" & "dword YCountChars;dword FillAttribute;dword Flags;word ShowWindow;word Reserved2;ptr Reserved3;handle StdInput;" & "handle StdOutput;handle StdError"
    Global Const $tagsecurity_attributes = "dword Length;ptr Descriptor;bool InheritHandle"
    Global Const $tagwin32_find_data = "dword dwFileAttributes; dword ftCreationTime[2]; dword ftLastAccessTime[2]; dword ftLastWriteTime[2]; dword nFileSizeHigh; dword nFileSizeLow; dword dwReserved0; dword dwReserved1; wchar cFileName[260]; wchar cAlternateFileName[14]"
    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 $fo_utf8_nobom = 256
    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 $invalid_set_file_pointer = -1
    Global Const $file_begin = 0
    Global Const $file_current = 1
    Global Const $file_end = 2
    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 $error_no_token = 1008
    Global Const $se_assignprimarytoken_name = "SeAssignPrimaryTokenPrivilege"
    Global Const $se_audit_name = "SeAuditPrivilege"
    Global Const $se_backup_name = "SeBackupPrivilege"
    Global Const $se_change_notify_name = "SeChangeNotifyPrivilege"
    Global Const $se_create_global_name = "SeCreateGlobalPrivilege"
    Global Const $se_create_pagefile_name = "SeCreatePagefilePrivilege"
    Global Const $se_create_permanent_name = "SeCreatePermanentPrivilege"
    Global Const $se_create_token_name = "SeCreateTokenPrivilege"
    Global Const $se_debug_name = "SeDebugPrivilege"
    Global Const $se_enable_delegation_name = "SeEnableDelegationPrivilege"
    Global Const $se_impersonate_name = "SeImpersonatePrivilege"
    Global Const $se_inc_base_priority_name = "SeIncreaseBasePriorityPrivilege"
    Global Const $se_increase_quota_name = "SeIncreaseQuotaPrivilege"
    Global Const $se_load_driver_name = "SeLoadDriverPrivilege"
    Global Const $se_lock_memory_name = "SeLockMemoryPrivilege"
    Global Const $se_machine_account_name = "SeMachineAccountPrivilege"
    Global Const $se_manage_volume_name = "SeManageVolumePrivilege"
    Global Const $se_prof_single_process_name = "SeProfileSingleProcessPrivilege"
    Global Const $se_remote_shutdown_name = "SeRemoteShutdownPrivilege"
    Global Const $se_restore_name = "SeRestorePrivilege"
    Global Const $se_security_name = "SeSecurityPrivilege"
    Global Const $se_shutdown_name = "SeShutdownPrivilege"
    Global Const $se_sync_agent_name = "SeSyncAgentPrivilege"
    Global Const $se_system_environment_name = "SeSystemEnvironmentPrivilege"
    Global Const $se_system_profile_name = "SeSystemProfilePrivilege"
    Global Const $se_systemtime_name = "SeSystemtimePrivilege"
    Global Const $se_take_ownership_name = "SeTakeOwnershipPrivilege"
    Global Const $se_tcb_name = "SeTcbPrivilege"
    Global Const $se_unsolicited_input_name = "SeUnsolicitedInputPrivilege"
    Global Const $se_undock_name = "SeUndockPrivilege"
    Global Const $se_privilege_enabled_by_default = 1
    Global Const $se_privilege_enabled = 2
    Global Const $se_privilege_removed = 4
    Global Const $se_privilege_used_for_access = -2147483648
    Global Const $tokenuser = 1
    Global Const $tokengroups = 2
    Global Const $tokenprivileges = 3
    Global Const $tokenowner = 4
    Global Const $tokenprimarygroup = 5
    Global Const $tokendefaultdacl = 6
    Global Const $tokensource = 7
    Global Const $tokentype = 8
    Global Const $tokenimpersonationlevel = 9
    Global Const $tokenstatistics = 10
    Global Const $tokenrestrictedsids = 11
    Global Const $tokensessionid = 12
    Global Const $tokengroupsandprivileges = 13
    Global Const $tokensessionreference = 14
    Global Const $tokensandboxinert = 15
    Global Const $tokenauditpolicy = 16
    Global Const $tokenorigin = 17
    Global Const $tokenelevationtype = 18
    Global Const $tokenlinkedtoken = 19
    Global Const $tokenelevation = 20
    Global Const $tokenhasrestrictions = 21
    Global Const $tokenaccessinformation = 22
    Global Const $tokenvirtualizationallowed = 23
    Global Const $tokenvirtualizationenabled = 24
    Global Const $tokenintegritylevel = 25
    Global Const $tokenuiaccess = 26
    Global Const $tokenmandatorypolicy = 27
    Global Const $tokenlogonsid = 28
    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
    
    Func _winapi_getlasterror($curerr = @error, $curext = @extended)
    	Local $aresult = DllCall("kernel32.dll", "dword", "GetLastError")
    	Return SetError($curerr, $curext, $aresult[0])
    EndFunc
    
    Func _winapi_setlasterror($ierrcode, $curerr = @error, $curext = @extended)
    	DllCall("kernel32.dll", "none", "SetLastError", "dword", $ierrcode)
    	Return SetError($curerr, $curext)
    EndFunc
    
    Func _security__adjusttokenprivileges($htoken, $fdisableall, $pnewstate, $ibufferlen, $pprevstate = 0, $prequired = 0)
    	Local $aresult = DllCall("advapi32.dll", "bool", "AdjustTokenPrivileges", "handle", $htoken, "bool", $fdisableall, "ptr", $pnewstate, "dword", $ibufferlen, "ptr", $pprevstate, "ptr", $prequired)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _security__getaccountsid($saccount, $ssystem = "")
    	Local $aacct = _security__lookupaccountname($saccount, $ssystem)
    	If @error Then Return SetError(@error, 0, 0)
    	Return _security__stringsidtosid($aacct[0])
    EndFunc
    
    Func _security__getlengthsid($psid)
    	If NOT _security__isvalidsid($psid) Then Return SetError(-1, 0, 0)
    	Local $aresult = DllCall("advapi32.dll", "dword", "GetLengthSid", "ptr", $psid)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _security__gettokeninformation($htoken, $iclass)
    	Local $aresult = DllCall("advapi32.dll", "bool", "GetTokenInformation", "handle", $htoken, "int", $iclass, "ptr", 0, "dword", 0, "dword*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	If NOT $aresult[0] Then Return 0
    	Local $tbuffer = DllStructCreate("byte[" & $aresult[5] & "]")
    	Local $pbuffer = DllStructGetPtr($tbuffer)
    	$aresult = DllCall("advapi32.dll", "bool", "GetTokenInformation", "handle", $htoken, "int", $iclass, "ptr", $pbuffer, "dword", $aresult[5], "dword*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	If NOT $aresult[0] Then Return 0
    	Return $tbuffer
    EndFunc
    
    Func _security__impersonateself($ilevel = 2)
    	Local $aresult = DllCall("advapi32.dll", "bool", "ImpersonateSelf", "int", $ilevel)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _security__isvalidsid($psid)
    	Local $aresult = DllCall("advapi32.dll", "bool", "IsValidSid", "ptr", $psid)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _security__lookupaccountname($saccount, $ssystem = "")
    	Local $tdata = DllStructCreate("byte SID[256]")
    	Local $psid = DllStructGetPtr($tdata, "SID")
    	Local $aresult = DllCall("advapi32.dll", "bool", "LookupAccountNameW", "wstr", $ssystem, "wstr", $saccount, "ptr", $psid, "dword*", 256, "wstr", "", "dword*", 256, "int*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	If NOT $aresult[0] Then Return 0
    	Local $aacct[3]
    	$aacct[0] = _security__sidtostringsid($psid)
    	$aacct[1] = $aresult[5]
    	$aacct[2] = $aresult[7]
    	Return $aacct
    EndFunc
    
    Func _security__lookupaccountsid($vsid)
    	Local $psid, $aacct[3]
    	If IsString($vsid) Then
    		Local $tsid = _security__stringsidtosid($vsid)
    		$psid = DllStructGetPtr($tsid)
    	Else
    		$psid = $vsid
    	EndIf
    	If NOT _security__isvalidsid($psid) Then Return SetError(-1, 0, 0)
    	Local $aresult = DllCall("advapi32.dll", "bool", "LookupAccountSidW", "ptr", 0, "ptr", $psid, "wstr", "", "dword*", 256, "wstr", "", "dword*", 256, "int*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	If NOT $aresult[0] Then Return 0
    	Local $aacct[3]
    	$aacct[0] = $aresult[3]
    	$aacct[1] = $aresult[5]
    	$aacct[2] = $aresult[7]
    	Return $aacct
    EndFunc
    
    Func _security__lookupprivilegevalue($ssystem, $sname)
    	Local $aresult = DllCall("advapi32.dll", "int", "LookupPrivilegeValueW", "wstr", $ssystem, "wstr", $sname, "int64*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return SetError(0, $aresult[0], $aresult[3])
    EndFunc
    
    Func _security__openprocesstoken($hprocess, $iaccess)
    	Local $aresult = DllCall("advapi32.dll", "int", "OpenProcessToken", "handle", $hprocess, "dword", $iaccess, "ptr", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return SetError(0, $aresult[0], $aresult[3])
    EndFunc
    
    Func _security__openthreadtoken($iaccess, $hthread = 0, $fopenasself = False)
    	If $hthread = 0 Then $hthread = DllCall("kernel32.dll", "handle", "GetCurrentThread")
    	If @error Then Return SetError(@error, @extended, 0)
    	Local $aresult = DllCall("advapi32.dll", "bool", "OpenThreadToken", "handle", $hthread[0], "dword", $iaccess, "int", $fopenasself, "ptr*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return SetError(0, $aresult[0], $aresult[4])
    EndFunc
    
    Func _security__openthreadtokenex($iaccess, $hthread = 0, $fopenasself = False)
    	Local $htoken = _security__openthreadtoken($iaccess, $hthread, $fopenasself)
    	If $htoken = 0 Then
    		If _winapi_getlasterror() <> $error_no_token Then Return SetError(-3, _winapi_getlasterror(), 0)
    		If NOT _security__impersonateself() Then Return SetError(-1, _winapi_getlasterror(), 0)
    		$htoken = _security__openthreadtoken($iaccess, $hthread, $fopenasself)
    		If $htoken = 0 Then Return SetError(-2, _winapi_getlasterror(), 0)
    	EndIf
    	Return $htoken
    EndFunc
    
    Func _security__setprivilege($htoken, $sprivilege, $fenable)
    	Local $iluid = _security__lookupprivilegevalue("", $sprivilege)
    	If $iluid = 0 Then Return SetError(-1, 0, False)
    	Local $tcurrstate = DllStructCreate($tagtoken_privileges)
    	Local $pcurrstate = DllStructGetPtr($tcurrstate)
    	Local $icurrstate = DllStructGetSize($tcurrstate)
    	Local $tprevstate = DllStructCreate($tagtoken_privileges)
    	Local $pprevstate = DllStructGetPtr($tprevstate)
    	Local $iprevstate = DllStructGetSize($tprevstate)
    	Local $trequired = DllStructCreate("int Data")
    	Local $prequired = DllStructGetPtr($trequired)
    	DllStructSetData($tcurrstate, "Count", 1)
    	DllStructSetData($tcurrstate, "LUID", $iluid)
    	If NOT _security__adjusttokenprivileges($htoken, False, $pcurrstate, $icurrstate, $pprevstate, $prequired) Then Return SetError(-2, @error, False)
    	DllStructSetData($tprevstate, "Count", 1)
    	DllStructSetData($tprevstate, "LUID", $iluid)
    	Local $iattributes = DllStructGetData($tprevstate, "Attributes")
    	If $fenable Then
    		$iattributes = BitOR($iattributes, $se_privilege_enabled)
    	Else
    		$iattributes = BitAND($iattributes, BitNOT($se_privilege_enabled))
    	EndIf
    	DllStructSetData($tprevstate, "Attributes", $iattributes)
    	If NOT _security__adjusttokenprivileges($htoken, False, $pprevstate, $iprevstate, $pcurrstate, $prequired) Then Return SetError(-3, @error, False)
    	Return True
    EndFunc
    
    Func _security__sidtostringsid($psid)
    	If NOT _security__isvalidsid($psid) Then Return SetError(-1, 0, "")
    	Local $aresult = DllCall("advapi32.dll", "int", "ConvertSidToStringSidW", "ptr", $psid, "ptr*", 0)
    	If @error Then Return SetError(@error, @extended, "")
    	If NOT $aresult[0] Then Return ""
    	Local $tbuffer = DllStructCreate("wchar Text[256]", $aresult[2])
    	Local $ssid = DllStructGetData($tbuffer, "Text")
    	DllCall("Kernel32.dll", "ptr", "LocalFree", "ptr", $aresult[2])
    	Return $ssid
    EndFunc
    
    Func _security__sidtypestr($itype)
    	Switch $itype
    		Case 1
    			Return "User"
    		Case 2
    			Return "Group"
    		Case 3
    			Return "Domain"
    		Case 4
    			Return "Alias"
    		Case 5
    			Return "Well Known Group"
    		Case 6
    			Return "Deleted Account"
    		Case 7
    			Return "Invalid"
    		Case 8
    			Return "Invalid"
    		Case 9
    			Return "Computer"
    		Case Else
    			Return "Unknown SID Type"
    	EndSwitch
    EndFunc
    
    Func _security__stringsidtosid($ssid)
    	Local $aresult = DllCall("advapi32.dll", "bool", "ConvertStringSidToSidW", "wstr", $ssid, "ptr*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	If NOT $aresult[0] Then Return 0
    	Local $isize = _security__getlengthsid($aresult[2])
    	Local $tbuffer = DllStructCreate("byte Data[" & $isize & "]", $aresult[2])
    	Local $tsid = DllStructCreate("byte Data[" & $isize & "]")
    	DllStructSetData($tsid, "Data", DllStructGetData($tbuffer, "Data"))
    	DllCall("kernel32.dll", "ptr", "LocalFree", "ptr", $aresult[2])
    	Return $tsid
    EndFunc
    
    Func _sendmessage($hwnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
    	Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageW", "hwnd", $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, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
    	Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageA", "hwnd", $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 $__gainprocess_winapi[64][2] = [[0, 0]]
    Global $__gawinlist_winapi[64][2] = [[0, 0]]
    Global Const $__winapiconstant_wm_setfont = 48
    Global Const $__winapiconstant_fw_normal = 400
    Global Const $__winapiconstant_default_charset = 1
    Global Const $__winapiconstant_out_default_precis = 0
    Global Const $__winapiconstant_clip_default_precis = 0
    Global Const $__winapiconstant_default_quality = 0
    Global Const $__winapiconstant_format_message_allocate_buffer = 256
    Global Const $__winapiconstant_format_message_from_system = 4096
    Global Const $__winapiconstant_logpixelsx = 88
    Global Const $__winapiconstant_logpixelsy = 90
    Global Const $hgdi_error = Ptr(-1)
    Global Const $invalid_handle_value = Ptr(-1)
    Global Const $clr_invalid = -1
    Global Const $__winapiconstant_flashw_caption = 1
    Global Const $__winapiconstant_flashw_tray = 2
    Global Const $__winapiconstant_flashw_timer = 4
    Global Const $__winapiconstant_flashw_timernofg = 12
    Global Const $__winapiconstant_gw_hwndnext = 2
    Global Const $__winapiconstant_gw_child = 5
    Global Const $__winapiconstant_di_mask = 1
    Global Const $__winapiconstant_di_image = 2
    Global Const $__winapiconstant_di_normal = 3
    Global Const $__winapiconstant_di_compat = 4
    Global Const $__winapiconstant_di_defaultsize = 8
    Global Const $__winapiconstant_di_nomirror = 16
    Global Const $__winapiconstant_display_device_attached_to_desktop = 1
    Global Const $__winapiconstant_display_device_primary_device = 4
    Global Const $__winapiconstant_display_device_mirroring_driver = 8
    Global Const $__winapiconstant_display_device_vga_compatible = 16
    Global Const $__winapiconstant_display_device_removable = 32
    Global Const $__winapiconstant_display_device_modespruned = 134217728
    Global Const $null_brush = 5
    Global Const $null_pen = 8
    Global Const $black_brush = 4
    Global Const $dkgray_brush = 3
    Global Const $dc_brush = 18
    Global Const $gray_brush = 2
    Global Const $hollow_brush = $null_brush
    Global Const $ltgray_brush = 1
    Global Const $white_brush = 0
    Global Const $black_pen = 7
    Global Const $dc_pen = 19
    Global Const $white_pen = 6
    Global Const $ansi_fixed_font = 11
    Global Const $ansi_var_font = 12
    Global Const $device_default_font = 14
    Global Const $default_gui_font = 17
    Global Const $oem_fixed_font = 10
    Global Const $system_font = 13
    Global Const $system_fixed_font = 16
    Global Const $default_palette = 15
    Global Const $mb_precomposed = 1
    Global Const $mb_composite = 2
    Global Const $mb_useglyphchars = 4
    Global Const $ulw_alpha = 2
    Global Const $ulw_colorkey = 1
    Global Const $ulw_opaque = 4
    Global Const $wh_callwndproc = 4
    Global Const $wh_callwndprocret = 12
    Global Const $wh_cbt = 5
    Global Const $wh_debug = 9
    Global Const $wh_foregroundidle = 11
    Global Const $wh_getmessage = 3
    Global Const $wh_journalplayback = 1
    Global Const $wh_journalrecord = 0
    Global Const $wh_keyboard = 2
    Global Const $wh_keyboard_ll = 13
    Global Const $wh_mouse = 7
    Global Const $wh_mouse_ll = 14
    Global Const $wh_msgfilter = -1
    Global Const $wh_shell = 10
    Global Const $wh_sysmsgfilter = 6
    Global Const $wpf_asyncwindowplacement = 4
    Global Const $wpf_restoretomaximized = 2
    Global Const $wpf_setminposition = 1
    Global Const $kf_extended = 256
    Global Const $kf_altdown = 8192
    Global Const $kf_up = 32768
    Global Const $llkhf_extended = BitShift($kf_extended, 8)
    Global Const $llkhf_injected = 16
    Global Const $llkhf_altdown = BitShift($kf_altdown, 8)
    Global Const $llkhf_up = BitShift($kf_up, 8)
    Global Const $ofn_allowmultiselect = 512
    Global Const $ofn_createprompt = 8192
    Global Const $ofn_dontaddtorecent = 33554432
    Global Const $ofn_enablehook = 32
    Global Const $ofn_enableincludenotify = 4194304
    Global Const $ofn_enablesizing = 8388608
    Global Const $ofn_enabletemplate = 64
    Global Const $ofn_enabletemplatehandle = 128
    Global Const $ofn_explorer = 524288
    Global Const $ofn_extensiondifferent = 1024
    Global Const $ofn_filemustexist = 4096
    Global Const $ofn_forceshowhidden = 268435456
    Global Const $ofn_hidereadonly = 4
    Global Const $ofn_longnames = 2097152
    Global Const $ofn_nochangedir = 8
    Global Const $ofn_nodereferencelinks = 1048576
    Global Const $ofn_nolongnames = 262144
    Global Const $ofn_nonetworkbutton = 131072
    Global Const $ofn_noreadonlyreturn = 32768
    Global Const $ofn_notestfilecreate = 65536
    Global Const $ofn_novalidate = 256
    Global Const $ofn_overwriteprompt = 2
    Global Const $ofn_pathmustexist = 2048
    Global Const $ofn_readonly = 1
    Global Const $ofn_shareaware = 16384
    Global Const $ofn_showhelp = 16
    Global Const $ofn_ex_noplacesbar = 1
    Global Const $tagcursorinfo = "dword Size;dword Flags;handle hCursor;" & $tagpoint
    Global Const $tagdisplay_device = "dword Size;wchar Name[32];wchar String[128];dword Flags;wchar ID[128];wchar Key[128]"
    Global Const $tagflashwinfo = "uint Size;hwnd hWnd;dword Flags;uint Count;dword TimeOut"
    Global Const $tagiconinfo = "bool Icon;dword XHotSpot;dword YHotSpot;handle hMask;handle hColor"
    Global Const $tagmemorystatusex = "dword Length;dword MemoryLoad;" & "uint64 TotalPhys;uint64 AvailPhys;uint64 TotalPageFile;uint64 AvailPageFile;" & "uint64 TotalVirtual;uint64 AvailVirtual;uint64 AvailExtendedVirtual"
    
    Func _winapi_attachconsole($iprocessid = -1)
    	Local $aresult = DllCall("kernel32.dll", "bool", "AttachConsole", "dword", $iprocessid)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_attachthreadinput($iattach, $iattachto, $fattach)
    	Local $aresult = DllCall("user32.dll", "bool", "AttachThreadInput", "dword", $iattach, "dword", $iattachto, "bool", $fattach)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_beep($ifreq = 500, $iduration = 1000)
    	Local $aresult = DllCall("kernel32.dll", "bool", "Beep", "dword", $ifreq, "dword", $iduration)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_bitblt($hdestdc, $ixdest, $iydest, $iwidth, $iheight, $hsrcdc, $ixsrc, $iysrc, $irop)
    	Local $aresult = DllCall("gdi32.dll", "bool", "BitBlt", "handle", $hdestdc, "int", $ixdest, "int", $iydest, "int", $iwidth, "int", $iheight, "handle", $hsrcdc, "int", $ixsrc, "int", $iysrc, "dword", $irop)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_callnexthookex($hhk, $icode, $wparam, $lparam)
    	Local $aresult = DllCall("user32.dll", "lresult", "CallNextHookEx", "handle", $hhk, "int", $icode, "wparam", $wparam, "lparam", $lparam)
    	If @error Then Return SetError(@error, @extended, -1)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_callwindowproc($lpprevwndfunc, $hwnd, $msg, $wparam, $lparam)
    	Local $aresult = DllCall("user32.dll", "lresult", "CallWindowProc", "ptr", $lpprevwndfunc, "hwnd", $hwnd, "uint", $msg, "wparam", $wparam, "lparam", $lparam)
    	If @error Then Return SetError(@error, @extended, -1)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_clienttoscreen($hwnd, ByRef $tpoint)
    	Local $ppoint = DllStructGetPtr($tpoint)
    	DllCall("user32.dll", "bool", "ClientToScreen", "hwnd", $hwnd, "ptr", $ppoint)
    	Return SetError(@error, @extended, $tpoint)
    EndFunc
    
    Func _winapi_closehandle($hobject)
    	Local $aresult = DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hobject)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_combinergn($hrgndest, $hrgnsrc1, $hrgnsrc2, $icombinemode)
    	Local $aresult = DllCall("gdi32.dll", "int", "CombineRgn", "handle", $hrgndest, "handle", $hrgnsrc1, "handle", $hrgnsrc2, "int", $icombinemode)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_commdlgextendederror()
    	Local Const $cderr_dialogfailure = 65535
    	Local Const $cderr_findresfailure = 6
    	Local Const $cderr_initialization = 2
    	Local Const $cderr_loadresfailure = 7
    	Local Const $cderr_loadstrfailure = 5
    	Local Const $cderr_lockresfailure = 8
    	Local Const $cderr_memallocfailure = 9
    	Local Const $cderr_memlockfailure = 10
    	Local Const $cderr_nohinstance = 4
    	Local Const $cderr_nohook = 11
    	Local Const $cderr_notemplate = 3
    	Local Const $cderr_registermsgfail = 12
    	Local Const $cderr_structsize = 1
    	Local Const $fnerr_buffertoosmall = 12291
    	Local Const $fnerr_invalidfilename = 12290
    	Local Const $fnerr_subclassfailure = 12289
    	Local $aresult = DllCall("comdlg32.dll", "dword", "CommDlgExtendedError")
    	If @error Then Return SetError(@error, @extended, 0)
    	Switch $aresult[0]
    		Case $cderr_dialogfailure
    			Return SetError($aresult[0], 0, "The dialog box could not be created." & @LF & "The common dialog box function's call to the DialogBox function failed." & @LF & "For example, this error occurs if the common dialog box call specifies an invalid window handle.")
    		Case $cderr_findresfailure
    			Return SetError($aresult[0], 0, "The common dialog box function failed to find a specified resource.")
    		Case $cderr_initialization
    			Return SetError($aresult[0], 0, "The common dialog box function failed during initialization." & @LF & "This error often occurs when sufficient memory is not available.")
    		Case $cderr_loadresfailure
    			Return SetError($aresult[0], 0, "The common dialog box function failed to load a specified resource.")
    		Case $cderr_loadstrfailure
    			Return SetError($aresult[0], 0, "The common dialog box function failed to load a specified string.")
    		Case $cderr_lockresfailure
    			Return SetError($aresult[0], 0, "The common dialog box function failed to lock a specified resource.")
    		Case $cderr_memallocfailure
    			Return SetError($aresult[0], 0, "The common dialog box function was unable to allocate memory for internal structures.")
    		Case $cderr_memlockfailure
    			Return SetError($aresult[0], 0, "The common dialog box function 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 corresponding common dialog box," & @LF & "but you failed to provide a corresponding instance 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 common dialog box," & @LF & "but you failed to provide a pointer to a corresponding 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 corresponding common dialog box," & @LF & "but you failed to provide a corresponding template.")
    		Case $cderr_registermsgfail
    			Return SetError($aresult[0], 0, "The RegisterWindowMessage function returned an error code when it was called by the common dialog box function.")
    		Case $cderr_structsize
    			Return SetError($aresult[0], 0, "The lStructSize member of the initialization structure for the corresponding common dialog box is invalid")
    		Case $fnerr_buffertoosmall
    			Return SetError($aresult[0], 0, "The buffer pointed to by the lpstrFile member of the OPENFILENAME structure is too small for the file name 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 the 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, $pbits = 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", "handle", $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, $sname)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_createfile($sfilename, $icreation, $iaccess = 4, $ishare = 0, $iattributes = 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
    	If BitAND($iattributes, 1) <> 0 Then $ifa = BitOR($ifa, $file_attribute_archive)
    	If BitAND($iattributes, 2) <> 0 Then $ifa = BitOR($ifa, $file_attribute_hidden)
    	If BitAND($iattributes, 4) <> 0 Then $ifa = BitOR($ifa, $file_attribute_readonly)
    	If BitAND($iattributes, 8) <> 0 Then $ifa = BitOR($ifa, $file_attribute_system)
    	Local $aresult = DllCall("kernel32.dll", "handle", "CreateFileW", "wstr", $sfilename, "dword", $ida, "dword", $ism, "ptr", $psecurity, "dword", $icd, "dword", $ifa, "ptr", 0)
    	If @error OR $aresult[0] = Ptr(-1) Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_createfont($nheight, $nwidth, $nescape = 0, $norientn = 0, $fnweight = $__winapiconstant_fw_normal, $bitalic = False, $bunderline = False, $bstrikeout = False, $ncharset = $__winapiconstant_default_charset, $noutputprec = $__winapiconstant_out_default_precis, $nclipprec = $__winapiconstant_clip_default_precis, $nquality = $__winapiconstant_default_quality, $npitch = 0, $szface = "Arial")
    	Local $aresult = DllCall("gdi32.dll", "handle", "CreateFontW", "int", $nheight, "int", $nwidth, "int", $nescape, "int", $norientn, "int", $fnweight, "dword", $bitalic, "dword", $bunderline, "dword", $bstrikeout, "dword", $ncharset, "dword", $noutputprec, "dword", $nclipprec, "dword", $nquality, "dword", $npitch, "wstr", $szface)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_createfontindirect($tlogfont)
    	Local $aresult = DllCall("gdi32.dll", "handle", "CreateFontIndirectW", "ptr", DllStructGetPtr($tlogfont))
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_createpen($ipenstyle, $iwidth, $ncolor)
    	Local $aresult = DllCall("gdi32.dll", "handle", "CreatePen", "int", $ipenstyle, "int", $iwidth, "dword", $ncolor)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_createprocess($sappname, $scommand, $psecurity, $pthread, $finherit, $iflags, $penviron, $sdir, $pstartupinfo, $pprocess)
    	Local $pcommand = 0
    	Local $sappnametype = "wstr", $sdirtype = "wstr"
    	If $sappname = "" Then
    		$sappnametype = "ptr"
    		$sappname = 0
    	EndIf
    	If $scommand <> "" Then
    		Local $tcommand = DllStructCreate("wchar Text[" & 260 + 1 & "]")
    		$pcommand = DllStructGetPtr($tcommand)
    		DllStructSetData($tcommand, "Text", $scommand)
    	EndIf
    	If $sdir = "" Then
    		$sdirtype = "ptr"
    		$sdir = 0
    	EndIf
    	Local $aresult = DllCall("kernel32.dll", "bool", "CreateProcessW", $sappnametype, $sappname, "ptr", $pcommand, "ptr", $psecurity, "ptr", $pthread, "bool", $finherit, "dword", $iflags, "ptr", $penviron, $sdirtype, $sdir, "ptr", $pstartupinfo, "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", "int", $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", "dword", $ncolor)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_createwindowex($iexstyle, $sclass, $sname, $istyle, $ix, $iy, $iwidth, $iheight, $hparent, $hmenu = 0, $hinstance = 0, $pparam = 0)
    	If $hinstance = 0 Then $hinstance = _winapi_getmodulehandle("")
    	Local $aresult = DllCall("user32.dll", "hwnd", "CreateWindowExW", "dword", $iexstyle, "wstr", $sclass, "wstr", $sname, "dword", $istyle, "int", $ix, "int", $iy, "int", $iwidth, "int", $iheight, "hwnd", $hparent, "handle", $hmenu, "handle", $hinstance, "ptr", $pparam)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_defwindowproc($hwnd, $imsg, $iwparam, $ilparam)
    	Local $aresult = DllCall("user32.dll", "lresult", "DefWindowProc", "hwnd", $hwnd, "uint", $imsg, "wparam", $iwparam, "lparam", $ilparam)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_deletedc($hdc)
    	Local $aresult = DllCall("gdi32.dll", "bool", "DeleteDC", "handle", $hdc)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_deleteobject($hobject)
    	Local $aresult = DllCall("gdi32.dll", "bool", "DeleteObject", "handle", $hobject)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_destroyicon($hicon)
    	Local $aresult = DllCall("user32.dll", "bool", "DestroyIcon", "handle", $hicon)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_destroywindow($hwnd)
    	Local $aresult = DllCall("user32.dll", "bool", "DestroyWindow", "hwnd", $hwnd)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_drawedge($hdc, $ptrrect, $nedgetype, $grfflags)
    	Local $aresult = DllCall("user32.dll", "bool", "DrawEdge", "handle", $hdc, "ptr", $ptrrect, "uint", $nedgetype, "uint", $grfflags)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_drawframecontrol($hdc, $ptrrect, $ntype, $nstate)
    	Local $aresult = DllCall("user32.dll", "bool", "DrawFrameControl", "handle", $hdc, "ptr", $ptrrect, "uint", $ntype, "uint", $nstate)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_drawicon($hdc, $ix, $iy, $hicon)
    	Local $aresult = DllCall("user32.dll", "bool", "DrawIcon", "handle", $hdc, "int", $ix, "int", $iy, "handle", $hicon)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_drawiconex($hdc, $ix, $iy, $hicon, $iwidth = 0, $iheight = 0, $istep = 0, $hbrush = 0, $iflags = 3)
    	Local $ioptions
    	Switch $iflags
    		Case 1
    			$ioptions = $__winapiconstant_di_mask
    		Case 2
    			$ioptions = $__winapiconstant_di_image
    		Case 3
    			$ioptions = $__winapiconstant_di_normal
    		Case 4
    			$ioptions = $__winapiconstant_di_compat
    		Case 5
    			$ioptions = $__winapiconstant_di_defaultsize
    		Case Else
    			$ioptions = $__winapiconstant_di_nomirror
    	EndSwitch
    	Local $aresult = DllCall("user32.dll", "bool", "DrawIconEx", "handle", $hdc, "int", $ix, "int", $iy, "handle", $hicon, "int", $iwidth, "int", $iheight, "uint", $istep, "handle", $hbrush, "uint", $ioptions)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_drawline($hdc, $ix1, $iy1, $ix2, $iy2)
    	_winapi_moveto($hdc, $ix1, $iy1)
    	If @error Then Return SetError(@error, @extended, False)
    	_winapi_lineto($hdc, $ix2, $iy2)
    	If @error Then Return SetError(@error, @extended, False)
    	Return True
    EndFunc
    
    Func _winapi_drawtext($hdc, $stext, ByRef $trect, $iflags)
    	Local $aresult = DllCall("user32.dll", "int", "DrawTextW", "handle", $hdc, "wstr", $stext, "int", -1, "ptr", DllStructGetPtr($trect), "uint", $iflags)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_enablewindow($hwnd, $fenable = True)
    	Local $aresult = DllCall("user32.dll", "bool", "EnableWindow", "hwnd", $hwnd, "bool", $fenable)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_enumdisplaydevices($sdevice, $idevnum)
    	Local $pname = 0, $iflags = 0, $adevice[5]
    	If $sdevice <> "" Then
    		Local $tname = DllStructCreate("wchar Text[" & StringLen($sdevice) + 1 & "]")
    		$pname = DllStructGetPtr($tname)
    		DllStructSetData($tname, "Text", $sdevice)
    	EndIf
    	Local $tdevice = DllStructCreate($tagdisplay_device)
    	Local $pdevice = DllStructGetPtr($tdevice)
    	Local $idevice = DllStructGetSize($tdevice)
    	DllStructSetData($tdevice, "Size", $idevice)
    	DllCall("user32.dll", "bool", "EnumDisplayDevicesW", "ptr", $pname, "dword", $idevnum, "ptr", $pdevice, "dword", 1)
    	If @error Then Return SetError(@error, @extended, 0)
    	Local $in = DllStructGetData($tdevice, "Flags")
    	If BitAND($in, $__winapiconstant_display_device_attached_to_desktop) <> 0 Then $iflags = BitOR($iflags, 1)
    	If BitAND($in, $__winapiconstant_display_device_primary_device) <> 0 Then $iflags = BitOR($iflags, 2)
    	If BitAND($in, $__winapiconstant_display_device_mirroring_driver) <> 0 Then $iflags = BitOR($iflags, 4)
    	If BitAND($in, $__winapiconstant_display_device_vga_compatible) <> 0 Then $iflags = BitOR($iflags, 8)
    	If BitAND($in, $__winapiconstant_display_device_removable) <> 0 Then $iflags = BitOR($iflags, 16)
    	If BitAND($in, $__winapiconstant_display_device_modespruned) <> 0 Then $iflags = BitOR($iflags, 32)
    	$adevice[0] = True
    	$adevice[1] = DllStructGetData($tdevice, "Name")
    	$adevice[2] = DllStructGetData($tdevice, "String")
    	$adevice[3] = $iflags
    	$adevice[4] = DllStructGetData($tdevice, "ID")
    	Return $adevice
    EndFunc
    
    Func _winapi_enumwindows($fvisible = True, $hwnd = Default)
    	__winapi_enumwindowsinit()
    	If $hwnd = Default Then $hwnd = _winapi_getdesktopwindow()
    	__winapi_enumwindowschild($hwnd, $fvisible)
    	Return $__gawinlist_winapi
    EndFunc
    
    Func __winapi_enumwindowsadd($hwnd, $sclass = "")
    	If $sclass = "" Then $sclass = _winapi_getclassname($hwnd)
    	$__gawinlist_winapi[0][0] += 1
    	Local $icount = $__gawinlist_winapi[0][0]
    	If $icount >= $__gawinlist_winapi[0][1] Then
    		ReDim $__gawinlist_winapi[$icount + 64][2]
    		$__gawinlist_winapi[0][1] += 64
    	EndIf
    	$__gawinlist_winapi[$icount][0] = $hwnd
    	$__gawinlist_winapi[$icount][1] = $sclass
    EndFunc
    
    Func __winapi_enumwindowschild($hwnd, $fvisible = True)
    	$hwnd = _winapi_getwindow($hwnd, $__winapiconstant_gw_child)
    	While $hwnd <> 0
    		If (NOT $fvisible) OR _winapi_iswindowvisible($hwnd) Then
    			__winapi_enumwindowschild($hwnd, $fvisible)
    			__winapi_enumwindowsadd($hwnd)
    		EndIf
    		$hwnd = _winapi_getwindow($hwnd, $__winapiconstant_gw_hwndnext)
    	WEnd
    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(), $__winapiconstant_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(), $__winapiconstant_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", "ExpandEnvironmentStringsW", "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", $smessage)
    	If @error Then Return SetError(@error, @extended)
    EndFunc
    
    Func _winapi_fillrect($hdc, $ptrrect, $hbrush)
    	Local $aresult
    	If IsPtr($hbrush) Then
    		$aresult = DllCall("user32.dll", "int", "FillRect", "handle", $hdc, "ptr", $ptrrect, "handle", $hbrush)
    	Else
    		$aresult = DllCall("user32.dll", "int", "FillRect", "handle", $hdc, "ptr", $ptrrect, "dword", $hbrush)
    	EndIf
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_findexecutable($sfilename, $sdirectory = "")
    	Local $aresult = DllCall("shell32.dll", "INT", "FindExecutableW", "wstr", $sfilename, "wstr", $sdirectory, "wstr", "")
    	If @error Then Return SetError(@error, @extended, 0)
    	Return SetExtended($aresult[0], $aresult[3])
    EndFunc
    
    Func _winapi_findwindow($sclassname, $swindowname)
    	Local $aresult = DllCall("user32.dll", "hwnd", "FindWindowW", "wstr", $sclassname, "wstr", $swindowname)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_flashwindow($hwnd, $finvert = True)
    	Local $aresult = DllCall("user32.dll", "bool", "FlashWindow", "hwnd", $hwnd, "bool", $finvert)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_flashwindowex($hwnd, $iflags = 3, $icount = 3, $itimeout = 0)
    	Local $tflash = DllStructCreate($tagflashwinfo)
    	Local $pflash = DllStructGetPtr($tflash)
    	Local $iflash = DllStructGetSize($tflash)
    	Local $imode = 0
    	If BitAND($iflags, 1) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_caption)
    	If BitAND($iflags, 2) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_tray)
    	If BitAND($iflags, 4) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_timer)
    	If BitAND($iflags, 8) <> 0 Then $imode = BitOR($imode, $__winapiconstant_flashw_timernofg)
    	DllStructSetData($tflash, "Size", $iflash)
    	DllStructSetData($tflash, "hWnd", $hwnd)
    	DllStructSetData($tflash, "Flags", $imode)
    	DllStructSetData($tflash, "Count", $icount)
    	DllStructSetData($tflash, "Timeout", $itimeout)
    	Local $aresult = DllCall("user32.dll", "bool", "FlashWindowEx", "ptr", $pflash)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_floattoint($nfloat)
    	Local $tfloat = DllStructCreate("float")
    	Local $tint = DllStructCreate("int", DllStructGetPtr($tfloat))
    	DllStructSetData($tfloat, 1, $nfloat)
    	Return DllStructGetData($tint, 1)
    EndFunc
    
    Func _winapi_flushfilebuffers($hfile)
    	Local $aresult = DllCall("kernel32.dll", "bool", "FlushFileBuffers", "handle", $hfile)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_formatmessage($iflags, $psource, $imessageid, $ilanguageid, ByRef $pbuffer, $isize, $varguments)
    	Local $sbuffertype = "ptr"
    	If IsString($pbuffer) Then $sbuffertype = "wstr"
    	Local $aresult = DllCall("Kernel32.dll", "dword", "FormatMessageW", "dword", $iflags, "ptr", $psource, "dword", $imessageid, "dword", $ilanguageid, $sbuffertype, $pbuffer, "dword", $isize, "ptr", $varguments)
    	If @error Then Return SetError(@error, @extended, 0)
    	If $sbuffertype = "wstr" Then $pbuffer = $aresult[5]
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_framerect($hdc, $ptrrect, $hbrush)
    	Local $aresult = DllCall("user32.dll", "int", "FrameRect", "handle", $hdc, "ptr", $ptrrect, "handle", $hbrush)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_freelibrary($hmodule)
    	Local $aresult = DllCall("kernel32.dll", "bool", "FreeLibrary", "handle", $hmodule)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getancestor($hwnd, $iflags = 1)
    	Local $aresult = DllCall("user32.dll", "hwnd", "GetAncestor", "hwnd", $hwnd, "uint", $iflags)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getasynckeystate($ikey)
    	Local $aresult = DllCall("user32.dll", "short", "GetAsyncKeyState", "int", $ikey)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getbkmode($hdc)
    	Local $aresult = DllCall("gdi32.dll", "int", "GetBkMode", "handle", $hdc)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    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, "Top")
    EndFunc
    
    Func _winapi_getclientwidth($hwnd)
    	Local $trect = _winapi_getclientrect($hwnd)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return DllStructGetData($trect, "Right") - DllStructGetData($trect, "Left")
    EndFunc
    
    Func _winapi_getclientrect($hwnd)
    	Local $trect = DllStructCreate($tagrect)
    	DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $hwnd, "ptr", DllStructGetPtr($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($tcursor))
    	If @error Then Return SetError(@error, @extended, 0)
    	Local $acursor[5]
    	$acursor[0] = True
    	$acursor[1] = DllStructGetData($tcursor, "Flags") <> 0
    	$acursor[2] = DllStructGetData($tcursor, "hCursor")
    	$acursor[3] = DllStructGetData($tcursor, "X")
    	$acursor[4] = DllStructGetData($tcursor, "Y")
    	Return $acursor
    EndFunc
    
    Func _winapi_getdc($hwnd)
    	Local $aresult = DllCall("user32.dll", "handle", "GetDC", "hwnd", $hwnd)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getdesktopwindow()
    	Local $aresult = DllCall("user32.dll", "hwnd", "GetDesktopWindow")
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getdevicecaps($hdc, $iindex)
    	Local $aresult = DllCall("gdi32.dll", "int", "GetDeviceCaps", "handle", $hdc, "int", $iindex)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getdibits($hdc, $hbmp, $istartscan, $iscanlines, $pbits, $pbi, $iusage)
    	Local $aresult = DllCall("gdi32.dll", "int", "GetDIBits", "handle", $hdc, "handle", $hbmp, "uint", $istartscan, "uint", $iscanlines, "ptr", $pbits, "ptr", $pbi, "uint", $iusage)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getdlgctrlid($hwnd)
    	Local $aresult = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hwnd)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getdlgitem($hwnd, $iitemid)
    	Local $aresult = DllCall("user32.dll", "hwnd", "GetDlgItem", "hwnd", $hwnd, "int", $iitemid)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getfocus()
    	Local $aresult = DllCall("user32.dll", "hwnd", "GetFocus")
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getforegroundwindow()
    	Local $aresult = DllCall("user32.dll", "hwnd", "GetForegroundWindow")
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getguiresources($iflag = 0, $hprocess = -1)
    	If $hprocess = -1 Then $hprocess = _winapi_getcurrentprocess()
    	Local $aresult = DllCall("user32.dll", "dword", "GetGuiResources", "handle", $hprocess, "dword", $iflag)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_geticoninfo($hicon)
    	Local $tinfo = DllStructCreate($tagiconinfo)
    	DllCall("user32.dll", "bool", "GetIconInfo", "handle", $hicon, "ptr", DllStructGetPtr($tinfo))
    	If @error Then Return SetError(@error, @extended, 0)
    	Local $aicon[6]
    	$aicon[0] = True
    	$aicon[1] = DllStructGetData($tinfo, "Icon") <> 0
    	$aicon[2] = DllStructGetData($tinfo, "XHotSpot")
    	$aicon[3] = DllStructGetData($tinfo, "YHotSpot")
    	$aicon[4] = DllStructGetData($tinfo, "hMask")
    	$aicon[5] = DllStructGetData($tinfo, "hColor")
    	Return $aicon
    EndFunc
    
    Func _winapi_getfilesizeex($hfile)
    	Local $aresult = DllCall("kernel32.dll", "bool", "GetFileSizeEx", "handle", $hfile, "int64*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[2]
    EndFunc
    
    Func _winapi_getlasterrormessage()
    	Local $tbufferptr = DllStructCreate("ptr")
    	Local $pbufferptr = DllStructGetPtr($tbufferptr)
    	Local $ncount = _winapi_formatmessage(BitOR($__winapiconstant_format_message_allocate_buffer, $__winapiconstant_format_message_from_system), 0, _winapi_getlasterror(), 0, $pbufferptr, 0, 0)
    	If @error Then Return SetError(@error, 0, "")
    	Local $stext = ""
    	Local $pbuffer = DllStructGetData($tbufferptr, 1)
    	If $pbuffer Then
    		If $ncount > 0 Then
    			Local $tbuffer = DllStructCreate("wchar[" & ($ncount + 1) & "]", $pbuffer)
    			$stext = DllStructGetData($tbuffer, 1)
    		EndIf
    		_winapi_localfree($pbuffer)
    	EndIf
    	Return $stext
    EndFunc
    
    Func _winapi_getlayeredwindowattributes($hwnd, ByRef $i_transcolor, ByRef $transparency, $ascolorref = False)
    	$i_transcolor = -1
    	$transparency = -1
    	Local $aresult = DllCall("user32.dll", "bool", "GetLayeredWindowAttributes", "hwnd", $hwnd, "dword*", $i_transcolor, "byte*", $transparency, "dword*", 0)
    	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($aresult[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", $hobject, "int", $isize, "ptr", $pobject)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getopenfilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $hwndowner = 0)
    	Local $ipathlen = 4096
    	Local $inulls = 0
    	Local $tofn = DllStructCreate($tagopenfilename)
    	Local $afiles[1] = [0]
    	Local $iflag = $iflags
    	Local $asflines = StringSplit($sfilter, "|")
    	Local $asfilter[$asflines[0] * 2 + 1]
    	Local $istart, $ifinal, $stfilter
    	$asfilter[0] = $asflines[0] * 2
    	For $i = 1 To $asflines[0]
    		$istart = StringInStr($asflines[$i], "(", 0, 1)
    		$ifinal = StringInStr($asflines[$i], ")", 0, -1)
    		$asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $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($sinitaldir) + 1 & "]")
    	Local $tfilter = DllStructCreate($stfilter & "wchar")
    	Local $tpath = DllStructCreate("wchar Path[" & $ipathlen & "]")
    	Local $textn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 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", "GetOpenFileNameW", "ptr", DllStructGetPtr($tofn))
    	If @error Then Return SetError(@error, @extended, $afiles)
    	If BitAND($iflags, $ofn_allowmultiselect) = $ofn_allowmultiselect AND BitAND($iflags, $ofn_explorer) = $ofn_explorer Then
    		For $x = 1 To $ipathlen
    			If DllStructGetData($tpath, "Path", $x) = Chr(0) Then
    				DllStructSetData($tpath, "Path", "|", $x)
    				$inulls += 1
    			Else
    				$inulls = 0
    			EndIf
    			If $inulls = 2 Then ExitLoop 
    		Next
    		DllStructSetData($tpath, "Path", Chr(0), $x - 1)
    		$afiles = StringSplit(DllStructGetData($tpath, "Path"), "|")
    		If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
    		Return StringSplit(DllStructGetData($tpath, "Path"), "|")
    	ElseIf BitAND($iflags, $ofn_allowmultiselect) = $ofn_allowmultiselect Then
    		$afiles = StringSplit(DllStructGetData($tpath, "Path"), " ")
    		If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
    		Return StringSplit(StringReplace(DllStructGetData($tpath, "Path"), " ", "|"), "|")
    	Else
    		Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
    	EndIf
    EndFunc
    
    Func _winapi_getoverlappedresult($hfile, $poverlapped, ByRef $ibytes, $fwait = False)
    	Local $aresult = DllCall("kernel32.dll", "bool", "GetOverlappedResult", "handle", $hfile, "ptr", $poverlapped, "dword*", 0, "bool", $fwait)
    	If @error Then Return SetError(@error, @extended, False)
    	$ibytes = $aresult[3]
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getparent($hwnd)
    	Local $aresult = DllCall("user32.dll", "hwnd", "GetParent", "hwnd", $hwnd)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getprocessaffinitymask($hprocess)
    	Local $aresult = DllCall("kernel32.dll", "bool", "GetProcessAffinityMask", "handle", $hprocess, "dword_ptr*", 0, "dword_ptr*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	Local $amask[3]
    	$amask[0] = True
    	$amask[1] = $aresult[2]
    	$amask[2] = $aresult[3]
    	Return $amask
    EndFunc
    
    Func _winapi_getsavefilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $hwndowner = 0)
    	Local $ipathlen = 4096
    	Local $tofn = DllStructCreate($tagopenfilename)
    	Local $afiles[1] = [0]
    	Local $iflag = $iflags
    	Local $asflines = StringSplit($sfilter, "|")
    	Local $asfilter[$asflines[0] * 2 + 1]
    	Local $istart, $ifinal, $stfilter
    	$asfilter[0] = $asflines[0] * 2
    	For $i = 1 To $asflines[0]
    		$istart = StringInStr($asflines[$i], "(", 0, 1)
    		$ifinal = StringInStr($asflines[$i], ")", 0, -1)
    		$asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $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($sinitaldir) + 1 & "]")
    	Local $tfilter = DllStructCreate($stfilter & "wchar")
    	Local $tpath = DllStructCreate("wchar Path[" & $ipathlen & "]")
    	Local $textn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 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", DllStructGetPtr($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", "dword", $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", $iindex)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getsyscolorbrush($iindex)
    	Local $aresult = DllCall("user32.dll", "handle", "GetSysColorBrush", "int", $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, "wstr", $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", $hwnd, "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, "Top")
    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($twindowplacement))
    	Local $pwindowplacement = DllStructGetPtr($twindowplacement)
    	DllCall("user32.dll", "bool", "GetWindowPlacement", "hwnd", $hwnd, "ptr", $pwindowplacement)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $twindowplacement
    EndFunc
    
    Func _winapi_getwindowrect($hwnd)
    	Local $trect = DllStructCreate($tagrect)
    	DllCall("user32.dll", "bool", "GetWindowRect", "hwnd", $hwnd, "ptr", DllStructGetPtr($trect))
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $trect
    EndFunc
    
    Func _winapi_getwindowrgn($hwnd, $hrgn)
    	Local $aresult = DllCall("user32.dll", "int", "GetWindowRgn", "hwnd", $hwnd, "handle", $hrgn)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getwindowtext($hwnd)
    	Local $aresult = DllCall("user32.dll", "int", "GetWindowTextW", "hwnd", $hwnd, "wstr", "", "int", 4096)
    	If @error Then Return SetError(@error, @extended, "")
    	Return SetExtended($aresult[0], $aresult[2])
    EndFunc
    
    Func _winapi_getwindowthreadprocessid($hwnd, ByRef $ipid)
    	Local $aresult = DllCall("user32.dll", "dword", "GetWindowThreadProcessId", "hwnd", $hwnd, "dword*", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	$ipid = $aresult[2]
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_getwindowwidth($hwnd)
    	Local $trect = _winapi_getwindowrect($hwnd)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return DllStructGetData($trect, "Right") - DllStructGetData($trect, "Left")
    EndFunc
    
    Func _winapi_getxyfrompoint(ByRef $tpoint, ByRef $ix, ByRef $iy)
    	$ix = DllStructGetData($tpoint, "X")
    	$iy = DllStructGetData($tpoint, "Y")
    EndFunc
    
    Func _winapi_globalmemorystatus()
    	Local $tmem = DllStructCreate($tagmemorystatusex)
    	Local $pmem = DllStructGetPtr($tmem)
    	Local $imem = DllStructGetSize($tmem)
    	DllStructSetData($tmem, 1, $imem)
    	DllCall("kernel32.dll", "none", "GlobalMemoryStatusEx", "ptr", $pmem)
    	If @error Then Return SetError(@error, @extended, 0)
    	Local $amem[7]
    	$amem[0] = DllStructGetData($tmem, 2)
    	$amem[1] = DllStructGetData($tmem, 3)
    	$amem[2] = DllStructGetData($tmem, 4)
    	$amem[3] = DllStructGetData($tmem, 5)
    	$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[$x]))) = StringUpper($aclassname[$x]) Then Return True
    	Next
    	Return False
    EndFunc
    
    Func _winapi_iswindow($hwnd)
    	Local $aresult = DllCall("user32.dll", "bool", "IsWindow", "hwnd", $hwnd)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_iswindowvisible($hwnd)
    	Local $aresult = DllCall("user32.dll", "bool", "IsWindowVisible", "hwnd", $hwnd)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_invalidaterect($hwnd, $trect = 0, $ferase = True)
    	Local $prect = 0
    	If IsDllStruct($trect) Then $prect = DllStructGetPtr($trect)
    	Local $aresult = DllCall("user32.dll", "bool", "InvalidateRect", "hwnd", $hwnd, "ptr", $prect, "bool", $ferase)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_lineto($hdc, $ix, $iy)
    	Local $aresult = DllCall("gdi32.dll", "bool", "LineTo", "handle", $hdc, "int", $ix, "int", $iy)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_loadbitmap($hinstance, $sbitmap)
    	Local $sbitmaptype = "int"
    	If IsString($sbitmap) Then $sbitmaptype = "wstr"
    	Local $aresult = DllCall("user32.dll", "handle", "LoadBitmapW", "handle", $hinstance, $sbitmaptype, $sbitmap)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_loadimage($hinstance, $simage, $itype, $ixdesired, $iydesired, $iload)
    	Local $aresult, $simagetype = "int"
    	If IsString($simage) Then $simagetype = "wstr"
    	$aresult = DllCall("user32.dll", "handle", "LoadImageW", "handle", $hinstance, $simagetype, $simage, "uint", $itype, "int", $ixdesired, "int", $iydesired, "uint", $iload)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_loadlibrary($sfilename)
    	Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryW", "wstr", $sfilename)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_loadlibraryex($sfilename, $iflags = 0)
    	Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryExW", "wstr", $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, $picons, 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", $isound)
    	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
    
    Func _winapi_mouse_event($iflags, $ix = 0, $iy = 0, $idata = 0, $iextrainfo = 0)
    	DllCall("user32.dll", "none", "mouse_event", "dword", $iflags, "dword", $ix, "dword", $iy, "dword", $idata, "ulong_ptr", $iextrainfo)
    	If @error Then Return SetError(@error, @extended)
    EndFunc
    
    Func _winapi_moveto($hdc, $ix, $iy)
    	Local $aresult = DllCall("gdi32.dll", "bool", "MoveToEx", "handle", $hdc, "int", $ix, "int", $iy, "ptr", 0)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_movewindow($hwnd, $ix, $iy, $iwidth, $iheight, $frepaint = True)
    	Local $aresult = DllCall("user32.dll", "bool", "MoveWindow", "hwnd", $hwnd, "int", $ix, "int", $iy, "int", $iwidth, "int", $iheight, "bool", $frepaint)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_muldiv($inumber, $inumerator, $idenominator)
    	Local $aresult = DllCall("kernel32.dll", "int", "MulDiv", "int", $inumber, "int", $inumerator, "int", $idenominator)
    	If @error Then Return SetError(@error, @extended, -1)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_multibytetowidechar($stext, $icodepage = 0, $iflags = 0, $bretstring = False)
    	Local $stexttype = "ptr", $ptext = $stext
    	If IsDllStruct($stext) Then
    		$ptext = DllStructGetPtr($stext)
    	Else
    		If NOT IsPtr($stext) Then $stexttype = "STR"
    	EndIf
    	Local $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $ptext, "int", -1, "ptr", 0, "int", 0)
    	If @error Then Return SetError(@error, @extended, 0)
    	Local $iout = $aresult[0]
    	Local $tout = DllStructCreate("wchar[" & $iout & "]")
    	Local $pout = DllStructGetPtr($tout)
    	$aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $ptext, "int", -1, "ptr", $pout, "int", $iout)
    	If @error Then Return SetError(@error, @extended, 0)
    	If $bretstring Then Return DllStructGetData($tout, 1)
    	Return $tout
    EndFunc
    
    Func _winapi_multibytetowidecharex($stext, $ptext, $icodepage = 0, $iflags = 0)
    	Local $aresult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $icodepage, "dword", $iflags, "STR", $stext, "int", -1, "ptr", $ptext, "int", (StringLen($stext) + 1) * 2)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_openprocess($iaccess, $finherit, $iprocessid, $fdebugpriv = False)
    	Local $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $finherit, "dword", $iprocessid)
    	If @error Then Return SetError(@error, @extended, 0)
    	If $aresult[0] Then Return $aresult[0]
    	If NOT $fdebugpriv Then Return 0
    	Local $htoken = _security__openthreadtokenex(BitOR($token_adjust_privileges, $token_query))
    	If @error Then Return SetError(@error, @extended, 0)
    	_security__setprivilege($htoken, "SeDebugPrivilege", True)
    	Local $ierror = @error
    	Local $ilasterror = @extended
    	Local $iret = 0
    	If NOT @error Then
    		$aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $finherit, "dword", $iprocessid)
    		$ierror = @error
    		$ilasterror = @extended
    		If $aresult[0] Then $iret = $aresult[0]
    		_security__setprivilege($htoken, "SeDebugPrivilege", False)
    		If @error Then
    			$ierror = @error
    			$ilasterror = @extended
    		EndIf
    	EndIf
    	_winapi_closehandle($htoken)
    	Return SetError($ierror, $ilasterror, $iret)
    EndFunc
    
    Func __winapi_parsefiledialogpath($spath)
    	Local $afiles[3]
    	$afiles[0] = 2
    	Local $stemp = StringMid($spath, 1, StringInStr($spath, "\", 0, -1) - 1)
    	$afiles[1] = $stemp
    	$afiles[2] = StringMid($spath, StringInStr($spath, "\", 0, -1) + 1)
    	Return $afiles
    EndFunc
    
    Func _winapi_pathfindonpath(Const $szfile, $aextrapaths = "", Const $szpathdelimiter = @LF)
    	Local $iextracount = 0
    	If IsString($aextrapaths) Then
    		If StringLen($aextrapaths) Then
    			$aextrapaths = StringSplit($aextrapaths, $szpathdelimiter, 1 + 2)
    			$iextracount = UBound($aextrapaths, 1)
    		EndIf
    	ElseIf IsArray($aextrapaths) Then
    		$iextracount = UBound($aextrapaths)
    	EndIf
    	Local $tpaths, $tpathptrs
    	If $iextracount Then
    		Local $szstruct = ""
    		For $path In $aextrapaths
    			$szstruct &= "wchar[" & StringLen($path) + 1 & "];"
    		Next
    		$tpaths = DllStructCreate($szstruct)
    		$tpathptrs = DllStructCreate("ptr[" & $iextracount + 1 & "]")
    		For $i = 1 To $iextracount
    			DllStructSetData($tpaths, $i, $aextrapaths[$i - 1])
    			DllStructSetData($tpathptrs, 1, DllStructGetPtr($tpaths, $i), $i)
    		Next
    		DllStructSetData($tpathptrs, 1, Ptr(0), $iextracount + 1)
    	EndIf
    	Local $aresult = DllCall("shlwapi.dll", "bool", "PathFindOnPathW", "wstr", $szfile, "ptr", DllStructGetPtr($tpathptrs))
    	If @error Then Return SetError(@error, @extended, False)
    	If $aresult[0] = 0 Then Return SetError(1, 0, $szfile)
    	Return $aresult[1]
    EndFunc
    
    Func _winapi_pointfromrect(ByRef $trect, $fcenter = True)
    	Local $ix1 = DllStructGetData($trect, "Left")
    	Local $iy1 = DllStructGetData($trect, "Top")
    	Local $ix2 = DllStructGetData($trect, "Right")
    	Local $iy2 = DllStructGetData($trect, "Bottom")
    	If $fcenter Then
    		$ix1 = $ix1 + (($ix2 - $ix1) / 2)
    		$iy1 = $iy1 + (($iy2 - $iy1) / 2)
    	EndIf
    	Local $tpoint = DllStructCreate($tagpoint)
    	DllStructSetData($tpoint, "X", $ix1)
    	DllStructSetData($tpoint, "Y", $iy1)
    	Return $tpoint
    EndFunc
    
    Func _winapi_postmessage($hwnd, $imsg, $iwparam, $ilparam)
    	Local $aresult = DllCall("user32.dll", "bool", "PostMessage", "hwnd", $hwnd, "uint", $imsg, "wparam", $iwparam, "lparam", $ilparam)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_primarylangid($lgid)
    	Return BitAND($lgid, 1023)
    EndFunc
    
    Func _winapi_ptinrect(ByRef $trect, ByRef $tpoint)
    	Local $ix = DllStructGetData($tpoint, "X")
    	Local $iy = DllStructGetData($tpoint, "Y")
    	Local $aresult = DllCall("user32.dll", "bool", "PtInRect", "ptr", DllStructGetPtr($trect), "long", $ix, "long", $iy)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_readfile($hfile, $pbuffer, $itoread, ByRef $iread, $poverlapped = 0)
    	Local $aresult = DllCall("kernel32.dll", "bool", "ReadFile", "handle", $hfile, "ptr", $pbuffer, "dword", $itoread, "dword*", 0, "ptr", $poverlapped)
    	If @error Then Return SetError(@error, @extended, False)
    	$iread = $aresult[4]
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_readprocessmemory($hprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iread)
    	Local $aresult = DllCall("kernel32.dll", "bool", "ReadProcessMemory", "handle", $hprocess, "ptr", $pbaseaddress, "ptr", $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
    	If @error Then Return SetError(@error, @extended, False)
    	$iread = $aresult[5]
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_rectisempty(ByRef $trect)
    	Return (DllStructGetData($trect, "Left") = 0) AND (DllStructGetData($trect, "Top") = 0) AND (DllStructGetData($trect, "Right") = 0) AND (DllStructGetData($trect, "Bottom") = 0)
    EndFunc
    
    Func _winapi_redrawwindow($hwnd, $trect = 0, $hregion = 0, $iflags = 5)
    	Local $prect = 0
    	If $trect <> 0 Then $prect = DllStructGetPtr($trect)
    	Local $aresult = DllCall("user32.dll", "bool", "RedrawWindow", "hwnd", $hwnd, "ptr", $prect, "handle", $hregion, "uint", $iflags)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_registerwindowmessage($smessage)
    	Local $aresult = DllCall("user32.dll", "uint", "RegisterWindowMessageW", "wstr", $smessage)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_releasecapture()
    	Local $aresult = DllCall("user32.dll", "bool", "ReleaseCapture")
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_releasedc($hwnd, $hdc)
    	Local $aresult = DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hwnd, "handle", $hdc)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_screentoclient($hwnd, ByRef $tpoint)
    	Local $aresult = DllCall("user32.dll", "bool", "ScreenToClient", "hwnd", $hwnd, "ptr", DllStructGetPtr($tpoint))
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_selectobject($hdc, $hgdiobj)
    	Local $aresult = DllCall("gdi32.dll", "handle", "SelectObject", "handle", $hdc, "handle", $hgdiobj)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setbkcolor($hdc, $icolor)
    	Local $aresult = DllCall("gdi32.dll", "INT", "SetBkColor", "handle", $hdc, "dword", $icolor)
    	If @error Then Return SetError(@error, @extended, -1)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setbkmode($hdc, $ibkmode)
    	Local $aresult = DllCall("gdi32.dll", "int", "SetBkMode", "handle", $hdc, "int", $ibkmode)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setcapture($hwnd)
    	Local $aresult = DllCall("user32.dll", "hwnd", "SetCapture", "hwnd", $hwnd)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setcursor($hcursor)
    	Local $aresult = DllCall("user32.dll", "handle", "SetCursor", "handle", $hcursor)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setdefaultprinter($sprinter)
    	Local $aresult = DllCall("winspool.drv", "bool", "SetDefaultPrinterW", "wstr", $sprinter)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setdibits($hdc, $hbmp, $istartscan, $iscanlines, $pbits, $pbmi, $icoloruse = 0)
    	Local $aresult = DllCall("gdi32.dll", "int", "SetDIBits", "handle", $hdc, "handle", $hbmp, "uint", $istartscan, "uint", $iscanlines, "ptr", $pbits, "ptr", $pbmi, "uint", $icoloruse)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    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", "handle", $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 = 255, $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", "SetLayeredWindowAttributes", "hwnd", $hwnd, "dword", $i_transcolor, "byte", $transparency, "dword", $dwflags)
    	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", $hwndchild, "hwnd", $hwndparent)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setprocessaffinitymask($hprocess, $imask)
    	Local $aresult = DllCall("kernel32.dll", "bool", "SetProcessAffinityMask", "handle", $hprocess, "ulong_ptr", $imask)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setsyscolors($velements, $vcolors)
    	Local $isearray = IsArray($velements), $iscarray = IsArray($vcolors)
    	Local $ielementnum
    	If NOT $iscarray AND NOT $isearray Then
    		$ielementnum = 1
    	ElseIf $iscarray OR $isearray Then
    		If NOT $iscarray OR NOT $isearray Then Return SetError(-1, -1, False)
    		If UBound($velements) <> UBound($vcolors) Then Return SetError(-1, -1, False)
    		$ielementnum = UBound($velements)
    	EndIf
    	Local $telements = DllStructCreate("int Element[" & $ielementnum & "]")
    	Local $tcolors = DllStructCreate("dword NewColor[" & $ielementnum & "]")
    	Local $pelements = DllStructGetPtr($telements)
    	Local $pcolors = DllStructGetPtr($tcolors)
    	If NOT $isearray Then
    		DllStructSetData($telements, "Element", $velements, 1)
    	Else
    		For $x = 0 To $ielementnum - 1
    			DllStructSetData($telements, "Element", $velements[$x], $x + 1)
    		Next
    	EndIf
    	If NOT $iscarray Then
    		DllStructSetData($tcolors, "NewColor", $vcolors, 1)
    	Else
    		For $x = 0 To $ielementnum - 1
    			DllStructSetData($tcolors, "NewColor", $vcolors[$x], $x + 1)
    		Next
    	EndIf
    	Local $aresult = DllCall("user32.dll", "bool", "SetSysColors", "int", $ielementnum, "ptr", $pelements, "ptr", $pcolors)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_settextcolor($hdc, $icolor)
    	Local $aresult = DllCall("gdi32.dll", "INT", "SetTextColor", "handle", $hdc, "dword", $icolor)
    	If @error Then Return SetError(@error, @extended, -1)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setwindowlong($hwnd, $iindex, $ivalue)
    	_winapi_setlasterror(0)
    	Local $sfuncname = "SetWindowLongW"
    	If @AutoItX64 Then $sfuncname = "SetWindowLongPtrW"
    	Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $hwnd, "int", $iindex, "long_ptr", $ivalue)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setwindowplacement($hwnd, $pwindowplacement)
    	Local $aresult = DllCall("user32.dll", "bool", "SetWindowPlacement", "hwnd", $hwnd, "ptr", $pwindowplacement)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setwindowpos($hwnd, $hafter, $ix, $iy, $icx, $icy, $iflags)
    	Local $aresult = DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $hwnd, "hwnd", $hafter, "int", $ix, "int", $iy, "int", $icx, "int", $icy, "uint", $iflags)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setwindowrgn($hwnd, $hrgn, $bredraw = True)
    	Local $aresult = DllCall("user32.dll", "int", "SetWindowRgn", "hwnd", $hwnd, "handle", $hrgn, "bool", $bredraw)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setwindowshookex($idhook, $lpfn, $hmod, $dwthreadid = 0)
    	Local $aresult = DllCall("user32.dll", "handle", "SetWindowsHookEx", "int", $idhook, "ptr", $lpfn, "handle", $hmod, "dword", $dwthreadid)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_setwindowtext($hwnd, $stext)
    	Local $aresult = DllCall("user32.dll", "bool", "SetWindowTextW", "hwnd", $hwnd, "wstr", $stext)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_showcursor($fshow)
    	Local $aresult = DllCall("user32.dll", "int", "ShowCursor", "bool", $fshow)
    	If @error Then Return SetError(@error, @extended, 0)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_showerror($stext, $fexit = True)
    	_winapi_msgbox(266256, "Error", $stext)
    	If $fexit Then Exit 
    EndFunc
    
    Func _winapi_showmsg($stext)
    	_winapi_msgbox(64 + 4096, "Information", $stext)
    EndFunc
    
    Func _winapi_showwindow($hwnd, $icmdshow = 5)
    	Local $aresult = DllCall("user32.dll", "bool", "ShowWindow", "hwnd", $hwnd, "int", $icmdshow)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_stringfromguid($pguid)
    	Local $aresult = DllCall("ole32.dll", "int", "StringFromGUID2", "ptr", $pguid, "wstr", "", "int", 40)
    	If @error Then Return SetError(@error, @extended, "")
    	Return SetExtended($aresult[0], $aresult[2])
    EndFunc
    
    Func _winapi_sublangid($lgid)
    	Return BitShift($lgid, 10)
    EndFunc
    
    Func _winapi_systemparametersinfo($iaction, $iparam = 0, $vparam = 0, $iwinini = 0)
    	Local $aresult = DllCall("user32.dll", "bool", "SystemParametersInfoW", "uint", $iaction, "uint", $iparam, "ptr", $vparam, "uint", $iwinini)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_twipsperpixelx()
    	Local $lngdc, $twipsperpixelx
    	$lngdc = _winapi_getdc(0)
    	$twipsperpixelx = 1440 / _winapi_getdevicecaps($lngdc, $__winapiconstant_logpixelsx)
    	_winapi_releasedc(0, $lngdc)
    	Return $twipsperpixelx
    EndFunc
    
    Func _winapi_twipsperpixely()
    	Local $lngdc, $twipsperpixely
    	$lngdc = _winapi_getdc(0)
    	$twipsperpixely = 1440 / _winapi_getdevicecaps($lngdc, $__winapiconstant_logpixelsy)
    	_winapi_releasedc(0, $lngdc)
    	Return $twipsperpixely
    EndFunc
    
    Func _winapi_unhookwindowshookex($hhk)
    	Local $aresult = DllCall("user32.dll", "bool", "UnhookWindowsHookEx", "handle", $hhk)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_updatelayeredwindow($hwnd, $hdcdest, $pptdest, $psize, $hdcsrce, $pptsrce, $irgb, $pblend, $iflags)
    	Local $aresult = DllCall("user32.dll", "bool", "UpdateLayeredWindow", "hwnd", $hwnd, "handle", $hdcdest, "ptr", $pptdest, "ptr", $psize, "handle", $hdcsrce, "ptr", $pptsrce, "dword", $irgb, "ptr", $pblend, "dword", $iflags)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_updatewindow($hwnd)
    	Local $aresult = DllCall("user32.dll", "bool", "UpdateWindow", "hwnd", $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", "handle", $hprocess, "dword", $itimeout)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_waitformultipleobjects($icount, $phandles, $fwaitall = False, $itimeout = -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, "int", 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", "handle", $hconsole, "wstr", $stext, "dword", StringLen($stext), "dword*", 0, "ptr", 0)
    	If @error Then Return SetError(@error, @extended, False)
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_writefile($hfile, $pbuffer, $itowrite, ByRef $iwritten, $poverlapped = 0)
    	Local $aresult = DllCall("kernel32.dll", "bool", "WriteFile", "handle", $hfile, "ptr", $pbuffer, "dword", $itowrite, "dword*", 0, "ptr", $poverlapped)
    	If @error Then Return SetError(@error, @extended, False)
    	$iwritten = $aresult[4]
    	Return $aresult[0]
    EndFunc
    
    Func _winapi_writeprocessmemory($hprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iwritten, $sbuffer = "ptr")
    	Local $aresult = DllCall("kernel32.dll", "bool", "WriteProcessMemory", "handle", $hprocess, "ptr", $pbaseaddress, $sbuffer, $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
    	If @error Then Return SetError(@error, @extended, False)
    	$iwritten = $aresult[5]
    	Return $aresult[0]
    EndFunc
    
    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 $pbs_marquee = 8
    Global Const $pbs_smooth = 1
    Global Const $pbs_smoothreverse = 16
    Global Const $pbs_vertical = 4
    Global Const $gui_ss_default_progress = 0
    Global Const $__progressbarconstant_wm_user = 1024
    Global Const $pbm_deltapos = $__progressbarconstant_wm_user + 3
    Global Const $pbm_getbarcolor = 1039
    Global Const $pbm_getbkcolor = 1038
    Global Const $pbm_getpos = $__progressbarconstant_wm_user + 8
    Global Const $pbm_getrange = $__progressbarconstant_wm_user + 7
    Global Const $pbm_getstate = 1041
    Global Const $pbm_getstep = 1037
    Global Const $pbm_setbarcolor = $__progressbarconstant_wm_user + 9
    Global Const $pbm_setbkcolor = 8192 + 1
    Global Const $pbm_setmarquee = $__progressbarconstant_wm_user + 10
    Global Const $pbm_setpos = $__progressbarconstant_wm_user + 2
    Global Const $pbm_setrange = $__progressbarconstant_wm_user + 1
    Global Const $pbm_setrange32 = $__progressbarconstant_wm_user + 6
    Global Const $pbm_setstate = 1040
    Global Const $pbm_setstep = $__progressbarconstant_wm_user + 4
    Global Const $pbm_stepit = $__progressbarconstant_wm_user + 5
    #Region Header
    #EndRegion Header
    #Region Global Variables and Constants
    Global Const $ieau3versioninfo[6] = ["V", 2, 4, 0, "20071231", "V2.4-0"]
    Global Const $lsfw_lock = 1, $lsfw_unlock = 2
    Global $__ieloadwaittimeout = 300000
    Global $__ieau3debug = False
    Global $__ieau3v1compatibility
    Global $__ieau3debug_useolddllcall = False
    Global $_ieerrornotify = True
    Global $oieerrorhandler, $sieusererrorhandler
    Global $iecomerrornumber, $iecomerrornumberhex, $iecomerrordescription, $iecomerrorscriptline, $iecomerrorwindescription, $iecomerrorsource, $iecomerrorhelpfile, $iecomerrorhelpcontext, $iecomerrorlastdllerror, $iecomerrorcomobj, $iecomerroroutput
    Global Enum $_iestatus_success = 0, $_iestatus_generalerror, $_iestatus_comerror, $_iestatus_invaliddatatype, $_iestatus_invalidobjecttype, $_iestatus_invalidvalue, $_iestatus_loadwaittimeout, $_iestatus_nomatch, $_iestatus_accessisdenied, $_iestatus_clientdisconnected
    Global Enum Step *2 $_ienotifylevel_none = 0, $_ienotifynotifylevel_warning = 1, $_ienotifynotifylevel_error, $_ienotifynotifylevel_comerror
    Global Enum Step *2 $_ienotifymethod_silent = 0, $_ienotifymethod_console = 1, $_ienotifymethod_tooltip, $_ienotifymethod_msgbox
    #EndRegion Global Variables and Constants
    #Region Core functions
    
    Func _iecreate($s_url = "about:blank", $f_tryattach = 0, $f_visible = 1, $f_wait = 1, $f_takefocus = 1)
    	If $__ieau3v1compatibility Then
    		Switch String($s_url)
    			Case "0"
    				$s_url = "about:blank"
    				$f_visible = 0
    				__ieerrornotify("Warning", "_IECreate", "", "Using deprecated behavior - $f_visible is now parameter 3 instead of parameter 1")
    			Case "1"
    				$s_url = "about:blank"
    				$f_visible = 1
    				__ieerrornotify("Warning", "_IECreate", "", "Using deprecated behavior - $f_visible is now parameter 3 instead of parameter 1")
    		EndSwitch
    	EndIf
    	If NOT $f_visible Then $f_takefocus = 0
    	If $f_tryattach Then
    		Local $oresult = _ieattach($s_url, "url")
    		If IsObj($oresult) Then
    			If $f_takefocus Then WinActivate(HWnd($oresult.hwnd))
    			Return SetError($_iestatus_success, 1, $oresult)
    		EndIf
    	EndIf
    	Local $f_mustunlock = 0
    	If NOT $f_visible AND __ielocksetforegroundwindow($lsfw_lock) Then $f_mustunlock = 1
    	Local $o_object = ObjCreate("InternetExplorer.Application")
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IECreate", "", "Browser Object Creation Failed")
    		Return SetError($_iestatus_generalerror, 0, 0)
    	EndIf
    	$o_object.visible = $f_visible
    	If $f_mustunlock AND NOT __ielocksetforegroundwindow($lsfw_unlock) Then __ieerrornotify("Warning", "_IECreate", "", "Foreground Window Unlock Failed!")
    	_ienavigate($o_object, $s_url, $f_wait)
    	Return SetError(@error, 0, $o_object)
    EndFunc
    
    Func _iecreateembedded()
    	Local $o_object = ObjCreate("Shell.Explorer.2")
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IECreateEmbedded", "", "WebBrowser Object Creation Failed")
    		Return SetError($_iestatus_generalerror, 0, 0)
    	EndIf
    	Return SetError($_iestatus_success, 0, $o_object)
    EndFunc
    
    Func _ienavigate(ByRef $o_object, $s_url, $f_wait = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IENavigate", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "documentContainer") Then
    		__ieerrornotify("Error", "_IENavigate", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$o_object.navigate($s_url)
    	If $f_wait Then
    		_ieloadwait($o_object)
    		Return SetError(@error, 0, -1)
    	EndIf
    	Return SetError($_iestatus_success, 0, -1)
    EndFunc
    
    Func _ieattach($s_string, $s_mode = "Title", $i_instance = 1)
    	$s_mode = StringLower($s_mode)
    	$i_instance = Int($i_instance)
    	If $i_instance < 1 Then
    		__ieerrornotify("Error", "_IEAttach", "$_IEStatus_InvalidValue", "$i_instance < 1")
    		Return SetError($_iestatus_invalidvalue, 3, 0)
    	EndIf
    	If $s_mode = "embedded" OR $s_mode = "dialogbox" Then
    		Local $iwintitlematchmode = Opt("WinTitleMatchMode", 2)
    		If $s_mode = "dialogbox" AND $i_instance > 1 Then
    			If IsHWnd($s_string) Then
    				$i_instance = 1
    				__ieerrornotify("Warning", "_IEAttach", "$_IEStatus_GeneralError", "$i_instance > 1 invalid with HWnd and DialogBox.  Setting to 1.")
    			Else
    				Local $a_winlist = WinList($s_string, "")
    				If $i_instance <= $a_winlist[0][0] Then
    					$s_string = $a_winlist[$i_instance][1]
    					$i_instance = 1
    				Else
    					__ieerrornotify("Warning", "_IEAttach", "$_IEStatus_NoMatch")
    					Opt("WinTitleMatchMode", $iwintitlematchmode)
    					Return SetError($_iestatus_nomatch, 1, 0)
    				EndIf
    			EndIf
    		EndIf
    		Local $h_control = ControlGetHandle($s_string, "", "[CLASS:Internet Explorer_Server; INSTANCE:" & $i_instance & "]")
    		Local $oresult = __iecontrolgetobjfromhwnd($h_control)
    		Opt("WinTitleMatchMode", $iwintitlematchmode)
    		If IsObj($oresult) Then
    			Return SetError($_iestatus_success, 0, $oresult)
    		Else
    			__ieerrornotify("Warning", "_IEAttach", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 1, 0)
    		EndIf
    	EndIf
    	Local $o_shell = ObjCreate("Shell.Application")
    	Local $o_shellwindows = $o_shell.windows()
    	Local $i_tmp = 1
    	Local $f_notifystatus, $status, $f_isbrowser, $s_tmp
    	For $o_window In $o_shellwindows
    		$f_isbrowser = True
    		$status = __ieinternalerrorhandlerregister()
    		If NOT $status Then __ieerrornotify("Warning", "_IEAttach", "Cannot register internal error handler, cannot trap COM errors", "Use _IEErrorHandlerRegister() to register a user error handler")
    		$f_notifystatus = _ieerrornotify()
    		_ieerrornotify(False)
    		If $f_isbrowser Then
    			$s_tmp = $o_window.type
    			If @error Then $f_isbrowser = False
    		EndIf
    		If $f_isbrowser Then
    			$s_tmp = $o_window.document.title
    			If @error Then $f_isbrowser = False
    		EndIf
    		_ieerrornotify($f_notifystatus)
    		__ieinternalerrorhandlerderegister()
    		If $f_isbrowser Then
    			Switch $s_mode
    				Case "title"
    					If StringInStr($o_window.document.title, $s_string) > 0 Then
    						If $i_instance = $i_tmp Then
    							Return SetError($_iestatus_success, 0, $o_window)
    						Else
    							$i_tmp += 1
    						EndIf
    					EndIf
    				Case "instance"
    					If $i_instance = $i_tmp Then
    						Return SetError($_iestatus_success, 0, $o_window)
    					Else
    						$i_tmp += 1
    					EndIf
    				Case "windowtitle"
    					Local $f_found = False
    					$s_tmp = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\", "Window Title")
    					If NOT @error Then
    						If StringInStr($o_window.document.title & " - " & $s_tmp, $s_string) Then $f_found = True
    					Else
    						If StringInStr($o_window.document.title & " - Microsoft Internet Explorer", $s_string) Then $f_found = True
    						If StringInStr($o_window.document.title & " - Windows Internet Explorer", $s_string) Then $f_found = True
    					EndIf
    					If $f_found Then
    						If $i_instance = $i_tmp Then
    							Return SetError($_iestatus_success, 0, $o_window)
    						Else
    							$i_tmp += 1
    						EndIf
    					EndIf
    				Case "url"
    					If StringInStr($o_window.locationurl, $s_string) > 0 Then
    						If $i_instance = $i_tmp Then
    							Return SetError($_iestatus_success, 0, $o_window)
    						Else
    							$i_tmp += 1
    						EndIf
    					EndIf
    				Case "text"
    					If StringInStr($o_window.document.body.innertext, $s_string) > 0 Then
    						If $i_instance = $i_tmp Then
    							Return SetError($_iestatus_success, 0, $o_window)
    						Else
    							$i_tmp += 1
    						EndIf
    					EndIf
    				Case "html"
    					If StringInStr($o_window.document.body.innerhtml, $s_string) > 0 Then
    						If $i_instance = $i_tmp Then
    							Return SetError($_iestatus_success, 0, $o_window)
    						Else
    							$i_tmp += 1
    						EndIf
    					EndIf
    				Case "hwnd"
    					If $i_instance > 1 Then
    						$i_instance = 1
    						__ieerrornotify("Warning", "_IEAttach", "$_IEStatus_GeneralError", "$i_instance > 1 invalid with HWnd.  Setting to 1.")
    					EndIf
    					If _iepropertyget($o_window, "hwnd") = $s_string Then
    						Return SetError($_iestatus_success, 0, $o_window)
    					EndIf
    				Case Else
    					__ieerrornotify("Error", "_IEAttach", "$_IEStatus_InvalidValue", "Invalid Mode Specified")
    					Return SetError($_iestatus_invalidvalue, 2, 0)
    			EndSwitch
    		EndIf
    	Next
    	__ieerrornotify("Warning", "_IEAttach", "$_IEStatus_NoMatch")
    	Return SetError($_iestatus_nomatch, 1, 0)
    EndFunc
    
    Func _ieloadwait(ByRef $o_object, $i_delay = 0, $i_timeout = -1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IELoadWait", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IELoadWait", "$_IEStatus_InvalidObjectType", ObjName($o_object))
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Local $otemp, $f_abort = False, $i_errorstatuscode = $_iestatus_success
    	Local $status = __ieinternalerrorhandlerregister()
    	If NOT $status Then __ieerrornotify("Warning", "_IELoadWait", "Cannot register internal error handler, cannot trap COM errors", "Use _IEErrorHandlerRegister() to register a user error handler")
    	Local $f_notifystatus = _ieerrornotify()
    	_ieerrornotify(False)
    	Sleep($i_delay)
    	Local $ieloadwaittimer = TimerInit()
    	If $i_timeout = -1 Then $i_timeout = $__ieloadwaittimeout
    	Switch ObjName($o_object)
    		Case "IWebBrowser2"
    			While NOT (String($o_object.readystate) = "complete" OR $o_object.readystate = 4 OR $f_abort)
    				If (TimerDiff($ieloadwaittimer) > $i_timeout) Then
    					$i_errorstatuscode = $_iestatus_loadwaittimeout
    					$f_abort = True
    				EndIf
    				If @error = $_iestatus_comerror AND __iecomerrorunrecoverable() Then
    					$i_errorstatuscode = __iecomerrorunrecoverable()
    					$f_abort = True
    				EndIf
    				Sleep(100)
    			WEnd
    			While NOT (String($o_object.document.readystate) = "complete" OR $o_object.document.readystate = 4 OR $f_abort)
    				If (TimerDiff($ieloadwaittimer) > $i_timeout) Then
    					$i_errorstatuscode = $_iestatus_loadwaittimeout
    					$f_abort = True
    				EndIf
    				If @error = $_iestatus_comerror AND __iecomerrorunrecoverable() Then
    					$i_errorstatuscode = __iecomerrorunrecoverable()
    					$f_abort = True
    				EndIf
    				Sleep(100)
    			WEnd
    		Case "DispHTMLWindow2"
    			While NOT (String($o_object.document.readystate) = "complete" OR $o_object.document.readystate = 4 OR $f_abort)
    				If (TimerDiff($ieloadwaittimer) > $i_timeout) Then
    					$i_errorstatuscode = $_iestatus_loadwaittimeout
    					$f_abort = True
    				EndIf
    				If @error = $_iestatus_comerror AND __iecomerrorunrecoverable() Then
    					$i_errorstatuscode = __iecomerrorunrecoverable()
    					$f_abort = True
    				EndIf
    				Sleep(100)
    			WEnd
    			While NOT (String($o_object.top.document.readystate) = "complete" OR $o_object.top.document.readystate = 4 OR $f_abort)
    				If (TimerDiff($ieloadwaittimer) > $i_timeout) Then
    					$i_errorstatuscode = $_iestatus_loadwaittimeout
    					$f_abort = True
    				EndIf
    				If @error = $_iestatus_comerror AND __iecomerrorunrecoverable() Then
    					$i_errorstatuscode = __iecomerrorunrecoverable()
    					$f_abort = True
    				EndIf
    				Sleep(100)
    			WEnd
    		Case "DispHTMLDocument"
    			$otemp = $o_object.parentwindow
    			While NOT (String($otemp.document.readystate) = "complete" OR $otemp.document.readystate = 4 OR $f_abort)
    				If (TimerDiff($ieloadwaittimer) > $i_timeout) Then
    					$i_errorstatuscode = $_iestatus_loadwaittimeout
    					$f_abort = True
    				EndIf
    				If @error = $_iestatus_comerror AND __iecomerrorunrecoverable() Then
    					$i_errorstatuscode = __iecomerrorunrecoverable()
    					$f_abort = True
    				EndIf
    				Sleep(100)
    			WEnd
    			While NOT (String($otemp.top.document.readystate) = "complete" OR $otemp.top.document.readystate = 4 OR $f_abort)
    				If (TimerDiff($ieloadwaittimer) > $i_timeout) Then
    					$i_errorstatuscode = $_iestatus_loadwaittimeout
    					$f_abort = True
    				EndIf
    				If @error = $_iestatus_comerror AND __iecomerrorunrecoverable() Then
    					$i_errorstatuscode = __iecomerrorunrecoverable()
    					$f_abort = True
    				EndIf
    				Sleep(100)
    			WEnd
    		Case Else
    			$otemp = $o_object.document.parentwindow
    			While NOT (String($otemp.document.readystate) = "complete" OR $otemp.document.readystate = 4 OR $f_abort)
    				If (TimerDiff($ieloadwaittimer) > $i_timeout) Then
    					$i_errorstatuscode = $_iestatus_loadwaittimeout
    					$f_abort = True
    				EndIf
    				If @error = $_iestatus_comerror AND __iecomerrorunrecoverable() Then
    					$i_errorstatuscode = __iecomerrorunrecoverable()
    					$f_abort = True
    				EndIf
    				Sleep(100)
    			WEnd
    			While NOT (String($otemp.top.document.readystate) = "complete" OR $o_object.top.document.readystate = 4 OR $f_abort)
    				If (TimerDiff($ieloadwaittimer) > $i_timeout) Then
    					$i_errorstatuscode = $_iestatus_loadwaittimeout
    					$f_abort = True
    				EndIf
    				If @error = $_iestatus_comerror AND __iecomerrorunrecoverable() Then
    					$i_errorstatuscode = __iecomerrorunrecoverable()
    					$f_abort = True
    				EndIf
    				Sleep(100)
    			WEnd
    	EndSwitch
    	_ieerrornotify($f_notifystatus)
    	__ieinternalerrorhandlerderegister()
    	Switch $i_errorstatuscode
    		Case $_iestatus_success
    			Return SetError($_iestatus_success, 0, 1)
    		Case $_iestatus_loadwaittimeout
    			__ieerrornotify("Warning", "_IELoadWait", "$_IEStatus_LoadWaitTimeout")
    			Return SetError($_iestatus_loadwaittimeout, 3, 0)
    		Case $_iestatus_accessisdenied
    			__ieerrornotify("Warning", "_IELoadWait", "$_IEStatus_AccessIsDenied", "Cannot verify readyState.  Likely casue: cross-site scripting security restriction.")
    			Return SetError($_iestatus_accessisdenied, 0, 0)
    		Case $_iestatus_clientdisconnected
    			__ieerrornotify("Error", "_IELoadWait", "$_IEStatus_ClientDisconnected", "Browser has been deleted prior to operation.")
    			Return SetError($_iestatus_clientdisconnected, 0, 0)
    		Case Else
    			__ieerrornotify("Error", "_IELoadWait", "$_IEStatus_GeneralError", "Invalid Error Status - Notify IE.au3 developer")
    			Return SetError($_iestatus_generalerror, 0, 0)
    	EndSwitch
    EndFunc
    
    Func _ieloadwaittimeout($i_timeout = -1)
    	If $i_timeout = -1 Then
    		Return SetError($_iestatus_success, 0, $__ieloadwaittimeout)
    	Else
    		$__ieloadwaittimeout = $i_timeout
    		Return SetError($_iestatus_success, 0, 1)
    	EndIf
    EndFunc
    
    #EndRegion Core functions
    #Region Frame Functions
    
    Func _ieisframeset(ByRef $o_object)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEIsFrameSet", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If String($o_object.document.body.tagname) = "FRAMESET" Then
    		Return SetError($_iestatus_success, 0, 1)
    	Else
    		Return SetError($_iestatus_success, 0, 0)
    	EndIf
    EndFunc
    
    Func _ieframegetcollection(ByRef $o_object, $i_index = -1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFrameGetCollection", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	$i_index = Number($i_index)
    	Select 
    		Case $i_index = -1
    			Return SetError($_iestatus_success, $o_object.document.parentwindow.frames.length, $o_object.document.parentwindow.frames)
    		Case $i_index > -1 AND $i_index < $o_object.document.parentwindow.frames.length
    			Return SetError($_iestatus_success, $o_object.document.parentwindow.frames.length, $o_object.document.parentwindow.frames.item($i_index))
    		Case $i_index < -1
    			__ieerrornotify("Error", "_IEFrameGetCollection", "$_IEStatus_InvalidValue", "$i_index < -1")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    		Case Else
    			__ieerrornotify("Warning", "_IEFrameGetCollection", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 2, 0)
    	EndSelect
    EndFunc
    
    Func _ieframegetobjbyname(ByRef $o_object, $s_name)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFrameGetObjByName", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $otemp, $oframes
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IEFrameGetObjByName", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	If __ieisobjtype($o_object, "document") Then
    		$otemp = $o_object.parentwindow
    	Else
    		$otemp = $o_object.document.parentwindow
    	EndIf
    	If _ieisframeset($otemp) Then
    		$oframes = _ietagnamegetcollection($otemp, "frame")
    	Else
    		$oframes = _ietagnamegetcollection($otemp, "iframe")
    	EndIf
    	If $oframes.length Then
    		For $oframe In $oframes
    			If $oframe.name = $s_name Then Return SetError($_iestatus_success, 0, $otemp.frames($s_name))
    		Next
    		__ieerrornotify("Warning", "_IEFrameGetObjByName", "$_IEStatus_NoMatch", "No frames matching name")
    		Return SetError($_iestatus_nomatch, 2, 0)
    	Else
    		__ieerrornotify("Warning", "_IEFrameGetObjByName", "$_IEStatus_NoMatch", "No Frames found")
    		Return SetError($_iestatus_nomatch, 2, 0)
    	EndIf
    EndFunc
    
    #EndRegion Frame Functions
    #Region Link functions
    
    Func _ielinkclickbytext(ByRef $o_object, $s_linktext, $i_index = 0, $f_wait = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IELinkClickByText", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $found = 0, $linktext, $links = $o_object.document.links
    	$i_index = Number($i_index)
    	For $link In $links
    		$linktext = $link.outertext & ""
    		If $linktext = $s_linktext Then
    			If ($found = $i_index) Then
    				$link.click
    				If $f_wait Then
    					_ieloadwait($o_object)
    					Return SetError(@error, 0, -1)
    				EndIf
    				Return SetError($_iestatus_success, 0, -1)
    			EndIf
    			$found = $found + 1
    		EndIf
    	Next
    	__ieerrornotify("Warning", "_IELinkClickByText", "$_IEStatus_NoMatch")
    	Return SetError($_iestatus_nomatch, 0, 0)
    EndFunc
    
    Func _ielinkclickbyindex(ByRef $o_object, $i_index, $f_wait = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IELinkClickByIndex", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $olinks = $o_object.document.links, $olink
    	$i_index = Number($i_index)
    	If ($i_index >= 0) AND ($i_index <= $olinks.length - 1) Then
    		$olink = $olinks($i_index)
    		$olink.click
    		If $f_wait Then
    			_ieloadwait($o_object)
    			Return SetError(@error, 0, -1)
    		EndIf
    		Return SetError($_iestatus_success, 0, -1)
    	Else
    		__ieerrornotify("Warning", "_IELinkClickByIndex", "$_IEStatus_NoMatch")
    		Return SetError($_iestatus_nomatch, 2, 0)
    	EndIf
    EndFunc
    
    Func _ielinkgetcollection(ByRef $o_object, $i_index = -1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IELinkGetCollection", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	$i_index = Number($i_index)
    	Select 
    		Case $i_index = -1
    			Return SetError($_iestatus_success, $o_object.document.links.length, $o_object.document.links)
    		Case $i_index > -1 AND $i_index < $o_object.document.links.length
    			Return SetError($_iestatus_success, $o_object.document.links.length, $o_object.document.links.item($i_index))
    		Case $i_index < -1
    			__ieerrornotify("Error", "_IELinkGetCollection", "$_IEStatus_InvalidValue")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    		Case Else
    			__ieerrornotify("Warning", "_IELinkGetCollection", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 2, 0)
    	EndSelect
    EndFunc
    
    #EndRegion Link functions
    #Region Image functions
    
    Func _ieimgclick(ByRef $o_object, $s_linktext, $s_mode = "src", $i_index = 0, $f_wait = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEImgClick", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $linktext, $found = 0, $imgs = $o_object.document.images
    	$s_mode = StringLower($s_mode)
    	$i_index = Number($i_index)
    	For $img In $imgs
    		Select 
    			Case $s_mode = "alt"
    				$linktext = $img.alt
    			Case $s_mode = "name"
    				$linktext = $img.name
    			Case $s_mode = "src"
    				$linktext = $img.src
    			Case Else
    				__ieerrornotify("Error", "_IEImgClick", "$_IEStatus_InvalidValue", "Invalid mode: " & $s_mode)
    				Return SetError($_iestatus_invalidvalue, 3, 0)
    		EndSelect
    		If StringInStr($linktext, $s_linktext) Then
    			If ($found = $i_index) Then
    				$img.click
    				If $f_wait Then
    					_ieloadwait($o_object)
    					Return SetError(@error, 0, -1)
    				EndIf
    				Return SetError($_iestatus_success, 0, -1)
    			EndIf
    			$found = $found + 1
    		EndIf
    	Next
    	__ieerrornotify("Warning", "_IEImgClick", "$_IEStatus_NoMatch")
    	Return SetError($_iestatus_nomatch, 0, 0)
    EndFunc
    
    Func _ieimggetcollection(ByRef $o_object, $i_index = -1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEImgGetCollection", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $otemp = _iedocgetobj($o_object)
    	$i_index = Number($i_index)
    	Select 
    		Case $i_index = -1
    			Return SetError($_iestatus_success, $otemp.images.length, $otemp.images)
    		Case $i_index > -1 AND $i_index < $otemp.images.length
    			Return SetError($_iestatus_success, $otemp.images.length, $otemp.images.item($i_index))
    		Case $i_index < -1
    			__ieerrornotify("Error", "_IEImgGetCollection", "$_IEStatus_InvalidValue", "$i_index < -1")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    		Case Else
    			__ieerrornotify("Warning", "_IEImgGetCollection", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 1, 0)
    	EndSelect
    EndFunc
    
    #EndRegion Image functions
    #Region Form functions
    
    Func _ieformgetcollection(ByRef $o_object, $i_index = -1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormGetCollection", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $otemp = _iedocgetobj($o_object)
    	$i_index = Number($i_index)
    	Select 
    		Case $i_index = -1
    			Return SetError($_iestatus_success, $otemp.forms.length, $otemp.forms)
    		Case $i_index > -1 AND $i_index < $otemp.forms.length
    			Return SetError($_iestatus_success, $otemp.forms.length, $otemp.forms.item($i_index))
    		Case $i_index < -1
    			__ieerrornotify("Error", "_IEFormGetCollection", "$_IEStatus_InvalidValue", "$i_index < -1")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    		Case Else
    			__ieerrornotify("Warning", "_IEFormGetCollection", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 1, 0)
    	EndSelect
    EndFunc
    
    Func _ieformgetobjbyname(ByRef $o_object, $s_name, $i_index = 0)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormGetObjByName", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $i_length = 0
    	Local $o_col = $o_object.document.forms.item($s_name)
    	If IsObj($o_col) Then
    		If __ieisobjtype($o_col, "elementcollection") Then
    			$i_length = $o_col.length
    		Else
    			$i_length = 1
    		EndIf
    	EndIf
    	$i_index = Number($i_index)
    	If $i_index = -1 Then
    		Return SetError($_iestatus_success, $i_length, $o_object.document.forms.item($s_name))
    	Else
    		If IsObj($o_object.document.forms.item($s_name, $i_index)) Then
    			Return SetError($_iestatus_success, $i_length, $o_object.document.forms.item($s_name, $i_index))
    		Else
    			__ieerrornotify("Warning", "_IEFormGetObjByName", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 0, 0)
    		EndIf
    	EndIf
    EndFunc
    
    Func _ieformelementgetcollection(ByRef $o_object, $i_index = -1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormElementGetCollection", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "form") Then
    		__ieerrornotify("Error", "_IEFormElementGetCollection", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$i_index = Number($i_index)
    	Select 
    		Case $i_index = -1
    			Return SetError($_iestatus_success, $o_object.elements.length, $o_object.elements)
    		Case $i_index > -1 AND $i_index < $o_object.elements.length
    			Return SetError($_iestatus_success, $o_object.elements.length, $o_object.elements.item($i_index))
    		Case $i_index < -1
    			__ieerrornotify("Error", "_IEFormElementGetCollection", "$_IEStatus_InvalidValue", "$i_index < -1")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    		Case Else
    			Return SetError($_iestatus_nomatch, 1, 0)
    	EndSelect
    EndFunc
    
    Func _ieformelementgetobjbyname(ByRef $o_object, $s_name, $i_index = 0)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormElementGetObjByName", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "form") Then
    		__ieerrornotify("Error", "_IEFormElementGetObjByName", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Local $i_length = 0
    	Local $o_col = $o_object.elements.item($s_name)
    	If IsObj($o_col) Then
    		If __ieisobjtype($o_col, "elementcollection") Then
    			$i_length = $o_col.length
    		Else
    			$i_length = 1
    		EndIf
    	EndIf
    	$i_index = Number($i_index)
    	If $i_index = -1 Then
    		Return SetError($_iestatus_success, $i_length, $o_object.elements.item($s_name))
    	Else
    		If IsObj($o_object.elements.item($s_name, $i_index)) Then
    			Return SetError($_iestatus_success, $i_length, $o_object.elements.item($s_name, $i_index))
    		Else
    			__ieerrornotify("Warning", "_IEFormElementGetObjByName", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 0, 0)
    		EndIf
    	EndIf
    EndFunc
    
    Func _ieformelementgetvalue(ByRef $o_object)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormElementGetValue", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "forminputelement") Then
    		__ieerrornotify("Error", "_IEFormElementGetValue", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	SetError($_iestatus_success)
    	If $o_object.value Then
    		Return $o_object.value
    	Else
    		Return ""
    	EndIf
    EndFunc
    
    Func _ieformelementsetvalue(ByRef $o_object, $s_newvalue, $f_fireevent = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormElementSetValue", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "forminputelement") Then
    		__ieerrornotify("Error", "_IEFormElementSetValue", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	If String($o_object.type) = "file" Then
    		__ieerrornotify("Error", "_IEFormElementSetValue", "$_IEStatus_InvalidObjectType", "Browser securuty prevents SetValue of TYPE=FILE")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$o_object.value = $s_newvalue
    	If $f_fireevent Then
    		$o_object.fireevent("OnChange")
    		$o_object.fireevent("OnClick")
    	EndIf
    	Return SetError($_iestatus_success, 0, 1)
    EndFunc
    
    Func _ieformelementoptionselect(ByRef $o_object, $s_string, $f_select = 1, $s_mode = "byValue", $f_fireevent = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "formselectelement") Then
    		__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Local $oitems = $o_object.options, $inumitems = $o_object.options.length, $f_ismultiple = $o_object.multiple
    	Switch $s_mode
    		Case "byValue"
    			For $oitem In $oitems
    				If $oitem.value = $s_string Then
    					Switch $f_select
    						Case  - 1
    							Return SetError($_iestatus_success, 0, $oitem.selected)
    						Case 0
    							If NOT $f_ismultiple Then
    								__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidValue", "$f_select=0 only valid for type=select multiple")
    								SetError($_iestatus_invalidvalue, 3)
    							EndIf
    							If $oitem.selected Then
    								$oitem.selected = False
    								If $f_fireevent Then
    									$o_object.fireevent("onChange")
    									$o_object.fireevent("OnClick")
    								EndIf
    							EndIf
    							Return SetError($_iestatus_success, 0, 1)
    						Case 1
    							If NOT $oitem.selected Then
    								$oitem.selected = True
    								If $f_fireevent Then
    									$o_object.fireevent("onChange")
    									$o_object.fireevent("OnClick")
    								EndIf
    							EndIf
    							Return SetError($_iestatus_success, 0, 1)
    						Case Else
    							__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidValue", "Invalid $f_select value")
    							Return SetError($_iestatus_invalidvalue, 3, 0)
    					EndSwitch
    					__ieerrornotify("Warning", "_IEFormElementOptionSelect", "$_IEStatus_NoMatch", "Value not matched")
    					Return SetError($_iestatus_nomatch, 2, 0)
    				EndIf
    			Next
    		Case "byText"
    			For $oitem In $oitems
    				If String($oitem.text) = $s_string Then
    					Switch $f_select
    						Case  - 1
    							Return SetError($_iestatus_success, 0, $oitem.selected)
    						Case 0
    							If NOT $f_ismultiple Then
    								__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidValue", "$f_select=0 only valid for type=select multiple")
    								SetError($_iestatus_invalidvalue, 3)
    							EndIf
    							If $oitem.selected Then
    								$oitem.selected = False
    								If $f_fireevent Then
    									$o_object.fireevent("onChange")
    									$o_object.fireevent("OnClick")
    								EndIf
    							EndIf
    							Return SetError($_iestatus_success, 0, 1)
    						Case 1
    							If NOT $oitem.selected Then
    								$oitem.selected = True
    								If $f_fireevent Then
    									$o_object.fireevent("onChange")
    									$o_object.fireevent("OnClick")
    								EndIf
    							EndIf
    							Return SetError($_iestatus_success, 0, 1)
    						Case Else
    							__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidValue", "Invalid $f_select value")
    							Return SetError($_iestatus_invalidvalue, 3, 0)
    					EndSwitch
    					__ieerrornotify("Warning", "_IEFormElementOptionSelect", "$_IEStatus_NoMatch", "Text not matched")
    					Return SetError($_iestatus_nomatch, 2, 0)
    				EndIf
    			Next
    		Case "byIndex"
    			Local $i_index = Number($s_string)
    			If $i_index < 0 OR $i_index >= $inumitems Then
    				__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidValue", "Invalid index value, " & $i_index)
    				Return SetError($_iestatus_invalidvalue, 2, 0)
    			EndIf
    			$oitem = $oitems.item($i_index)
    			Switch $f_select
    				Case  - 1
    					Return SetError($_iestatus_success, 0, $oitems.item($i_index).selected)
    				Case 0
    					If NOT $f_ismultiple Then
    						__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidValue", "$f_select=0 only valid for type=select multiple")
    						SetError($_iestatus_invalidvalue, 3)
    					EndIf
    					If $oitem.selected Then
    						$oitems.item($i_index).selected = False
    						If $f_fireevent Then
    							$o_object.fireevent("onChange")
    							$o_object.fireevent("OnClick")
    						EndIf
    					EndIf
    					Return SetError($_iestatus_success, 0, 1)
    				Case 1
    					If NOT $oitem.selected Then
    						$oitems.item($i_index).selected = True
    						If $f_fireevent Then
    							$o_object.fireevent("onChange")
    							$o_object.fireevent("OnClick")
    						EndIf
    					EndIf
    					Return SetError($_iestatus_success, 0, 1)
    				Case Else
    					__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidValue", "Invalid $f_select value")
    					Return SetError($_iestatus_invalidvalue, 3, 0)
    			EndSwitch
    		Case Else
    			__ieerrornotify("Error", "_IEFormElementOptionSelect", "$_IEStatus_InvalidValue", "Invalid Mode")
    			Return SetError($_iestatus_invalidvalue, 4, 0)
    	EndSwitch
    EndFunc
    
    Func _ieformelementcheckboxselect(ByRef $o_object, $s_string, $s_name = "", $f_select = 1, $s_mode = "byValue", $f_fireevent = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormElementCheckboxSelect", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "form") Then
    		__ieerrornotify("Error", "_IEFormElementCheckboxSelect", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$s_string = String($s_string)
    	$s_name = String($s_name)
    	Local $oitems
    	If $s_name = "" Then
    		$oitems = _ietagnamegetcollection($o_object, "input")
    	Else
    		$oitems = Execute("$o_object.elements('" & $s_name & "')")
    	EndIf
    	If NOT IsObj($oitems) Then
    		__ieerrornotify("Warning", "_IEFormElementCheckboxSelect", "$_IEStatus_NoMatch")
    		Return SetError($_iestatus_nomatch, 3, 0)
    	EndIf
    	Local $oitem, $f_found = False
    	Switch $s_mode
    		Case "byValue"
    			If __ieisobjtype($oitems, "forminputelement") Then
    				$oitem = $oitems
    				If String($oitem.type) = "checkbox" AND String($oitem.value) = $s_string Then $f_found = True
    			Else
    				For $oitem In $oitems
    					If String($oitem.type) = "checkbox" AND String($oitem.value) = $s_string Then
    						$f_found = True
    						ExitLoop 
    					EndIf
    				Next
    			EndIf
    		Case "byIndex"
    			If __ieisobjtype($oitems, "forminputelement") Then
    				$oitem = $oitems
    				If String($oitem.type) = "checkbox" AND Number($s_string) = 0 Then $f_found = True
    			Else
    				Local $icount = 0
    				For $oitem In $oitems
    					If String($oitem.type) = "checkbox" AND Number($s_string) = $icount Then
    						$f_found = True
    						ExitLoop 
    					Else
    						If String($oitem.type) = "checkbox" Then $icount += 1
    					EndIf
    				Next
    			EndIf
    		Case Else
    			__ieerrornotify("Error", "_IEFormElementCheckboxSelect", "$_IEStatus_InvalidValue", "Invalid Mode")
    			Return SetError($_iestatus_invalidvalue, 5, 0)
    	EndSwitch
    	If NOT $f_found Then
    		__ieerrornotify("Warning", "_IEFormElementCheckboxSelect", "$_IEStatus_NoMatch")
    		Return SetError($_iestatus_nomatch, 2, 0)
    	EndIf
    	Switch $f_select
    		Case  - 1
    			Return SetError($_iestatus_success, 0, $oitem.checked)
    		Case 0
    			If $oitem.checked Then
    				$oitem.checked = False
    				If $f_fireevent Then
    					$oitem.fireevent("onChange")
    					$oitem.fireevent("OnClick")
    				EndIf
    			EndIf
    			Return SetError($_iestatus_success, 0, 1)
    		Case 1
    			If NOT $oitem.checked Then
    				$oitem.checked = True
    				If $f_fireevent Then
    					$oitem.fireevent("onChange")
    					$oitem.fireevent("OnClick")
    				EndIf
    			EndIf
    			Return SetError($_iestatus_success, 0, 1)
    		Case Else
    			__ieerrornotify("Error", "_IEFormElementCheckboxSelect", "$_IEStatus_InvalidValue", "Invalid $f_select value")
    			Return SetError($_iestatus_invalidvalue, 3, 0)
    	EndSwitch
    EndFunc
    
    Func _ieformelementradioselect(ByRef $o_object, $s_string, $s_name, $f_select = 1, $s_mode = "byValue", $f_fireevent = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormElementRadioSelect", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "form") Then
    		__ieerrornotify("Error", "_IEFormElementRadioSelect", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$s_string = String($s_string)
    	$s_name = String($s_name)
    	Local $oitems = Execute("$o_object.elements('" & $s_name & "')")
    	If NOT IsObj($oitems) Then
    		__ieerrornotify("Warning", "_IEFormElementRadioSelect", "$_IEStatus_NoMatch")
    		Return SetError($_iestatus_nomatch, 3, 0)
    	EndIf
    	Local $oitem, $f_found = False
    	Switch $s_mode
    		Case "byValue"
    			If __ieisobjtype($oitems, "forminputelement") Then
    				$oitem = $oitems
    				If String($oitem.type) = "radio" AND String($oitem.value) = $s_string Then $f_found = True
    			Else
    				For $oitem In $oitems
    					If String($oitem.type) = "radio" AND String($oitem.value) = $s_string Then
    						$f_found = True
    						ExitLoop 
    					EndIf
    				Next
    			EndIf
    		Case "byIndex"
    			If __ieisobjtype($oitems, "forminputelement") Then
    				$oitem = $oitems
    				If String($oitem.type) = "radio" AND Number($s_string) = 0 Then $f_found = True
    			Else
    				Local $icount = 0
    				For $oitem In $oitems
    					If String($oitem.type) = "radio" AND Number($s_string) = $icount Then
    						$f_found = True
    						ExitLoop 
    					Else
    						$icount += 1
    					EndIf
    				Next
    			EndIf
    		Case Else
    			__ieerrornotify("Error", "_IEFormElementRadioSelect", "$_IEStatus_InvalidValue", "Invalid Mode")
    			Return SetError($_iestatus_invalidvalue, 5, 0)
    	EndSwitch
    	If NOT $f_found Then
    		__ieerrornotify("Warning", "_IEFormElementRadioSelect", "$_IEStatus_NoMatch")
    		Return SetError($_iestatus_nomatch, 2, 0)
    	EndIf
    	Switch $f_select
    		Case  - 1
    			Return SetError($_iestatus_success, 0, $oitem.checked)
    		Case 0
    			If $oitem.checked Then
    				$oitem.checked = False
    				If $f_fireevent Then
    					$oitem.fireevent("onChange")
    					$oitem.fireevent("OnClick")
    				EndIf
    			EndIf
    			Return SetError($_iestatus_success, 0, 1)
    		Case 1
    			If NOT $oitem.checked Then
    				$oitem.checked = True
    				If $f_fireevent Then
    					$oitem.fireevent("onChange")
    					$oitem.fireevent("OnClick")
    				EndIf
    			EndIf
    			Return SetError($_iestatus_success, 0, 1)
    		Case Else
    			__ieerrornotify("Error", "_IEFormElementRadioSelect", "$_IEStatus_InvalidValue", "$f_select value invalid")
    			Return SetError($_iestatus_invalidvalue, 4, 0)
    	EndSwitch
    EndFunc
    
    Func _ieformimageclick(ByRef $o_object, $s_linktext, $s_mode = "src", $i_index = 0, $f_wait = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormImageClick", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $linktext, $found = 0
    	Local $otemp = _iedocgetobj($o_object)
    	Local $imgs = _ietagnamegetcollection($otemp, "input")
    	$s_mode = StringLower($s_mode)
    	$i_index = Number($i_index)
    	For $img In $imgs
    		If String($img.type) = "image" Then
    			Select 
    				Case $s_mode = "alt"
    					$linktext = $img.alt
    				Case $s_mode = "name"
    					$linktext = $img.name
    				Case $s_mode = "src"
    					$linktext = $img.src
    				Case Else
    					__ieerrornotify("Error", "_IEFormImageClick", "$_IEStatus_InvalidValue", "Invalid mode: " & $s_mode)
    					Return SetError($_iestatus_invalidvalue, 3, 0)
    			EndSelect
    			If StringInStr($linktext, $s_linktext) Then
    				If ($found = $i_index) Then
    					$img.click
    					If $f_wait Then
    						_ieloadwait($o_object)
    						Return SetError(@error, 0, -1)
    					EndIf
    					Return SetError($_iestatus_success, 0, -1)
    				EndIf
    				$found = $found + 1
    			EndIf
    		EndIf
    	Next
    	__ieerrornotify("Warning", "_IEFormImageClick", "$_IEStatus_NoMatch")
    	Return SetError($_iestatus_nomatch, 2, 0)
    EndFunc
    
    Func _ieformsubmit(ByRef $o_object, $f_wait = 1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormSubmit", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "form") Then
    		__ieerrornotify("Error", "_IEFormSubmit", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Local $o_window = $o_object.document.parentwindow
    	$o_object.submit
    	If $f_wait Then
    		_ieloadwait($o_window)
    		Return SetError(@error, 0, -1)
    	EndIf
    	Return SetError($_iestatus_success, 0, -1)
    EndFunc
    
    Func _ieformreset(ByRef $o_object)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEFormReset", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "form") Then
    		__ieerrornotify("Error", "_IEFormReset", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$o_object.reset
    	Return SetError($_iestatus_success, 0, 1)
    EndFunc
    
    #EndRegion Form functions
    #Region Table functions
    
    Func _ietablegetcollection(ByRef $o_object, $i_index = -1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IETableGetCollection", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	$i_index = Number($i_index)
    	Select 
    		Case $i_index = -1
    			Return SetError($_iestatus_success, $o_object.document.getelementsbytagname("table").length, $o_object.document.getelementsbytagname("table"))
    		Case $i_index > -1 AND $i_index < $o_object.document.getelementsbytagname("table").length
    			Return SetError($_iestatus_success, $o_object.document.getelementsbytagname("table").length, $o_object.document.getelementsbytagname("table").item($i_index))
    		Case $i_index < -1
    			__ieerrornotify("Error", "_IETableGetCollection", "$_IEStatus_InvalidValue", "$i_index < -1")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    		Case Else
    			__ieerrornotify("Warning", "_IETableGetCollection", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 1, 0)
    	EndSelect
    EndFunc
    
    Func _ietablewritetoarray(ByRef $o_object, $f_transpose = False)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IETableWriteToArray", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "table") Then
    		__ieerrornotify("Error", "_IETableWriteToArray", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Local $i_cols = 0, $tds, $i_col
    	Local $trs = $o_object.rows
    	For $tr In $trs
    		$tds = $tr.cells
    		$i_col = 0
    		For $td In $tds
    			$i_col = $i_col + $td.colspan
    		Next
    		If $i_col > $i_cols Then $i_cols = $i_col
    	Next
    	Local $i_rows = $trs.length
    	Local $a_tablecells[$i_cols][$i_rows]
    	Local $col, $row = 0
    	For $tr In $trs
    		$tds = $tr.cells
    		$col = 0
    		For $td In $tds
    			$a_tablecells[$col][$row] = $td.innertext
    			$col = $col + $td.colspan
    		Next
    		$row = $row + 1
    	Next
    	If $f_transpose Then
    		Local $i_d1 = UBound($a_tablecells, 1), $i_d2 = UBound($a_tablecells, 2), $atmp[$i_d2][$i_d1]
    		For $i = 0 To $i_d2 - 1
    			For $j = 0 To $i_d1 - 1
    				$atmp[$i][$j] = $a_tablecells[$j][$i]
    			Next
    		Next
    		$a_tablecells = $atmp
    	EndIf
    	Return SetError($_iestatus_success, 0, $a_tablecells)
    EndFunc
    
    #EndRegion Table functions
    #Region Read/Write functions
    
    Func _iebodyreadhtml(ByRef $o_object)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEBodyReadHTML", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Return SetError($_iestatus_success, 0, $o_object.document.body.innerhtml)
    EndFunc
    
    Func _iebodyreadtext(ByRef $o_object)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEBodyReadText", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IEBodyReadText", "$_IEStatus_InvalidObjectType", "Expected document element")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Return SetError($_iestatus_success, 0, $o_object.document.body.innertext)
    EndFunc
    
    Func _iebodywritehtml(ByRef $o_object, $s_html)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEBodyWriteHTML", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IEBodyWriteHTML", "$_IEStatus_InvalidObjectType", "Expected document element")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$o_object.document.body.innerhtml = $s_html
    	Local $otemp = $o_object.document
    	_ieloadwait($otemp)
    	Return SetError(@error, 0, -1)
    EndFunc
    
    Func _iedocreadhtml(ByRef $o_object)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEDocReadHTML", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IEDocReadHTML", "$_IEStatus_InvalidObjectType", "Expected document element")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Return SetError($_iestatus_success, 0, $o_object.document.documentelement.outerhtml)
    EndFunc
    
    Func _iedocwritehtml(ByRef $o_object, $s_html)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEDocWriteHTML", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IEDocWriteHTML", "$_IEStatus_InvalidObjectType", "Expected document element")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$o_object.document.write($s_html)
    	$o_object.document.close()
    	Local $otemp = $o_object.document
    	_ieloadwait($otemp)
    	Return SetError(@error, 0, -1)
    EndFunc
    
    Func _iedocinserttext(ByRef $o_object, $s_string, $s_where = "beforeend")
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEDocInsertText", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") OR __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    		__ieerrornotify("Error", "_IEDocInsertText", "$_IEStatus_InvalidObjectType", "Expected document element")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$s_where = StringLower($s_where)
    	Select 
    		Case $s_where = "beforebegin"
    			$o_object.insertadjacenttext($s_where, $s_string)
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_where = "afterbegin"
    			$o_object.insertadjacenttext($s_where, $s_string)
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_where = "beforeend"
    			$o_object.insertadjacenttext($s_where, $s_string)
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_where = "afterend"
    			$o_object.insertadjacenttext($s_where, $s_string)
    			Return SetError($_iestatus_success, 0, 1)
    		Case Else
    			__ieerrornotify("Error", "_IEDocInsertText", "$_IEStatus_InvalidValue", "Invalid where value")
    			Return SetError($_iestatus_invalidvalue, 3, 0)
    	EndSelect
    EndFunc
    
    Func _iedocinserthtml(ByRef $o_object, $s_string, $s_where = "beforeend")
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEDocInsertHTML", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") OR __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    		__ieerrornotify("Error", "_IEDocInsertHTML", "$_IEStatus_InvalidObjectType", "Expected document element")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$s_where = StringLower($s_where)
    	Select 
    		Case $s_where = "beforebegin"
    			$o_object.insertadjacenthtml($s_where, $s_string)
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_where = "afterbegin"
    			$o_object.insertadjacenthtml($s_where, $s_string)
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_where = "beforeend"
    			$o_object.insertadjacenthtml($s_where, $s_string)
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_where = "afterend"
    			$o_object.insertadjacenthtml($s_where, $s_string)
    			Return SetError($_iestatus_success, 0, 1)
    		Case Else
    			__ieerrornotify("Error", "_IEDocInsertHTML", "$_IEStatus_InvalidValue", "Invalid where value")
    			Return SetError($_iestatus_invalidvalue, 3, 0)
    	EndSelect
    EndFunc
    
    Func _ieheadinserteventscript(ByRef $o_object, $s_htmlfor, $s_event, $s_script)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEHeadInsertEventScript", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $o_head = $o_object.document.all.tags("HEAD").item(0)
    	Local $o_script = $o_object.document.createelement("script")
    	With $o_script
    		.defer = True
    		.language = "jscript"
    		.type = "text/javascript"
    		.htmlfor = $s_htmlfor
    		.event = $s_event
    		.text = $s_script
    	EndWith
    	$o_head.appendchild($o_script)
    	Return SetError($_iestatus_success, 0, 1)
    EndFunc
    
    #EndRegion Read/Write functions
    #Region Utility functions
    
    Func _iedocgetobj(ByRef $o_object)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEDocGetObj", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Switch __ieisobjtype($o_object, "document")
    		Case True
    			Return SetError($_iestatus_success, 0, $o_object)
    		Case False
    			Return SetError($_iestatus_success, 0, $o_object.document)
    	EndSwitch
    EndFunc
    
    Func _ietagnamegetcollection(ByRef $o_object, $s_tagname, $i_index = -1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IETagNameGetCollection", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IETagNameGetCollection", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Local $otemp
    	If __ieisobjtype($o_object, "documentcontainer") Then
    		$otemp = _iedocgetobj($o_object)
    	Else
    		$otemp = $o_object
    	EndIf
    	$i_index = Number($i_index)
    	Select 
    		Case $i_index = -1
    			Return SetError($_iestatus_success, $otemp.getelementsbytagname($s_tagname).length, $otemp.getelementsbytagname($s_tagname))
    		Case $i_index > -1 AND $i_index < $otemp.getelementsbytagname($s_tagname).length
    			Return SetError($_iestatus_success, $otemp.getelementsbytagname($s_tagname).length, $otemp.getelementsbytagname($s_tagname).item($i_index))
    		Case $i_index < -1
    			__ieerrornotify("Error", "_IETagNameGetCollection", "$_IEStatus_InvalidValue", "$i_index < -1")
    			Return SetError($_iestatus_invalidvalue, 3, 0)
    		Case Else
    			__ieerrornotify("Error", "_IETagNameGetCollection", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 0, 0)
    	EndSelect
    EndFunc
    
    Func _ietagnameallgetcollection(ByRef $o_object, $i_index = -1)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IETagNameAllGetCollection", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IETagNameAllGetCollection", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Local $otemp
    	If __ieisobjtype($o_object, "documentcontainer") Then
    		$otemp = _iedocgetobj($o_object)
    	Else
    		$otemp = $o_object
    	EndIf
    	$i_index = Number($i_index)
    	Select 
    		Case $i_index = -1
    			Return SetError($_iestatus_success, $otemp.all.length, $otemp.all)
    		Case $i_index > -1 AND $i_index < $otemp.all.length
    			Return SetError($_iestatus_success, $otemp.all.length, $otemp.all.item($i_index))
    		Case $i_index < -1
    			__ieerrornotify("Error", "_IETagNameAllGetCollection", "$_IEStatus_InvalidValue", "$i_index < -1")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    		Case Else
    			__ieerrornotify("Error", "_IETagNameAllGetCollection", "$_IEStatus_NoMatch")
    			Return SetError($_iestatus_nomatch, 1, 0)
    	EndSelect
    EndFunc
    
    Func _iegetobjbyname(ByRef $o_object, $s_id, $i_index = 0)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEGetObjByName", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	$i_index = Number($i_index)
    	If $i_index = -1 Then
    		Return SetError($_iestatus_success, $o_object.document.getelementsbyname($s_id).length, $o_object.document.getelementsbyname($s_id))
    	Else
    		If IsObj($o_object.document.getelementsbyname($s_id).item($i_index)) Then
    			Return SetError($_iestatus_success, $o_object.document.getelementsbyname($s_id).length, $o_object.document.getelementsbyname($s_id).item($i_index))
    		Else
    			__ieerrornotify("Warning", "_IEGetObjByName", "$_IEStatus_NoMatch", "Name: " & $s_id & ", Index: " & $i_index)
    			Return SetError($_iestatus_nomatch, 0, 0)
    		EndIf
    	EndIf
    EndFunc
    
    Func _iegetobjbyid(ByRef $o_object, $s_id)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEGetObjById", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IEGetObById", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	If IsObj($o_object.document.getelementbyid($s_id)) Then
    		Return SetError($_iestatus_success, 0, $o_object.document.getelementbyid($s_id))
    	Else
    		__ieerrornotify("Warning", "_IEGetObjById", "$_IEStatus_NoMatch", $s_id)
    		Return SetError($_iestatus_nomatch, 2, 0)
    	EndIf
    EndFunc
    
    Func _ieaction(ByRef $o_object, $s_action)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	$s_action = StringLower($s_action)
    	Select 
    		Case $s_action = "click"
    			If __ieisobjtype($o_object, "documentContainer") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.click()
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "disable"
    			If __ieisobjtype($o_object, "documentContainer") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.disabled = True
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "enable"
    			If __ieisobjtype($o_object, "documentContainer") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.disabled = False
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "focus"
    			If __ieisobjtype($o_object, "documentContainer") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.focus()
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "copy"
    			$o_object.document.execcommand("Copy")
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "cut"
    			$o_object.document.execcommand("Cut")
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "paste"
    			$o_object.document.execcommand("Paste")
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "delete"
    			$o_object.document.execcommand("Delete")
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "saveas"
    			$o_object.document.execcommand("SaveAs")
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "refresh"
    			$o_object.document.execcommand("Refresh")
    			_ieloadwait($o_object)
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "selectall"
    			$o_object.document.execcommand("SelectAll")
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "unselect"
    			$o_object.document.execcommand("Unselect")
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "print"
    			$o_object.document.parentwindow.print()
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "printdefault"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.execwb(6, 2)
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "back"
    			If NOT __ieisobjtype($o_object, "documentContainer") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.goback()
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "blur"
    			$o_object.blur()
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "forward"
    			If NOT __ieisobjtype($o_object, "documentContainer") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.goforward()
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "home"
    			If NOT __ieisobjtype($o_object, "documentContainer") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.gohome()
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "invisible"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.visible = 0
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "visible"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.visible = 1
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "search"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.gosearch()
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "stop"
    			If NOT __ieisobjtype($o_object, "documentContainer") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.stop()
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_action = "quit"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.quit()
    			$o_object = 0
    			Return SetError($_iestatus_success, 0, 1)
    		Case Else
    			__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidValue", "Invalid Action")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    	EndSelect
    EndFunc
    
    Func _iepropertyget(ByRef $o_object, $s_property)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browserdom") Then
    		__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	Local $otemp, $itemp
    	$s_property = StringLower($s_property)
    	Select 
    		Case $s_property = "browserx"
    			If __ieisobjtype($o_object, "browsercontainer") OR __ieisobjtype($o_object, "document") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$otemp = $o_object
    			$itemp = 0
    			While IsObj($otemp)
    				$itemp += $otemp.offsetleft
    				$otemp = $otemp.offsetparent
    			WEnd
    			Return SetError($_iestatus_success, 0, $itemp)
    		Case $s_property = "browsery"
    			If __ieisobjtype($o_object, "browsercontainer") OR __ieisobjtype($o_object, "document") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$otemp = $o_object
    			$itemp = 0
    			While IsObj($otemp)
    				$itemp += $otemp.offsettop
    				$otemp = $otemp.offsetparent
    			WEnd
    			Return SetError($_iestatus_success, 0, $itemp)
    		Case $s_property = "screenx"
    			If __ieisobjtype($o_object, "window") OR __ieisobjtype($o_object, "document") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			If __ieisobjtype($o_object, "browser") Then
    				Return SetError($_iestatus_success, 0, $o_object.left())
    			Else
    				$otemp = $o_object
    				$itemp = 0
    				While IsObj($otemp)
    					$itemp += $otemp.offsetleft
    					$otemp = $otemp.offsetparent
    				WEnd
    			EndIf
    			Return SetError($_iestatus_success, 0, $itemp + $o_object.document.parentwindow.screenleft)
    		Case $s_property = "screeny"
    			If __ieisobjtype($o_object, "window") OR __ieisobjtype($o_object, "document") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			If __ieisobjtype($o_object, "browser") Then
    				Return SetError($_iestatus_success, 0, $o_object.top())
    			Else
    				$otemp = $o_object
    				$itemp = 0
    				While IsObj($otemp)
    					$itemp += $otemp.offsettop
    					$otemp = $otemp.offsetparent
    				WEnd
    			EndIf
    			Return SetError($_iestatus_success, 0, $itemp + $o_object.document.parentwindow.screentop)
    		Case $s_property = "height"
    			If __ieisobjtype($o_object, "window") OR __ieisobjtype($o_object, "document") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			If __ieisobjtype($o_object, "browser") Then
    				Return SetError($_iestatus_success, 0, $o_object.height())
    			Else
    				Return SetError($_iestatus_success, 0, $o_object.offsetheight)
    			EndIf
    		Case $s_property = "width"
    			If __ieisobjtype($o_object, "window") OR __ieisobjtype($o_object, "document") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			If __ieisobjtype($o_object, "browser") Then
    				Return SetError($_iestatus_success, 0, $o_object.width())
    			Else
    				Return SetError($_iestatus_success, 0, $o_object.offsetwidth)
    			EndIf
    		Case $s_property = "isdisabled"
    			Return SetError($_iestatus_success, 0, $o_object.isdisabled())
    		Case $s_property = "addressbar"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.addressbar())
    		Case $s_property = "busy"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.busy())
    		Case $s_property = "fullscreen"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.fullscreen())
    		Case $s_property = "hwnd"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, HWnd($o_object.hwnd()))
    		Case $s_property = "left"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.left())
    		Case $s_property = "locationname"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.locationname())
    		Case $s_property = "locationurl"
    			If __ieisobjtype($o_object, "browser") Then
    				Return SetError($_iestatus_success, 0, $o_object.locationurl())
    			EndIf
    			If __ieisobjtype($o_object, "window") Then
    				Return SetError($_iestatus_success, 0, $o_object.location.href())
    			EndIf
    			If __ieisobjtype($o_object, "document") Then
    				Return SetError($_iestatus_success, 0, $o_object.parentwindow.location.href())
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.location.href())
    		Case $s_property = "menubar"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.menubar())
    		Case $s_property = "offline"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.offline())
    		Case $s_property = "readystate"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.readystate())
    		Case $s_property = "resizable"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.resizable())
    		Case $s_property = "silent"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.silent())
    		Case $s_property = "statusbar"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.statusbar())
    		Case $s_property = "statustext"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.statustext())
    		Case $s_property = "top"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.top())
    		Case $s_property = "visible"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.visible())
    		Case $s_property = "appcodename"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.appcodename())
    		Case $s_property = "appminorversion"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.appminorversion())
    		Case $s_property = "appname"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.appname())
    		Case $s_property = "appversion"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.appversion())
    		Case $s_property = "browserlanguage"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.browserlanguage())
    		Case $s_property = "cookieenabled"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.cookieenabled())
    		Case $s_property = "cpuclass"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.cpuclass())
    		Case $s_property = "javaenabled"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.javaenabled())
    		Case $s_property = "online"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.online())
    		Case $s_property = "platform"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.platform())
    		Case $s_property = "systemlanguage"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.systemlanguage())
    		Case $s_property = "useragent"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.useragent())
    		Case $s_property = "userlanguage"
    			Return SetError($_iestatus_success, 0, $o_object.document.parentwindow.top.navigator.userlanguage())
    		Case $s_property = "vcard"
    			Local $avcard[1][29]
    			$avcard[0][0] = "Business.City"
    			$avcard[0][1] = "Business.Country"
    			$avcard[0][2] = "Business.Fax"
    			$avcard[0][3] = "Business.Phone"
    			$avcard[0][4] = "Business.State"
    			$avcard[0][5] = "Business.StreetAddress"
    			$avcard[0][6] = "Business.URL"
    			$avcard[0][7] = "Business.Zipcode"
    			$avcard[0][8] = "Cellular"
    			$avcard[0][9] = "Company"
    			$avcard[0][10] = "Department"
    			$avcard[0][11] = "DisplayName"
    			$avcard[0][12] = "Email"
    			$avcard[0][13] = "FirstName"
    			$avcard[0][14] = "Gender"
    			$avcard[0][15] = "Home.City"
    			$avcard[0][16] = "Home.Country"
    			$avcard[0][17] = "Home.Fax"
    			$avcard[0][18] = "Home.Phone"
    			$avcard[0][19] = "Home.State"
    			$avcard[0][20] = "Home.StreetAddress"
    			$avcard[0][21] = "Home.Zipcode"
    			$avcard[0][22] = "Homepage"
    			$avcard[0][23] = "JobTitle"
    			$avcard[0][24] = "LastName"
    			$avcard[0][25] = "MiddleName"
    			$avcard[0][26] = "Notes"
    			$avcard[0][27] = "Office"
    			$avcard[0][28] = "Pager"
    			For $i = 0 To 28
    				$avcard[1][$i] = Execute('$o_object.document.parentWindow.top.navigator.userProfile.getAttribute("' & $avcard[0][$i] & '")')
    			Next
    			Return SetError($_iestatus_success, 0, $avcard)
    		Case $s_property = "referrer"
    			Return SetError($_iestatus_success, 0, $o_object.document.referrer)
    		Case $s_property = "theatermode"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.theatermode)
    		Case $s_property = "toolbar"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			Return SetError($_iestatus_success, 0, $o_object.toolbar)
    		Case $s_property = "contenteditable"
    			If __ieisobjtype($o_object, "browser") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			Return SetError($_iestatus_success, 0, $otemp.iscontenteditable)
    		Case $s_property = "innertext"
    			If __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			Return SetError($_iestatus_success, 0, $otemp.innertext)
    		Case $s_property = "outertext"
    			If __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			Return SetError($_iestatus_success, 0, $otemp.outertext)
    		Case $s_property = "innerhtml"
    			If __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			Return SetError($_iestatus_success, 0, $otemp.innerhtml)
    		Case $s_property = "outerhtml"
    			If __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			Return SetError($_iestatus_success, 0, $otemp.outerhtml)
    		Case $s_property = "title"
    			Return SetError($_iestatus_success, 0, $o_object.document.title)
    		Case $s_property = "uniqueid"
    			If __ieisobjtype($o_object, "window") Then
    				__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			Else
    				Return SetError($_iestatus_success, 0, $o_object.uniqueid)
    			EndIf
    		Case Else
    			__ieerrornotify("Error", "_IEPropertyGet", "$_IEStatus_InvalidValue", "Invalid Property")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    	EndSelect
    EndFunc
    
    Func _iepropertyset(ByRef $o_object, $s_property, $newvalue)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $otemp
    	#forceref $oTemp
    	$s_property = StringLower($s_property)
    	Select 
    		Case $s_property = "addressbar"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.addressbar = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "height"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.height = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "left"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.left = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "menubar"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.menubar = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "offline"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.offline = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "resizable"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.resizable = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "statusbar"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.statusbar = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "statustext"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.statustext = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "top"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.top = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "width"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			$o_object.width = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "theatermode"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			If $newvalue Then
    				$o_object.theatermode = True
    			Else
    				$o_object.theatermode = False
    			EndIf
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "toolbar"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			If $newvalue Then
    				$o_object.toolbar = True
    			Else
    				$o_object.toolbar = False
    			EndIf
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "contenteditable"
    			If __ieisobjtype($o_object, "browser") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			If $newvalue Then
    				$otemp.contenteditable = "true"
    			Else
    				$otemp.contenteditable = "false"
    			EndIf
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "innertext"
    			If __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			$otemp.innertext = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "outertext"
    			If __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			$otemp.outertext = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "innerhtml"
    			If __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			$otemp.innerhtml = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "outerhtml"
    			If __ieisobjtype($o_object, "documentcontainer") OR __ieisobjtype($o_object, "document") Then
    				$otemp = $o_object.document.body
    			Else
    				$otemp = $o_object
    			EndIf
    			$otemp.outerhtml = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "title"
    			$o_object.document.title = $newvalue
    			Return SetError($_iestatus_success, 0, 1)
    		Case $s_property = "silent"
    			If NOT __ieisobjtype($o_object, "browser") Then
    				__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidObjectType")
    				Return SetError($_iestatus_invalidobjecttype, 1, 0)
    			EndIf
    			If $newvalue Then
    				$o_object.silent = True
    			Else
    				$o_object.silent = False
    			EndIf
    			Return SetError($_iestatus_success, 0, 0)
    		Case Else
    			__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_InvalidValue", "Invalid Property")
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    	EndSelect
    EndFunc
    
    Func _ieerrornotify($f_notify = -1)
    	Switch Number($f_notify)
    		Case  - 1
    			Return $_ieerrornotify
    		Case 0
    			$_ieerrornotify = False
    			Return 1
    		Case 1
    			$_ieerrornotify = True
    			Return 1
    		Case Else
    			__ieerrornotify("Error", "_IEErrorNotify", "$_IEStatus_InvalidValue")
    			Return 0
    	EndSwitch
    EndFunc
    
    Func _ieerrorhandlerregister($s_functionname = "__IEInternalErrorHandler")
    	$sieusererrorhandler = $s_functionname
    	$oieerrorhandler = ""
    	$oieerrorhandler = ObjEvent("AutoIt.Error", $s_functionname)
    	If IsObj($oieerrorhandler) Then
    		Return SetError($_iestatus_success, 0, 1)
    	Else
    		__ieerrornotify("Error", "_IEPropertySet", "$_IEStatus_GeneralError", "Error Handler Not Registered - Check existance of error function")
    		Return SetError($_iestatus_generalerror, 1, 0)
    	EndIf
    EndFunc
    
    Func _ieerrorhandlerderegister()
    	$sieusererrorhandler = ""
    	$oieerrorhandler = ""
    	Return SetError($_iestatus_success, 0, 1)
    EndFunc
    
    Func _iequit(ByRef $o_object)
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "_IEQuit", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "browser") Then
    		__ieerrornotify("Error", "_IEAction", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$o_object.quit()
    	$o_object = 0
    	Return SetError($_iestatus_success, 0, 1)
    EndFunc
    
    #EndRegion Utility functions
    #Region General
    
    Func _ie_introduction($s_module = "basic")
    	Local $s_html = ""
    	Switch $s_module
    		Case "basic"
    			$s_html &= "<HTML>" & @CR
    			$s_html &= "<HEAD>" & @CR
    			$s_html &= "<TITLE>_IE_Introduction ('basic')</TITLE>" & @CR
    			$s_html &= "<STYLE>body {font-family: Arial}</STYLE>" & @CR
    			$s_html &= "</HEAD>" & @CR
    			$s_html &= "<BODY>" & @CR
    			$s_html &= "<table border=1 width=600 id='table1' cellspacing=6 cellpadding=6>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<h1>Welcome to IE.au3</h1>" & @CR
    			$s_html &= "IE.au3 is a UDF (User Defined Function) library for the " & @CR
    			$s_html &= "<a href='http://www.autoitscript.com'>AutoIt</a> scripting language." & @CR
    			$s_html &= "<p>  " & @CR
    			$s_html &= "IE.au3 allows you to either create or attach to an Internet Explorer browser and do " & @CR
    			$s_html &= "just about anything you could do with it interactively with the mouse and " & @CR
    			$s_html &= "keyboard, but do it through script." & @CR
    			$s_html &= "<p>" & @CR
    			$s_html &= "You can navigate to pages, click links, fill and submit forms etc. You can " & @CR
    			$s_html &= "also do things you cannot do interactively like change or rewrite page " & @CR
    			$s_html &= "content and JavaScripts, read, parse and save page content and monitor and act " & @CR
    			$s_html &= "upon browser 'events'.<p>" & @CR
    			$s_html &= "IE.au3 uses the COM interface in AutoIt to interact with the Internet Explorer " & @CR
    			$s_html &= "object model and the DOM (Document Object Model) supported by the browser." & @CR
    			$s_html &= "<p>" & @CR
    			$s_html &= "Here are some links for more information and helpful tools:<p>" & @CR
    			$s_html &= "Reference Material: " & @CR
    			$s_html &= "<ul>" & @CR
    			$s_html &= "<li><a href='http://msdn1.microsoft.com/'>MSDN (Microsoft Developer Network)</a></li>" & @CR
    			$s_html &= "<li><a href='http://msdn2.microsoft.com/en-us/library/aa752084.aspx' target='_blank'>InternetExplorer Object</a></li>" & @CR
    			$s_html &= "<li><a href='http://msdn2.microsoft.com/en-us/library/ms531073.aspx' target='_blank'>Document Object</a></li>" & @CR
    			$s_html &= "<li><a href='http://msdn2.microsoft.com/en-us/ie/aa740473.aspx' target='_blank'>Overviews and Tutorials</a></li>" & @CR
    			$s_html &= "<li><a href='http://msdn2.microsoft.com/en-us/library/ms533029.aspx' target='_blank'>DHTML Objects</a></li>" & @CR
    			$s_html &= "<li><a href='http://msdn2.microsoft.com/en-us/library/ms533051.aspx' target='_blank'>DHTML Events</a></li>" & @CR
    			$s_html &= "</ul><p>" & @CR
    			$s_html &= "Helpful Tools: " & @CR
    			$s_html &= "<ul>" & @CR
    			$s_html &= "<li><a href='http://www.autoitscript.com/forum/index.php?showtopic=19368' target='_blank'>AutoIt IE Builder</a> (build IE scripts interactively)</li>" & @CR
    			$s_html &= "<li><a href='http://www.debugbar.com/' target='_blank'>DebugBar</a> (DOM inspector, HTTP inspector, HTML validator and more - free for personal use) Recommended</li>" & @CR
    			$s_html &= "<li><a href='http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;displaylang=en' target='_blank'>IE Developer Toolbar</a> (comprehensive DOM analysis tool)</li>" & @CR
    			$s_html &= "<li><a href='http://slayeroffice.com/tools/modi/v2.0/modi_help.html' target='_blank'>MODIV2</a> (view the DOM of a web page by mousing around)</li>" & @CR
    			$s_html &= "<li><a href='http://validator.w3.org/' target='_blank'>HTML Validator</a> (verify HTML follows format rules)</li>" & @CR
    			$s_html &= "<li><a href='http://www.fiddlertool.com/fiddler/' target='_blank'>Fiddler</a> (examine HTTP traffic)</li>" & @CR
    			$s_html &= "</ul>" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "</table>" & @CR
    			$s_html &= "</BODY>" & @CR
    			$s_html &= "</HTML>"
    		Case Else
    			__ieerrornotify("Error", "_IE_Introduction", "$_IEStatus_InvalidValue")
    			Return SetError($_iestatus_invalidvalue, 1, 0)
    	EndSwitch
    	Local $o_object = _iecreate()
    	_iedocwritehtml($o_object, $s_html)
    	Return SetError($_iestatus_success, 0, $o_object)
    EndFunc
    
    Func _ie_example($s_module = "basic")
    	Local $s_html = "", $o_object
    	Switch $s_module
    		Case "basic"
    			$s_html &= "<HEAD>" & @CR
    			$s_html &= "<TITLE>_IE_Example('basic')</TITLE>" & @CR
    			$s_html &= "<STYLE>body {font-family: Arial}</STYLE>" & @CR
    			$s_html &= "</HEAD>" & @CR
    			$s_html &= "<BODY>" & @CR
    			$s_html &= "<a href='http://www.autoitscript.com'><img src='http://www.autoitscript.com/images/autoit_6_240x100.jpg' name='AutoItImage' alt='AutoIt Homepage Image'></a>" & @CR
    			$s_html &= "<p>" & @CR
    			$s_html &= "<div id=line1>This is a simple HTML page with text, links and images.</div>" & @CR
    			$s_html &= "<p>" & @CR
    			$s_html &= "<div id=line2><a href='http://www.autoitscript.com'>AutoIt</a> is a wonderful automation scripting language.</div>" & @CR
    			$s_html &= "<p>" & @CR
    			$s_html &= "<div id=line3>It is supported by a very active and supporting <a href='http://www.autoitscript.com/forum/'>user forum</a>.</div>" & @CR
    			$s_html &= "<p>" & @CR
    			$s_html &= "<div id=IEAu3Data></div>" & @CR
    			$s_html &= "</BODY>" & @CR
    			$s_html &= "</HTML>"
    			$o_object = _iecreate()
    			_iedocwritehtml($o_object, $s_html)
    		Case "table"
    			$s_html &= "<HTML>" & @CR
    			$s_html &= "<HEAD>" & @CR
    			$s_html &= "<TITLE>_IE_Example('table')</TITLE>" & @CR
    			$s_html &= "<STYLE>body {font-family: Arial}</STYLE>" & @CR
    			$s_html &= "</HEAD>" & @CR
    			$s_html &= "<BODY>" & @CR
    			$s_html &= "$oTableOne = _IETableGetObjByName($oIE, &quot;tableOne&quot;)<br>" & @CR
    			$s_html &= "&lt;table border=1 id='tableOne'&gt;<p>" & @CR
    			$s_html &= "<table border=1 id='tableOne'>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>AutoIt</td>" & @CR
    			$s_html &= "		<td>is</td>" & @CR
    			$s_html &= "		<td>really</td>" & @CR
    			$s_html &= "		<td>great</td>" & @CR
    			$s_html &= "		<td>with</td>" & @CR
    			$s_html &= "		<td>IE.au3</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>1</td>" & @CR
    			$s_html &= "		<td>2</td>" & @CR
    			$s_html &= "		<td>3</td>" & @CR
    			$s_html &= "		<td>4</td>" & @CR
    			$s_html &= "		<td>5</td>" & @CR
    			$s_html &= "		<td>6</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>the</td>" & @CR
    			$s_html &= "		<td>quick</td>" & @CR
    			$s_html &= "		<td>red</td>" & @CR
    			$s_html &= "		<td>fox</td>" & @CR
    			$s_html &= "		<td>jumped</td>" & @CR
    			$s_html &= "		<td>over</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>the</td>" & @CR
    			$s_html &= "		<td>lazy</td>" & @CR
    			$s_html &= "		<td>brown</td>" & @CR
    			$s_html &= "		<td>dog</td>" & @CR
    			$s_html &= "		<td>the</td>" & @CR
    			$s_html &= "		<td>time</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>has</td>" & @CR
    			$s_html &= "		<td>come</td>" & @CR
    			$s_html &= "		<td>for</td>" & @CR
    			$s_html &= "		<td>all</td>" & @CR
    			$s_html &= "		<td>good</td>" & @CR
    			$s_html &= "		<td>men</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>to</td>" & @CR
    			$s_html &= "		<td>come</td>" & @CR
    			$s_html &= "		<td>to</td>" & @CR
    			$s_html &= "		<td>the</td>" & @CR
    			$s_html &= "		<td>aid</td>" & @CR
    			$s_html &= "		<td>of</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "</table>" & @CR
    			$s_html &= "<p>" & @CR
    			$s_html &= "$oTableTwo = _IETableGetObjByName($oIE, &quot;tableTwo&quot;)<br>" & @CR
    			$s_html &= "&lt;table border=&quot;1&quot; id='tableTwo'&gt;<p>" & @CR
    			$s_html &= "<table border=1 id='tableTwo'>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td colspan='4'>Table Top</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>One</td>" & @CR
    			$s_html &= "		<td colspan='3'>Two</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>Three</td>" & @CR
    			$s_html &= "		<td>Four</td>" & @CR
    			$s_html &= "		<td colspan='2'>Five</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>Six</td>" & @CR
    			$s_html &= "		<td colspan='3'>Seven</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "	<tr>" & @CR
    			$s_html &= "		<td>Eight</td>" & @CR
    			$s_html &= "		<td>Nine</td>" & @CR
    			$s_html &= "		<td>Ten</td>" & @CR
    			$s_html &= "		<td>Eleven</td>" & @CR
    			$s_html &= "	</tr>" & @CR
    			$s_html &= "</table>" & @CR
    			$s_html &= "</BODY>" & @CR
    			$s_html &= "</HTML>"
    			$o_object = _iecreate()
    			_iedocwritehtml($o_object, $s_html)
    		Case "form"
    			$s_html &= "<HTML>" & @CR
    			$s_html &= "<HEAD>" & @CR
    			$s_html &= "<TITLE>_IE_Example('form')</TITLE>" & @CR
    			$s_html &= "<STYLE>body {font-family: Arial}</STYLE>" & @CR
    			$s_html &= "</HEAD>" & @CR
    			$s_html &= "<BODY>" & @CR
    			$s_html &= "<form name='ExampleForm' onSubmit='javascript:alert(""ExampleFormSubmitted"");' method='post'>" & @CR
    			$s_html &= "<table cellspacing=6 cellpadding=6 border=1>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>ExampleForm</td>" & @CR
    			$s_html &= "<td>&lt;form name='ExampleForm' onSubmit='javascript:alert(""ExampleFormSubmitted"");' method='post'&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>Hidden Input Element<input type='hidden' name='hiddenExample' value='secret value'></td>" & @CR
    			$s_html &= "<td>&lt;input type='hidden' name='hiddenExample' value='secret value'&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<input type='text' name='textExample' value='http://' size='20' maxlength='30'>" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "<td>&lt;input type='text' name='textExample' value='http://' size='20' maxlength='30'&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<input type='password' name='passwordExample' size='10'>" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "<td>&lt;input type='password' name='passwordExample' size='10'&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<input type='file' name='fileExample'>" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "<td>&lt;input type='file' name='fileExample'&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<input type='image' name='imageExample' alt='AutoIt Homepage' src='http://www.autoitscript.com/images/autoit_6_240x100.jpg'>" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "<td>&lt;input type='image' name='imageExample' alt='AutoIt Homepage' src='http://www.autoitscript.com/images/autoit_6_240x100.jpg'&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<textarea name='textareaExample' rows='5' cols='15'>Hello!</textarea>" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "<td>&lt;textarea name='textareaExample' rows='5' cols='15'&gt;Hello!&lt;/textarea&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<input type='checkbox' name='checkboxG1Example' value='gameBasketball'>Basketball<br>" & @CR
    			$s_html &= "<input type='checkbox' name='checkboxG1Example' value='gameFootball'>Football<br>" & @CR
    			$s_html &= "<input type='checkbox' name='checkboxG2Example' value='gameTennis' checked>Tennis<br>" & @CR
    			$s_html &= "<input type='checkbox' name='checkboxG2Example' value='gameBaseball'>Baseball" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "<td>&lt;input type='checkbox' name='checkboxG1Example' value='gameBasketball'&gt;Basketball&lt;br&gt;<br>" & @CR
    			$s_html &= "&lt;input type='checkbox' name='checkboxG1Example' value='gameFootball'&gt;Football&lt;br&gt;<br>" & @CR
    			$s_html &= "&lt;input type='checkbox' name='checkboxG2Example' value='gameTennis' checked&gt;Tennis&lt;br&gt;<br>" & @CR
    			$s_html &= "&lt;input type='checkbox' name='checkboxG2Example' value='gameBaseball'&gt;Baseball</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<input type='radio' name='radioExample' value='vehicleAirplane'>Airplane<br>" & @CR
    			$s_html &= "<input type='radio' name='radioExample' value='vehicleTrain' checked>Train<br>" & @CR
    			$s_html &= "<input type='radio' name='radioExample' value='vehicleBoat'>Boat<br>" & @CR
    			$s_html &= "<input type='radio' name='radioExample' value='vehicleCar'>Car</td>" & @CR
    			$s_html &= "<td>&lt;input type='radio' name='radioExample' value='vehicleAirplane'&gt;Airplane&lt;br&gt;<br>" & @CR
    			$s_html &= "&lt;input type='radio' name='radioExample' value='vehicleTrain' checked&gt;Train&lt;br&gt;<br>" & @CR
    			$s_html &= "&lt;input type='radio' name='radioExample' value='vehicleBoat'&gt;Boat&lt;br&gt;<br>" & @CR
    			$s_html &= "&lt;input type='radio' name='radioExample' value='vehicleCar'&gt;Car&lt;br&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<select name='selectExample'>" & @CR
    			$s_html &= "<option value='homepage.html'>Homepage" & @CR
    			$s_html &= "<option value='midipage.html'>Midipage" & @CR
    			$s_html &= "<option value='freepage.html'>Freepage" & @CR
    			$s_html &= "</select>" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "<td>&lt;select name='selectExample'&gt;<br>" & @CR
    			$s_html &= "&lt;option value='homepage.html'&gt;Homepage<br>" & @CR
    			$s_html &= "&lt;option value='midipage.html'&gt;Midipage<br>" & @CR
    			$s_html &= "&lt;option value='freepage.html'&gt;Freepage<br>" & @CR
    			$s_html &= "&lt;/select&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<select name='multipleSelectExample' size='6' multiple>" & @CR
    			$s_html &= "<option value='Name1'>Aaron" & @CR
    			$s_html &= "<option value='Name2'>Bruce" & @CR
    			$s_html &= "<option value='Name3'>Carlos" & @CR
    			$s_html &= "<option value='Name4'>Denis" & @CR
    			$s_html &= "<option value='Name5'>Ed" & @CR
    			$s_html &= "<option value='Name6'>Freddy" & @CR
    			$s_html &= "</select>" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "<td>&lt;select name='multipleSelectExample' size='6' multiple&gt;<br>" & @CR
    			$s_html &= "&lt;option value='Name1'&gt;Aaron<br>" & @CR
    			$s_html &= "&lt;option value='Name2'&gt;Bruce<br>" & @CR
    			$s_html &= "&lt;option value='Name3'&gt;Carlos<br>" & @CR
    			$s_html &= "&lt;option value='Name4'&gt;Denis<br>" & @CR
    			$s_html &= "&lt;option value='Name5'&gt;Ed<br>" & @CR
    			$s_html &= "&lt;option value='Name6'&gt;Freddy<br>" & @CR
    			$s_html &= "&lt;/select&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td>" & @CR
    			$s_html &= "<input name='submitExample' type='submit' value='Submit'>" & @CR
    			$s_html &= "<input name='resetExample' type='reset' value='Reset'>" & @CR
    			$s_html &= "</td>" & @CR
    			$s_html &= "<td>&lt;input name='submitExample' type='submit' value='Submit'&gt;<br>" & @CR
    			$s_html &= "&lt;input name='resetExample' type='reset' value='Reset'&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "</table>" & @CR
    			$s_html &= "<input type='hidden' name='hiddenExample' value='secret value'>" & @CR
    			$s_html &= "</FORM>" & @CR
    			$s_html &= "</BODY>" & @CR
    			$s_html &= "</HTML>"
    			$o_object = _iecreate()
    			_iedocwritehtml($o_object, $s_html)
    		Case "frameset"
    			$s_html &= "<HTML>" & @CR
    			$s_html &= "<HEAD>" & @CR
    			$s_html &= "<TITLE>_IE_Example('frameset')</TITLE>" & @CR
    			$s_html &= "</HEAD>" & @CR
    			$s_html &= "<FRAMESET rows='25,200'>" & @CR
    			$s_html &= "	<FRAME NAME=Top SRC=about:blank>" & @CR
    			$s_html &= "	<FRAMESET cols='100,500'>" & @CR
    			$s_html &= "		<FRAME NAME=Menu SRC=about:blank>" & @CR
    			$s_html &= "		<FRAME NAME=Main SRC=about:blank>" & @CR
    			$s_html &= "	</FRAMESET>" & @CR
    			$s_html &= "</FRAMESET>" & @CR
    			$s_html &= "</HTML>"
    			$o_object = _iecreate()
    			_iedocwritehtml($o_object, $s_html)
    			_ieaction($o_object, "refresh")
    			Local $oframetop = _ieframegetobjbyname($o_object, "Top")
    			Local $oframemenu = _ieframegetobjbyname($o_object, "Menu")
    			Local $oframemain = _ieframegetobjbyname($o_object, "Main")
    			_iebodywritehtml($oframetop, '$oFrameTop = _IEFrameGetObjByName($oIE, "Top")')
    			_iebodywritehtml($oframemenu, '$oFrameMenu = _IEFrameGetObjByName($oIE, "Menu")')
    			_iebodywritehtml($oframemain, '$oFrameMain = _IEFrameGetObjByName($oIE, "Main")')
    		Case "iframe"
    			$s_html &= "<HTML>" & @CR
    			$s_html &= "<HEAD>" & @CR
    			$s_html &= "<TITLE>_IE_Example('iframe')</TITLE>" & @CR
    			$s_html &= "</HEAD>" & @CR
    			$s_html &= "<BODY>" & @CR
    			$s_html &= "<table cellspacing=6 cellpadding=6 border=1>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td><iframe name='iFrameOne' src='about:blank' title='iFrameOne'></iframe></td>" & @CR
    			$s_html &= "<td>&lt;iframe name=&quot;iFrameOne&quot; src=&quot;about:blank&quot; title=&quot;iFrameOne&quot;&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "<tr>" & @CR
    			$s_html &= "<td><iframe name='iFrameTwo' src='about:blank' title='iFrameTwo'></iframe></td>" & @CR
    			$s_html &= "<td>&lt;iframe name=&quot;iFrameTwo&quot; src=&quot;about:blank&quot; title=&quot;iFrameTwo&quot;&gt;</td>" & @CR
    			$s_html &= "</tr>" & @CR
    			$s_html &= "</table>" & @CR
    			$s_html &= "</BODY>" & @CR
    			$s_html &= "</HTML>"
    			$o_object = _iecreate()
    			_iedocwritehtml($o_object, $s_html)
    			_ieaction($o_object, "refresh")
    			Local $oiframeone = _ieframegetobjbyname($o_object, "iFrameOne")
    			Local $oiframetwo = _ieframegetobjbyname($o_object, "iFrameTwo")
    			_iebodywritehtml($oiframeone, '$oIFrameOne = _IEFrameGetObjByName($oIE, "iFrameOne")')
    			_iebodywritehtml($oiframetwo, '$oIFrameTwo = _IEFrameGetObjByName($oIE, "iFrameTwo")')
    		Case Else
    			__ieerrornotify("Error", "_IE_Example", "$_IEStatus_InvalidValue")
    			Return SetError($_iestatus_invalidvalue, 1, 0)
    	EndSwitch
    	Return SetError($_iestatus_success, 0, $o_object)
    EndFunc
    
    Func _ie_versioninfo()
    	__ieerrornotify("Information", "_IE_VersionInfo", "version " & $ieau3versioninfo[0] & $ieau3versioninfo[1] & "." & $ieau3versioninfo[2] & "-" & $ieau3versioninfo[3], "Release date: " & $ieau3versioninfo[4])
    	Return SetError($_iestatus_success, 0, $ieau3versioninfo)
    EndFunc
    
    #EndRegion General
    #Region Internal functions
    
    Func __ielocksetforegroundwindow($nlockcode)
    	Local $aret = DllCall("user32.dll", "bool", "LockSetForegroundWindow", "uint", $nlockcode)
    	If @error OR $aret[0] Then Return SetError(1, _winapi_getlasterror(), 0)
    	Return $aret[0]
    EndFunc
    
    Func __iecontrolgetobjfromhwnd(ByRef $hwin)
    	DllCall("ole32.dll", "long", "CoInitialize", "ptr", 0)
    	If @error Then Return SetError(2, @error, 0)
    	Local Const $wm_html_getobject = __ieregisterwindowmessage("WM_HTML_GETOBJECT")
    	Local Const $smto_abortifhung = 2
    	Local $lresult
    	__iesendmessagetimeout($hwin, $wm_html_getobject, 0, 0, $smto_abortifhung, 1000, $lresult)
    	Local $typuuid = DllStructCreate("int;short;short;byte[8]")
    	DllStructSetData($typuuid, 1, 1651492128)
    	DllStructSetData($typuuid, 2, 42014)
    	DllStructSetData($typuuid, 3, 4559)
    	DllStructSetData($typuuid, 4, 167, 1)
    	DllStructSetData($typuuid, 4, 49, 2)
    	DllStructSetData($typuuid, 4, 0, 3)
    	DllStructSetData($typuuid, 4, 160, 4)
    	DllStructSetData($typuuid, 4, 201, 5)
    	DllStructSetData($typuuid, 4, 8, 6)
    	DllStructSetData($typuuid, 4, 38, 7)
    	DllStructSetData($typuuid, 4, 55, 8)
    	Local $aret = DllCall("oleacc.dll", "long", "ObjectFromLresult", "lresult", $lresult, "ptr", DllStructGetPtr($typuuid), "wparam", 0, "idispatch*", 0)
    	If @error Then Return SetError(3, @error, 0)
    	If IsObj($aret[4]) Then
    		Local $oie = $aret[4].script()
    		Return $oie.document.parentwindow
    	Else
    		Return SetError(1, $aret[0], 0)
    	EndIf
    EndFunc
    
    Func __ieregisterwindowmessage($smsg)
    	Local $aret = DllCall("user32.dll", "uint", "RegisterWindowMessageW", "wstr", $smsg)
    	If @error Then Return SetError(@error, @extended, 0)
    	If $aret[0] = 0 Then Return SetError(10, _winapi_getlasterror(), 0)
    	Return $aret[0]
    EndFunc
    
    Func __iesendmessagetimeout($hwnd, $msg, $wparam, $lparam, $nflags, $ntimeout, ByRef $vout, $r = 0, $t1 = "int", $t2 = "int")
    	Local $aret = DllCall("user32.dll", "lresult", "SendMessageTimeout", "hwnd", $hwnd, "uint", $msg, $t1, $wparam, $t2, $lparam, "uint", $nflags, "uint", $ntimeout, "dword_ptr*", "")
    	If @error OR $aret[0] = 0 Then
    		$vout = 0
    		Return SetError(1, _winapi_getlasterror(), 0)
    	EndIf
    	$vout = $aret[7]
    	If $r >= 0 AND $r <= 4 Then Return $aret[$r]
    	Return $aret
    EndFunc
    
    Func __ieisobjtype(ByRef $o_object, $s_type)
    	If NOT IsObj($o_object) Then
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	Local $status = __ieinternalerrorhandlerregister()
    	If NOT $status Then __ieerrornotify("Warning", "internal function __IEIsObjType", "Cannot register internal error handler, cannot trap COM errors", "Use _IEErrorHandlerRegister() to register a user error handler")
    	Local $f_notifystatus = _ieerrornotify()
    	_ieerrornotify(False)
    	Local $s_name = String(ObjName($o_object)), $objectok = False
    	Switch $s_type
    		Case "browserdom"
    			Local $otemp = $o_object.document
    			If __ieisobjtype($o_object, "documentcontainer") Then
    				$objectok = True
    			ElseIf __ieisobjtype($o_object, "document") Then
    				$objectok = True
    			ElseIf __ieisobjtype($otemp, "document") Then
    				$objectok = True
    			EndIf
    		Case "browser"
    			If ($s_name = "IWebBrowser2") OR ($s_name = "IWebBrowser") Then $objectok = True
    		Case "window"
    			If $s_name = "DispHTMLWindow2" Then $objectok = True
    		Case "documentContainer"
    			If __ieisobjtype($o_object, "window") OR __ieisobjtype($o_object, "browser") Then $objectok = True
    		Case "document"
    			If $s_name = "DispHTMLDocument" Then $objectok = True
    		Case "table"
    			If $s_name = "DispHTMLTable" Then $objectok = True
    		Case "form"
    			If $s_name = "DispHTMLFormElement" Then $objectok = True
    		Case "forminputelement"
    			If ($s_name = "DispHTMLInputElement") OR ($s_name = "DispHTMLSelectElement") OR ($s_name = "DispHTMLTextAreaElement") Then $objectok = True
    		Case "elementcollection"
    			If ($s_name = "DispHTMLElementCollection") Then $objectok = True
    		Case "formselectelement"
    			If $s_name = "DispHTMLSelectElement" Then $objectok = True
    		Case Else
    			Return SetError($_iestatus_invalidvalue, 2, 0)
    	EndSwitch
    	_ieerrornotify($f_notifystatus)
    	__ieinternalerrorhandlerderegister()
    	If $objectok Then
    		Return SetError($_iestatus_success, 0, 1)
    	Else
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    EndFunc
    
    Func __ieerrornotify($s_severity, $s_func, $s_status = "", $s_message = "")
    	If $_ieerrornotify OR $__ieau3debug Then
    		Local $sstr = "--> IE.au3 " & $ieau3versioninfo[5] & " " & $s_severity & " from function " & $s_func
    		If NOT String($s_status) = "" Then $sstr &= ", " & $s_status
    		If NOT String($s_message) = "" Then $sstr &= " (" & $s_message & ")"
    		ConsoleWrite($sstr & @CRLF)
    	EndIf
    	Return 1
    EndFunc
    
    Func __ieinternalerrorhandlerregister()
    	Local $scurrenterrorhandler = ObjEvent("AutoIt.Error")
    	If $scurrenterrorhandler <> "" AND NOT IsObj($oieerrorhandler) Then
    		Return SetError($_iestatus_generalerror, 0, 0)
    	EndIf
    	$oieerrorhandler = ""
    	$oieerrorhandler = ObjEvent("AutoIt.Error", "__IEInternalErrorHandler")
    	If IsObj($oieerrorhandler) Then
    		Return SetError($_iestatus_success, 0, 1)
    	Else
    		Return SetError($_iestatus_generalerror, 0, 0)
    	EndIf
    EndFunc
    
    Func __ieinternalerrorhandlerderegister()
    	$oieerrorhandler = ""
    	If $sieusererrorhandler <> "" Then
    		$oieerrorhandler = ObjEvent("AutoIt.Error", $sieusererrorhandler)
    	EndIf
    	Return SetError($_iestatus_success, 0, 1)
    EndFunc
    
    Func __ieinternalerrorhandler()
    	$iecomerrorscriptline = $oieerrorhandler.scriptline
    	$iecomerrornumber = $oieerrorhandler.number
    	$iecomerrornumberhex = Hex($oieerrorhandler.number, 8)
    	$iecomerrordescription = StringStripWS($oieerrorhandler.description, 2)
    	$iecomerrorwindescription = StringStripWS($oieerrorhandler.windescription, 2)
    	$iecomerrorsource = $oieerrorhandler.source
    	$iecomerrorhelpfile = $oieerrorhandler.helpfile
    	$iecomerrorhelpcontext = $oieerrorhandler.helpcontext
    	$iecomerrorlastdllerror = $oieerrorhandler.lastdllerror
    	$iecomerroroutput = ""
    	$iecomerroroutput &= "--> COM Error Encountered in " & @ScriptName & @CRLF
    	$iecomerroroutput &= "----> $IEComErrorScriptline = " & $iecomerrorscriptline & @CRLF
    	$iecomerroroutput &= "----> $IEComErrorNumberHex = " & $iecomerrornumberhex & @CRLF
    	$iecomerroroutput &= "----> $IEComErrorNumber = " & $iecomerrornumber & @CRLF
    	$iecomerroroutput &= "----> $IEComErrorWinDescription = " & $iecomerrorwindescription & @CRLF
    	$iecomerroroutput &= "----> $IEComErrorDescription = " & $iecomerrordescription & @CRLF
    	$iecomerroroutput &= "----> $IEComErrorSource = " & $iecomerrorsource & @CRLF
    	$iecomerroroutput &= "----> $IEComErrorHelpFile = " & $iecomerrorhelpfile & @CRLF
    	$iecomerroroutput &= "----> $IEComErrorHelpContext = " & $iecomerrorhelpcontext & @CRLF
    	$iecomerroroutput &= "----> $IEComErrorLastDllError = " & $iecomerrorlastdllerror & @CRLF
    	If $_ieerrornotify OR $__ieau3debug Then ConsoleWrite($iecomerroroutput & @CRLF)
    	SetError($_iestatus_comerror)
    	Return 
    EndFunc
    
    Func __iecomerrorunrecoverable()
    	Select 
    		Case ($iecomerrornumber = -2147352567) OR (String($iecomerrordescription) = "Access is denied.")
    			Return $_iestatus_accessisdenied
    		Case ($iecomerrornumber = -2147417848) OR (String($iecomerrorwindescription) = "The object invoked has disconnected from its clients.")
    			Return $_iestatus_clientdisconnected
    		Case Else
    			Return $_iestatus_success
    	EndSelect
    EndFunc
    
    #EndRegion Internal functions
    #Region ProtoType Functions
    
    Func __ienavigate(ByRef $o_object, $s_url, $f_wait = 1, $i_flags = 0, $s_target = "", $s_postdata = "", $s_headers = "")
    	__ieerrornotify("Warning", "__IENavigate", "Unsupported function called. Not fully tested.")
    	If NOT IsObj($o_object) Then
    		__ieerrornotify("Error", "__IENavigate", "$_IEStatus_InvalidDataType")
    		Return SetError($_iestatus_invaliddatatype, 1, 0)
    	EndIf
    	If NOT __ieisobjtype($o_object, "documentContainer") Then
    		__ieerrornotify("Error", "__IENavigate", "$_IEStatus_InvalidObjectType")
    		Return SetError($_iestatus_invalidobjecttype, 1, 0)
    	EndIf
    	$o_object.navigate($s_url, $i_flags, $s_target, $s_postdata, $s_headers)
    	If $f_wait Then
    		_ieloadwait($o_object)
    		Return SetError(@error, 0, $o_object)
    	EndIf
    	Return SetError($_iestatus_success, 0, $o_object)
    EndFunc
    
    Func __iestringtobstr($s_string, $s_charset = "us-ascii")
    	Local Const $adtypebinary = 1, $adtypetext = 2
    	Local $o_stream = ObjCreate("ADODB.Stream")
    	$o_stream.type = $adtypetext
    	$o_stream.charset = $s_charset
    	$o_stream.open
    	$o_stream.writetext($s_string)
    	$o_stream.position = 0
    	$o_stream.type = $adtypebinary
    	$o_stream.position = 0
    	Return $o_stream.read
    EndFunc
    
    Func __iebstrtostring($o_bstr, $s_charset = "us-ascii")
    	Local Const $adtypebinary = 1, $adtypetext = 2
    	Local $o_stream = ObjCreate("ADODB.Stream")
    	$o_stream.type = $adtypebinary
    	$o_stream.open
    	$o_stream.write($o_bstr)
    	$o_stream.position = 0
    	$o_stream.type = $adtypetext
    	$o_stream.charset = $s_charset
    	$o_stream.position = 0
    	Return $o_stream.readtext
    EndFunc
    
    Func __iecreatenewie($s_title, $s_head = "", $s_body = "")
    	Local $s_temp = __ietempfile("", "~IE~", ".htm")
    	If @error Then
    		__ieerrornotify("Error", "_IECreateHTA", "", "Error creating temporary file in @TempDir or @ScriptDir")
    		Return SetError($_iestatus_generalerror, 1, 0)
    	EndIf
    	Local $s_html = ""
    	$s_html &= "<HTML>" & @CR
    	$s_html &= "<HEAD>" & @CR
    	$s_html &= "<TITLE>" & $s_temp & "</TITLE>" & @CR & $s_head & @CR
    	$s_html &= "</HEAD>" & @CR
    	$s_html &= "<BODY>" & @CR & $s_body & @CR
    	$s_html &= "</BODY>" & @CR
    	$s_html &= "</HTML>"
    	Local $h_file = FileOpen($s_temp, 2)
    	FileWrite($h_file, $s_html)
    	FileClose($h_file)
    	If @error Then
    		__ieerrornotify("Error", "_IECreateNewIE", "", "Error creating temporary file in @TempDir or @ScriptDir")
    		Return SetError($_iestatus_generalerror, 2, 0)
    	EndIf
    	Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $s_temp)
    	Local $s_pid
    	If WinWait($s_temp, "", 60) Then
    		$s_pid = WinGetProcess($s_temp)
    	Else
    		__ieerrornotify("Error", "_IECreateNewIE", "", "Timeout waiting for new IE window creation")
    		Return SetError($_iestatus_generalerror, 3, 0)
    	EndIf
    	If NOT FileDelete($s_temp) Then
    		__ieerrornotify("Warning", "_IECreateNewIE", "", "Could not delete temporary file " & FileGetLongName($s_temp))
    	EndIf
    	Local $o_object = _ieattach($s_temp)
    	_ieloadwait($o_object)
    	_iepropertyset($o_object, "title", $s_title)
    	Return SetError($_iestatus_success, $s_pid, $o_object)
    EndFunc
    
    Func __ietempfile($s_directoryname = @TempDir, $s_fileprefix = "~", $s_fileextension = ".tmp", $i_randomlength = 7)
    	Local $s_tempname, $i_tmp = 0
    	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
    		$i_tmp += 1
    		If $i_tmp > 200 Then
    			Return SetError($_iestatus_generalerror, 1, 0)
    		EndIf
    	Until NOT FileExists($s_tempname)
    	Return $s_tempname
    EndFunc
    
    #EndRegion ProtoType Functions
    
    Func _filecountlines($sfilepath)
    	Local $hfile = FileOpen($sfilepath, $fo_read)
    	If $hfile = -1 Then Return SetError(1, 0, 0)
    	Local $sfilecontent = StringStripWS(FileRead($hfile), 2)
    	FileClose($hfile)
    	Local $atmp
    	If StringInStr($sfilecontent, @LF) Then
    		$atmp = StringSplit(StringStripCR($sfilecontent), @LF)
    	ElseIf StringInStr($sfilecontent, @CR) Then
    		$atmp = StringSplit($sfilecontent, @CR)
    	Else
    		If StringLen($sfilecontent) Then
    			Return 1
    		Else
    			Return SetError(2, 0, 0)
    		EndIf
    	EndIf
    	Return $atmp[0]
    EndFunc
    
    Func _filecreate($sfilepath)
    	Local $hopenfile = FileOpen($sfilepath, $fo_overwrite)
    	If $hopenfile = -1 Then Return SetError(1, 0, 0)
    	Local $hwritefile = FileWrite($hopenfile, "")
    	FileClose($hopenfile)
    	If $hwritefile = -1 Then Return SetError(2, 0, 0)
    	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
    		$hfile = FileOpen($file, $fo_overwrite)
    	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, $a_array[$x] & @CRLF) = 0 Then
    			$errorsav = 3
    			ExitLoop 
    		EndIf
    	Next
    	If IsString($file) Then FileClose($hfile)
    	If $errorsav Then Return SetError($errorsav, 0, 0)
    	Return 1
    EndFunc
    
    Func _filewritelog($slogpath, $slogmsg, $iflag = -1)
    	Local $iopenmode = $fo_append
    	Local $sdatenow = @YEAR & "-" & @MON & "-" & @MDAY
    	Local $stimenow = @HOUR & ":" & @MIN & ":" & @SEC
    	Local $smsg = $sdatenow & " " & $stimenow & " : " & $slogmsg
    	If $iflag <> -1 Then
    		$smsg &= @CRLF & FileRead($slogpath)
    		$iopenmode = $fo_overwrite
    	EndIf
    	Local $hopenfile = FileOpen($slogpath, $iopenmode)
    	If $hopenfile = -1 Then Return SetError(1, 0, 0)
    	Local $iwritefile = FileWriteLine($hopenfile, $smsg)
    	Local $iret = FileClose($hopenfile)
    	If $iwritefile = -1 Then Return SetError(2, $iret, 0)
    	Return $iret
    EndFunc
    
    Func _filewritetoline($sfile, $iline, $stext, $foverwrite = 0)
    	If $iline <= 0 Then Return SetError(4, 0, 0)
    	If NOT IsString($stext) Then
    		$stext = String($stext)
    		If $stext = "" Then Return SetError(6, 0, 0)
    	EndIf
    	If $foverwrite <> 0 AND $foverwrite <> 1 Then Return SetError(5, 0, 0)
    	If NOT FileExists($sfile) Then Return SetError(2, 0, 0)
    	Local $sread_file = FileRead($sfile)
    	Local $asplit_file = StringSplit(StringStripCR($sread_file), @LF)
    	If UBound($asplit_file) < $iline Then Return SetError(1, 0, 0)
    	Local $hfile = FileOpen($sfile, $fo_overwrite)
    	If $hfile = -1 Then Return SetError(3, 0, 0)
    	$sread_file = ""
    	For $i = 1 To $asplit_file[0]
    		If $i = $iline Then
    			If $foverwrite = 1 Then
    				If $stext <> "" Then $sread_file &= $stext & @CRLF
    			Else
    				$sread_file &= $stext & @CRLF & $asplit_file[$i] & @CRLF
    			EndIf
    		ElseIf $i < $asplit_file[0] Then
    			$sread_file &= $asplit_file[$i] & @CRLF
    		ElseIf $i = $asplit_file[0] Then
    			$sread_file &= $asplit_file[$i]
    		EndIf
    	Next
    	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($sfullpath, 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) Then
    			$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($sfullpath)
    	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($sto, 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($srelpath, 1)
    	Return $srelpath
    EndFunc
    
    Func _pathmake($szdrive, $szdir, $szfname, $szext)
    	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
    	Return $szdrive & $szdir & $szfname & $szext
    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 $ncount, $sendswith
    	If StringInStr(FileGetAttrib($szfilename), "R") Then Return SetError(6, 0, -1)
    	Local $hfile = FileOpen($szfilename, $fo_read)
    	If $hfile = -1 Then Return SetError(1, 0, -1)
    	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
    	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_fileextension = ".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_directoryname & "\"
    	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
    
    Global Const $__soundconstant_sndid_marker = 1229204781
    
    Func _soundopen($sfile)
    	If NOT FileExists($sfile) Then Return SetError(2, 0, 0)
    	Local $asndid[4]
    	For $i = 1 To 10
    		$asndid[0] &= Chr(Random(97, 122, 1))
    	Next
    	Local $szdrive, $szdir, $szfname, $szext
    	_pathsplit($sfile, $szdrive, $szdir, $szfname, $szext)
    	Local $ssnddirname
    	If $szdrive = "" Then
    		$ssnddirname = @WorkingDir & "\"
    	Else
    		$ssnddirname = $szdrive & $szdir
    	EndIf
    	Local $ssndfilename = $szfname & $szext
    	Local $ssnddirshortname = FileGetShortName($ssnddirname, 1)
    	__soundmcisendstring("open " & FileGetShortName($sfile) & " alias " & $asndid[0])
    	If @error Then Return SetError(1, @error, 0)
    	Local $stracklength, $ftrynextmethod = False
    	Local $oshell = ObjCreate("shell.application")
    	If IsObj($oshell) Then
    		Local $oshelldir = $oshell.namespace($ssnddirshortname)
    		If IsObj($oshelldir) Then
    			Local $oshelldirfile = $oshelldir.parsename($ssndfilename)
    			If IsObj($oshelldirfile) Then
    				Local $sraw = $oshelldir.getdetailsof($oshelldirfile, -1)
    				Local $ainfo = StringRegExp($sraw, ": ([0-9]{2}:[0-9]{2}:[0-9]{2})", 3)
    				If NOT IsArray($ainfo) Then
    					$ftrynextmethod = True
    				Else
    					$stracklength = $ainfo[0]
    				EndIf
    			Else
    				$ftrynextmethod = True
    			EndIf
    		Else
    			$ftrynextmethod = True
    		EndIf
    	Else
    		$ftrynextmethod = True
    	EndIf
    	Local $stag
    	If $ftrynextmethod Then
    		$ftrynextmethod = False
    		If $szext = ".mp3" Then
    			Local $hfile = FileOpen(FileGetShortName($ssnddirname & $ssndfilename), 4)
    			$stag = FileRead($hfile, 5156)
    			FileClose($hfile)
    			$stracklength = __soundreadxingfrommp3($stag)
    			If @error Then $ftrynextmethod = True
    		Else
    			$ftrynextmethod = True
    		EndIf
    	EndIf
    	If $ftrynextmethod Then
    		$ftrynextmethod = False
    		If $szext = ".mp3" Then
    			$stracklength = __soundreadtlenfrommp3($stag)
    			If @error Then $ftrynextmethod = True
    		Else
    			$ftrynextmethod = True
    		EndIf
    	EndIf
    	If $ftrynextmethod Then
    		$ftrynextmethod = False
    		__soundmcisendstring("set " & $asndid[0] & " time format miliseconds")
    		Local $isndlenms = __soundmcisendstring("status " & $asndid[0] & " length", 255)
    		Local $isndlenmin, $isndlenhour, $isndlensecs
    		__soundtickstotime($isndlenms, $isndlenhour, $isndlenmin, $isndlensecs)
    		$stracklength = StringFormat("%02i:%02i:%02i", $isndlenhour, $isndlenmin, $isndlensecs)
    	EndIf
    	Local $aitime = StringSplit($stracklength, ":")
    	Local $iactualticks = __soundtimetoticks($aitime[1], $aitime[2], $aitime[3])
    	__soundmcisendstring("set " & $asndid[0] & " time format miliseconds")
    	Local $isoundticks = __soundmcisendstring("status " & $asndid[0] & " length", 255)
    	Local $ivbrratio
    	If Abs($isoundticks - $iactualticks) < 1000 Then
    		$ivbrratio = 0
    	Else
    		$ivbrratio = $isoundticks / $iactualticks
    	EndIf
    	$asndid[1] = $ivbrratio
    	$asndid[2] = 0
    	$asndid[3] = $__soundconstant_sndid_marker
    	Return $asndid
    EndFunc
    
    Func _soundclose($asndid)
    	If NOT IsArray($asndid) OR NOT __soundchksndid($asndid) Then Return SetError(3, 0, 0)
    	__soundmcisendstring("close " & $asndid[0])
    	If @error Then Return SetError(1, @error, 0)
    	Return 1
    EndFunc
    
    Func _soundplay($asndid, $iwait = 0)
    	If $iwait <> 0 AND $iwait <> 1 Then Return SetError(2, 0, 0)
    	If NOT __soundchksndid($asndid) Then Return SetError(3, 0, 0)
    	If _soundpos($asndid, 2) = _soundlength($asndid, 2) Then __soundmcisendstring("seek " & $asndid[0] & " to start")
    	If $iwait = 1 Then
    		__soundmcisendstring("play " & $asndid[0] & " wait")
    	Else
    		__soundmcisendstring("play " & $asndid[0])
    	EndIf
    	If @error Then Return SetError(1, @error, 0)
    	Return 1
    EndFunc
    
    Func _soundstop(ByRef $asndid)
    	Local $vtemp = $asndid
    	If NOT __soundchksndid($vtemp) Then Return SetError(3, 0, 0)
    	If IsArray($asndid) Then $asndid[2] = 0
    	__soundmcisendstring("stop " & $vtemp[0])
    	If @error Then Return SetError(2, @error, 0)
    	__soundmcisendstring("seek " & $vtemp[0] & " to start")
    	If @error Then Return SetError(1, @error, 0)
    	Return 1
    EndFunc
    
    Func _soundpause($asndid)
    	If NOT __soundchksndid($asndid) Then Return SetError(3, 0, 0)
    	__soundmcisendstring("pause " & $asndid[0])
    	If @error Then Return SetError(1, @error, 0)
    	Return 1
    EndFunc
    
    Func _soundresume($asndid)
    	If NOT __soundchksndid($asndid) Then Return SetError(3, 0, 0)
    	__soundmcisendstring("resume " & $asndid[0])
    	If @error Then Return SetError(1, @error, 0)
    	Return 1
    EndFunc
    
    Func _soundlength($asndid, $imode = 1)
    	If $imode <> 1 AND $imode <> 2 Then Return SetError(1, 0, 0)
    	Local $bfile = False
    	If NOT IsArray($asndid) Then
    		If NOT FileExists($asndid) Then Return SetError(3, 0, 0)
    		$bfile = True
    		$asndid = _soundopen($asndid)
    	Else
    		If NOT __soundchksndid($asndid) Then Return SetError(3, 0, 0)
    	EndIf
    	__soundmcisendstring("set " & $asndid[0] & " time format miliseconds")
    	Local $isndlenms = Number(__soundmcisendstring("status " & $asndid[0] & " length", 255))
    	If $asndid[1] <> 0 Then $isndlenms = Round($isndlenms / $asndid[1])
    	If $bfile Then _soundclose($asndid)
    	If $imode = 2 Then Return $isndlenms
    	Local $isndlenmin, $isndlenhour, $isndlensecs
    	__soundtickstotime($isndlenms, $isndlenhour, $isndlenmin, $isndlensecs)
    	Local $ssndlenformat = StringFormat("%02i:%02i:%02i", $isndlenhour, $isndlenmin, $isndlensecs)
    	Return $ssndlenformat
    EndFunc
    
    Func _soundseek(ByRef $asndid, $ihour, $imin, $isec)
    	If NOT IsArray($asndid) OR NOT __soundchksndid($asndid) Then Return SetError(3, 0, 0)
    	__soundmcisendstring("set " & $asndid[0] & " time format miliseconds")
    	Local $ims = $isec * 1000
    	$ims += $imin * 60 * 1000
    	$ims += $ihour * 60 * 60 * 1000
    	If $asndid[1] <> 0 Then
    		$asndid[2] = Round($ims * $asndid[1]) - $ims
    		$ims = Round($ims * $asndid[1])
    	EndIf
    	__soundmcisendstring("seek " & $asndid[0] & " to " & $ims)
    	Local $ierror = @error
    	If _soundpos($asndid, 2) < 0 Then $asndid[2] = 0
    	If $ierror Then Return SetError(1, $ierror, 0)
    	Return 1
    EndFunc
    
    Func _soundstatus($asndid)
    	If NOT __soundchksndid($asndid) Then Return SetError(3, 0, 0)
    	Return __soundmcisendstring("status " & $asndid[0] & " mode", 255)
    EndFunc
    
    Func _soundpos($asndid, $imode = 1)
    	If $imode <> 1 AND $imode <> 2 Then Return SetError(1, 0, 0)
    	If NOT __soundchksndid($asndid) Then Return SetError(3, 0, 0)
    	__soundmcisendstring("set " & $asndid[0] & " time format miliseconds")
    	Local $isndposms = Number(__soundmcisendstring("status " & $asndid[0] & " position", 255))
    	If $asndid[1] <> 0 Then
    		$isndposms -= $asndid[2]
    	EndIf
    	If $imode = 2 Then Return $isndposms
    	Local $isndposmin, $isndposhour, $isndpossecs
    	__soundtickstotime($isndposms, $isndposhour, $isndposmin, $isndpossecs)
    	Local $ssndposhms = StringFormat("%02i:%02i:%02i", $isndposhour, $isndposmin, $isndpossecs)
    	Return $ssndposhms
    EndFunc
    
    Func __soundchksndid(ByRef $asndid)
    	If NOT IsArray($asndid) Then
    		If NOT FileExists($asndid) Then Return 0
    		Local $vtemp = FileGetShortName($asndid)
    		Dim $asndid[4] = [$vtemp, 0, 0, $__soundconstant_sndid_marker]
    	Else
    		If UBound($asndid) <> 4 AND $asndid[3] <> $__soundconstant_sndid_marker Then Return 0
    	EndIf
    	Return 1
    EndFunc
    
    Func __soundmcisendstring($string, $ilen = 0)
    	Local $iret = DllCall("winmm.dll", "dword", "mciSendStringW", "wstr", $string, "wstr", "", "uint", $ilen, "ptr", 0)
    	If @error Then Return SetError(@error, @extended, "")
    	If $iret[0] Then Return SetError(10, $iret[0], $iret[2])
    	Return $iret[2]
    EndFunc
    
    Func __soundreadtlenfrommp3($stag)
    	If StringLeft($stag, 10) <> "0x49443303" Then Return SetError(1, 0, 0)
    	Local $itemp = StringInStr($stag, "544C454E") + 21
    	$stag = StringTrimLeft($stag, $itemp)
    	Local $stemp = ""
    	For $i = 1 To 32 Step 2
    		If StringMid($stag, $i, 2) = "00" Then
    			ExitLoop 
    		Else
    			$stemp &= StringMid($stag, $i, 2)
    		EndIf
    	Next
    	Local $ilengthms = Number(BinaryToString("0x" & $stemp))
    	If $ilengthms <= 0 Then Return SetError(1, 0, 0)
    	Local $ilengthhour, $ilengthmin, $ilengthsecs
    	__soundtickstotime($ilengthms, $ilengthhour, $ilengthmin, $ilengthsecs)
    	Return StringFormat("%02i:%02i:%02i", $ilengthhour, $ilengthmin, $ilengthsecs)
    EndFunc
    
    Func __soundreadxingfrommp3($stag)
    	Local $ixingpos = StringInStr($stag, "58696E67")
    	If $ixingpos = 0 Then Return SetError(1, 0, 0)
    	Local $iframes, $iflags = Number("0x" & StringMid($stag, $ixingpos + 14, 2))
    	If BitAND($iflags, 1) = 1 Then
    		$iframes = Number("0x" & StringMid($stag, $ixingpos + 16, 8))
    	Else
    		Return SetError(1, 0, 0)
    	EndIf
    	Local $sheader = StringMid($stag, $ixingpos - 72, 8)
    	Local $impegbyte = Number("0x" & StringMid($sheader, 4, 1))
    	Local $ifreqbyte = Number("0x" & StringMid($sheader, 6, 1))
    	Local $impegver = BitAND($impegbyte, 8)
    	Local $ilayernum = BitAND($impegbyte, 6)
    	Local $isamples
    	Switch $ilayernum
    		Case 6
    			$isamples = 384
    		Case 4
    			$isamples = 1152
    		Case 2
    			Switch $impegver
    				Case 8
    					$isamples = 1152
    				Case 0
    					$isamples = 576
    				Case Else
    					$isamples = 0
    			EndSwitch
    		Case Else
    			$isamples = 0
    	EndSwitch
    	If $isamples = 0 Then Return SetError(1, 0, 0)
    	Local $ifrequency, $ifreqnum = BitAND($ifreqbyte, 12)
    	Switch $ifreqnum
    		Case 0
    			$ifrequency = 44100
    		Case 4
    			$ifrequency = 48000
    		Case 8
    			$ifrequency = 32000
    		Case Else
    			$ifrequency = 0
    	EndSwitch
    	If $ifrequency = 0 Then Return SetError(1, 0, 0)
    	If $impegver = 0 Then $ifrequency = $ifrequency / 2
    	Local $ilengthms = Int(($iframes * $isamples / $ifrequency) * 1000)
    	Local $ilengthhours, $ilengthmins, $ilengthsecs
    	__soundtickstotime($ilengthms, $ilengthhours, $ilengthmins, $ilengthsecs)
    	Return StringFormat("%02i:%02i:%02i", $ilengthhours, $ilengthmins, $ilengthsecs)
    EndFunc
    
    Func __soundtickstotime($iticks, ByRef $ihours, ByRef $imins, ByRef $isecs)
    	If Number($iticks) < 0 Then Return SetError(1, 0, 0)
    	If Number($iticks) = 0 Then
    		$ihours = 0
    		$iticks = 0
    		$imins = 0
    		$isecs = 0
    		Return 1
    	EndIf
    	$iticks = Round($iticks / 1000)
    	$ihours = Int($iticks / 3600)
    	$iticks = Mod($iticks, 3600)
    	$imins = Int($iticks / 60)
    	$isecs = Round(Mod($iticks, 60))
    	Return 1
    EndFunc
    
    Func __soundtimetoticks($ihours = @HOUR, $imins = @MIN, $isecs = @SEC)
    	If NOT (StringIsInt($ihours) AND StringIsInt($imins) AND StringIsInt($isecs)) Then Return SetError(1, 0, 0)
    	Return 1000 * ((3600 * $ihours) + (60 * $imins) + $isecs)
    EndFunc
    
    Opt("GuiOnEventMode", 1)
    Opt("TrayOnEventMode", 1)
    Opt("TrayMenuMode", 1)
    Global $ok = False, $target, $hp_pet, $hp, $mp, $detect, $tt_target, $skill_hppet1, $hp_thoatnhanh1, $skill_hp1, $skill_mp1, $check_ttptc1, $ttptc_input1, $check_nhatdo1
    Global $check_thoatnhanh1, $check_hppet1, $check_mp1, $check_hp1, $check_luaquai1, $check_skill_2, $check_skill_3, $check_skill_4, $check_skill_5, $check_skill_6, $check_skill_7
    Global $buff_hp = TimerInit(), $timer = TimerInit(), $timer2 = TimerInit(), $timer3 = TimerInit(), $timer4 = TimerInit(), $timer5 = TimerInit(), $timer6 = TimerInit(), $timer7 = TimerInit()
    Global $oie = _iecreateembedded()
    Global $vk_f1 = "0x70", $vk_f2 = "0x71", $vk_f3 = "0x72", $vk_f4 = "0x73", $vk_f5 = "0x74", $vk_f6 = "0x75", $vk_f7 = "0x76", $vk_f8 = "0x77", $vk_f9 = "0x78", $vk_f10 = "0x79"
    Global $skill2, $skill3, $skill4, $skill5, $skill6, $skill7, $delay2, $delay3, $delay4, $delay5, $delay6, $delay7, $name, $check_nhatdo
    Global $winpost
    Global $sound = _soundopen(@ScriptDir & "\sound.mp3")
    HotKeySet("^+q", "TERMINATE")
    HotKeySet("^+i", "SHOWMESSAGE")
    HotKeySet("^p", "OK")
    HotKeySet("{PGUP}", "SHOWTRAY")
    HotKeySet("{PGDN}", "TRAY")
    $pid = WinGetProcess("[Class:TianLongBaBu WndClass]")
    $title = WinGetTitle("[Class:TianLongBaBu WndClass]")
    $handle = WinGetHandle($title)
    $memid = _memoryopen($pid)
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Ignore_Variables=
    #Obfuscator_Ignore_Funcs=
    #Obfuscator_On
    #Region ### START Koda GUI section ### Form=c:\documents and settings\admin\desktop\auto 2.kxf
    $form = GUICreate("Auto CLB", 225, 430, 791, 273)
    GUISetOnEvent($gui_event_close, "Terminate")
    $tab1 = GUICtrlCreateTab(-1, 0, 225, 430)
    $tabsheet1 = GUICtrlCreateTabItem("General")
    $check_hppet = GUICtrlCreateCheckbox("Hp <", 15, 45, 40, 25)
    GUICtrlSetState(-1, 1)
    $hppet_input = GUICtrlCreateCombo("", 60, 48, 40, 20, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "10|20|30|40|50|60|70|80|90|100", "50")
    $label1 = GUICtrlCreateLabel("% - Buff", 102, 51, 40, 17)
    $skill_hppet = GUICtrlCreateCombo("", 148, 48, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F10")
    $check_hp = GUICtrlCreateCheckbox("Hp <", 15, 92, 40, 25)
    GUICtrlSetState(-1, 1)
    $hp_input = GUICtrlCreateCombo("", 60, 95, 40, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "10|20|30|40|50|60|70|80|90|100", "80")
    $label2 = GUICtrlCreateLabel("% - Buff", 102, 98, 40, 17)
    $skill_hp = GUICtrlCreateCombo("", 148, 95, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F9")
    $check_mp = GUICtrlCreateCheckbox("Mp <", 15, 123, 40, 25)
    GUICtrlSetState(-1, 1)
    $mp_input = GUICtrlCreateCombo("", 60, 126, 40, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "10|20|30|40|50|60|70|80|90|100", "50")
    $label3 = GUICtrlCreateLabel("% - Buff", 102, 129, 40, 17)
    $skill_mp = GUICtrlCreateCombo("", 148, 126, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F8")
    $group_pet = GUICtrlCreateGroup("Pet", 7, 28, 209, 49)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $group_char = GUICtrlCreateGroup("Nhan vat", 7, 76, 209, 81)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $check_skill2 = GUICtrlCreateCheckbox("Skill", 16, 171, 40, 25)
    GUICtrlSetState(-1, 1)
    $skill2_input = GUICtrlCreateCombo("", 60, 174, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F2")
    $label14 = GUICtrlCreateLabel("Sau", 121, 177, 23, 17)
    $delay_skill2 = GUICtrlCreateInput("20", 148, 174, 49, 21)
    $label15 = GUICtrlCreateLabel("s", 199, 177, 9, 17)
    $check_skill3 = GUICtrlCreateCheckbox("Skill", 16, 201, 40, 25)
    GUICtrlSetState(-1, 1)
    $skill3_input = GUICtrlCreateCombo("", 60, 204, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F3")
    $label4 = GUICtrlCreateLabel("Sau", 121, 207, 23, 17)
    $delay_skill3 = GUICtrlCreateInput("25", 148, 204, 49, 21)
    $label5 = GUICtrlCreateLabel("s", 199, 207, 9, 17)
    $check_skill4 = GUICtrlCreateCheckbox("Skill", 16, 232, 40, 25)
    GUICtrlSetState(-1, 1)
    $skill4_input = GUICtrlCreateCombo("", 60, 235, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F4")
    $label6 = GUICtrlCreateLabel("Sau", 121, 238, 23, 17)
    $delay_skill4 = GUICtrlCreateInput("30", 148, 235, 49, 21)
    $label7 = GUICtrlCreateLabel("s", 199, 238, 9, 17)
    $check_skill5 = GUICtrlCreateCheckbox("Skill", 16, 262, 40, 25)
    GUICtrlSetState(-1, 1)
    $skill5_input = GUICtrlCreateCombo("", 60, 265, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F5")
    $label8 = GUICtrlCreateLabel("Sau", 121, 268, 23, 17)
    $delay_skill5 = GUICtrlCreateInput("40", 148, 265, 49, 21)
    $label9 = GUICtrlCreateLabel("s", 199, 268, 9, 17)
    $check_skill6 = GUICtrlCreateCheckbox("Skill", 16, 293, 40, 25)
    GUICtrlSetState(-1, 1)
    $skill6_input = GUICtrlCreateCombo("", 60, 296, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F6")
    $label10 = GUICtrlCreateLabel("Sau", 121, 299, 23, 17)
    $delay_skill6 = GUICtrlCreateInput("50", 148, 296, 49, 21)
    $label11 = GUICtrlCreateLabel("s", 199, 299, 9, 17)
    $check_skill7 = GUICtrlCreateCheckbox("Skill", 16, 323, 40, 25)
    GUICtrlSetState(-1, 1)
    $skill7_input = GUICtrlCreateCombo("", 60, 326, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F7")
    $label12 = GUICtrlCreateLabel("Sau", 121, 329, 23, 17)
    $delay_skill7 = GUICtrlCreateInput("60", 148, 326, 49, 21)
    $label13 = GUICtrlCreateLabel("s", 199, 329, 9, 17)
    $group3 = GUICtrlCreateGroup("Combo", 8, 158, 209, 201)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $button = GUICtrlCreateButton("START", 130, 380, 85, 34)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetOnEvent(-1, "ok")
    GUICtrlSetTip(-1, "Ctrl + P")
    $ten_nv = GUICtrlCreateLabel("", 20, 360, 80, 30)
    $label_hp = GUICtrlCreateLabel("Hp", 5, 378, 20, 30)
    GUICtrlSetColor(-1, 16716032)
    $hp_nv = GUICtrlCreateProgress(23, 380, 100, 10)
    $label_mp = GUICtrlCreateLabel("Mp", 5, 393, 20, 30)
    GUICtrlSetColor(-1, 131277)
    $mp_nv = GUICtrlCreateProgress(23, 395, 100, 10)
    $label_pet = GUICtrlCreateLabel("Pet", 5, 408, 20, 30)
    $hppet_nv = GUICtrlCreateProgress(23, 410, 80, 10)
    $tabsheet2 = GUICtrlCreateTabItem("Options")
    $check_nhatdo = GUICtrlCreateCheckbox("Tu dong nhat do (Beta)", 15, 30, 160, 25)
    $check_ttptc = GUICtrlCreateCheckbox("Buff TTPTC - NM", 15, 60, 100, 25)
    $ttptc_input = GUICtrlCreateCombo("", 127, 62, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10", "F9")
    $check_luaquai = GUICtrlCreateCheckbox("Target lien tuc sau:", 15, 90, 105, 25)
    $target_input = GUICtrlCreateCombo("", 127, 92, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "0|1|2|3|4|5|6|7|8|9|10", "3")
    $check_thoatnhanh = GUICtrlCreateCheckbox("Thoat game, Hp <", 15, 120, 105, 25)
    $hp_thoatnhanh = GUICtrlCreateCombo("", 126, 122, 57, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
    GUICtrlSetData(-1, "5|10|15|20|25|30|35|40|45|50", "10")
    $check_bankinh = GUICtrlCreateCheckbox("Co dinh (Fixing...)", 15, 150, 115, 25)
    $label16 = GUICtrlCreateLabel("s", 187, 93, 9, 17)
    $label17 = GUICtrlCreateLabel("%", 187, 127, 12, 17)
    $save = GUICtrlCreateButton("Save", 8, 390, 50, 23)
    GUICtrlSetOnEvent(-1, "SaveSetting")
    $load = GUICtrlCreateButton("Load", 60, 390, 50, 23)
    GUICtrlSetOnEvent(-1, "LoadSetting")
    $hide = GUICtrlCreateButton("Hide", 112, 390, 50, 23)
    GUICtrlSetOnEvent(-1, "hide")
    $show = GUICtrlCreateButton("Show", 164, 390, 50, 23)
    GUICtrlSetOnEvent(-1, "show")
    $hd = GUICtrlCreateObj($oie, 0, 200, 240, 185)
    _ienavigate($oie, "http://clbgamesvn.com")
    GUICtrlCreateTabItem("")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    #Obfuscator_Off
    #AutoIt3Wrapper_Run_Obfuscator=y
    #Obfuscator_Ignore_Variables=
    #Obfuscator_Ignore_Funcs=
    #Obfuscator_On
    
    Func savesetting()
    	Global $path = @ScriptDir & "\" & $name & ".ini"
    	IniWrite($path, "Pet", "Check", GUICtrlRead($check_hppet))
    	IniWrite($path, "Pet", "%", GUICtrlRead($hppet_input))
    	IniWrite($path, "Pet", "Key", GUICtrlRead($skill_hppet))
    	IniWrite($path, "Hp", "Check", GUICtrlRead($check_hp))
    	IniWrite($path, "Hp", "%", GUICtrlRead($hp_input))
    	IniWrite($path, "Hp", "Key", GUICtrlRead($skill_hp))
    	IniWrite($path, "Mp", "Check", GUICtrlRead($check_mp))
    	IniWrite($path, "Mp", "%", GUICtrlRead($mp_input))
    	IniWrite($path, "Mp", "Key", GUICtrlRead($skill_mp))
    	IniWrite($path, "Skill2", "Check", GUICtrlRead($check_skill2))
    	IniWrite($path, "Skill2", "Key", GUICtrlRead($skill2_input))
    	IniWrite($path, "Skill2", "Delay", GUICtrlRead($delay_skill2))
    	IniWrite($path, "Skill3", "Check", GUICtrlRead($check_skill3))
    	IniWrite($path, "Skill3", "Key", GUICtrlRead($skill3_input))
    	IniWrite($path, "Skill3", "Delay", GUICtrlRead($delay_skill3))
    	IniWrite($path, "Skill4", "Check", GUICtrlRead($check_skill4))
    	IniWrite($path, "Skill4", "Key", GUICtrlRead($skill4_input))
    	IniWrite($path, "Skill4", "Delay", GUICtrlRead($delay_skill4))
    	IniWrite($path, "Skill5", "Check", GUICtrlRead($check_skill5))
    	IniWrite($path, "Skill5", "Key", GUICtrlRead($skill5_input))
    	IniWrite($path, "Skill5", "Delay", GUICtrlRead($delay_skill5))
    	IniWrite($path, "Skill6", "Check", GUICtrlRead($check_skill6))
    	IniWrite($path, "Skill6", "Key", GUICtrlRead($skill6_input))
    	IniWrite($path, "Skill6", "Delay", GUICtrlRead($delay_skill6))
    	IniWrite($path, "Skill7", "Check", GUICtrlRead($check_skill7))
    	IniWrite($path, "Skill7", "Key", GUICtrlRead($skill7_input))
    	IniWrite($path, "Skill7", "Delay", GUICtrlRead($delay_skill7))
    	IniWrite($path, "Opt", "Nhat_do", GUICtrlRead($check_nhatdo))
    	IniWrite($path, "Opt", "TTPTC", GUICtrlRead($check_ttptc))
    	IniWrite($path, "Opt", "Key_TTPTC", GUICtrlRead($ttptc_input))
    	IniWrite($path, "Opt", "Check_train", GUICtrlRead($check_luaquai))
    	IniWrite($path, "Opt", "Tg_train", GUICtrlRead($target_input))
    	IniWrite($path, "Opt", "Check_thoat", GUICtrlRead($check_thoatnhanh))
    	IniWrite($path, "Opt", "%_thoat", GUICtrlRead($hp_thoatnhanh))
    	IniWrite($path, "Opt", "Co_dinh", GUICtrlRead($check_bankinh))
    EndFunc
    
    Func loadsetting()
    	Global $path = @ScriptDir & "\" & $name & ".ini"
    	GUICtrlSetState($check_hppet, IniRead($path, "Pet", "Check", "1"))
    	GUICtrlSetData($hppet_input, IniRead($path, "Pet", "%", "50"))
    	GUICtrlSetData($skill_hppet, IniRead($path, "Pet", "Key", "F10"))
    	GUICtrlSetState($check_hp, IniRead($path, "Hp", "Check", "1"))
    	GUICtrlSetData($hp_input, IniRead($path, "Hp", "%", "80"))
    	GUICtrlSetData($skill_hp, IniRead($path, "Hp", "Key", "F9"))
    	GUICtrlSetState($check_mp, IniRead($path, "Mp", "Check", "1"))
    	GUICtrlSetData($mp_input, IniRead($path, "Mp", "%", "50"))
    	GUICtrlSetData($skill_mp, IniRead($path, "Mp", "Key", "F8"))
    	GUICtrlSetState($check_skill2, IniRead($path, "Skill2", "Check", "1"))
    	GUICtrlSetData($skill2_input, IniRead($path, "Skill2", "Key", "F2"))
    	GUICtrlSetData($delay_skill2, IniRead($path, "Skill2", "Delay", "20"))
    	GUICtrlSetState($check_skill3, IniRead($path, "Skill3", "Check", "1"))
    	GUICtrlSetData($skill3_input, IniRead($path, "Skill3", "Key", "F3"))
    	GUICtrlSetData($delay_skill3, IniRead($path, "Skill3", "Delay", "25"))
    	GUICtrlSetState($check_skill4, IniRead($path, "Skill4", "Check", "1"))
    	GUICtrlSetData($skill4_input, IniRead($path, "Skill4", "Key", "F4"))
    	GUICtrlSetData($delay_skill4, IniRead($path, "Skill4", "Delay", "30"))
    	GUICtrlSetState($check_skill5, IniRead($path, "Skill5", "Check", "1"))
    	GUICtrlSetData($skill5_input, IniRead($path, "Skill5", "Key", "F5"))
    	GUICtrlSetData($delay_skill5, IniRead($path, "Skill5", "Delay", "50"))
    	GUICtrlSetState($check_skill6, IniRead($path, "Skill6", "Check", "1"))
    	GUICtrlSetData($skill6_input, IniRead($path, "Skill6", "Key", "F6"))
    	GUICtrlSetData($delay_skill6, IniRead($path, "Skill6", "Delay", "60"))
    	GUICtrlSetState($check_skill7, IniRead($path, "Skill7", "Check", "1"))
    	GUICtrlSetData($skill7_input, IniRead($path, "Skill7", "Key", "F7"))
    	GUICtrlSetData($delay_skill7, IniRead($path, "Skill7", "Delay", "60"))
    	GUICtrlSetState($check_nhatdo, IniRead($path, "Opt", "Nhat_do", ""))
    	GUICtrlSetState($check_ttptc, IniRead($path, "Opt", "TTPTC", ""))
    	GUICtrlSetData($ttptc_input, IniRead($path, "Opt", "Key_TTPTC", "F9"))
    	GUICtrlSetState($check_luaquai, IniRead($path, "Opt", "Check_train", ""))
    	GUICtrlSetData($target_input, IniRead($path, "Opt", "Tg_train", "3"))
    	GUICtrlSetState($check_thoatnhanh, IniRead($path, "Opt", "Check_thoat", "1"))
    	GUICtrlSetData($hp_thoatnhanh, IniRead($path, "Opt", "%_thoat", "10"))
    	GUICtrlSetState($check_bankinh, IniRead($path, "Opt", "Co_dinh", ""))
    EndFunc
    
    Func hide()
    	WinSetState($handle, "", @SW_HIDE)
    EndFunc
    
    Func show()
    	WinSetState($handle, "", @SW_SHOW)
    EndFunc
    
    #Obfuscator_Off
    If StringLeft(WinGetTitle("[Class:TianLongBaBu WndClass]"), 22) <> "Thien Long Bat Bo 3.55.1503" Then
    EndIf
    
    Func ok()
    	$ok = NOT $ok
    	$timer = TimerInit()
    EndFunc
    
    Func read()
    	$hp = GUICtrlRead($hp_input)
    	$mp = GUICtrlRead($mp_input)
    	$hp_pet = GUICtrlRead($hppet_input)
    	$target = GUICtrlRead($target_input)
    	$check_hppet1 = GUICtrlRead($check_hppet)
    	$check_hp1 = GUICtrlRead($check_hp)
    	$check_mp1 = GUICtrlRead($check_mp)
    	$check_luaquai1 = GUICtrlRead($check_luaquai)
    	$check_skill_2 = GUICtrlRead($check_skill2)
    	$check_skill_3 = GUICtrlRead($check_skill3)
    	$check_skill_4 = GUICtrlRead($check_skill4)
    	$check_skill_5 = GUICtrlRead($check_skill5)
    	$check_skill_6 = GUICtrlRead($check_skill6)
    	$check_skill_7 = GUICtrlRead($check_skill7)
    	$skill_hppet1 = Eval("VK_" & GUICtrlRead($skill_hppet))
    	$skill_hp1 = Eval("VK_" & GUICtrlRead($skill_hp))
    	$skill_mp1 = Eval("VK_" & GUICtrlRead($skill_mp))
    	$skill2 = Eval("VK_" & GUICtrlRead($skill2_input))
    	$skill3 = Eval("VK_" & GUICtrlRead($skill3_input))
    	$skill4 = Eval("VK_" & GUICtrlRead($skill4_input))
    	$skill5 = Eval("VK_" & GUICtrlRead($skill5_input))
    	$skill6 = Eval("VK_" & GUICtrlRead($skill6_input))
    	$skill7 = Eval("VK_" & GUICtrlRead($skill7_input))
    	$ttptc_input1 = Eval("VK_" & GUICtrlRead($ttptc_input))
    	$delay2 = GUICtrlRead($delay_skill2)
    	$delay3 = GUICtrlRead($delay_skill3)
    	$delay4 = GUICtrlRead($delay_skill4)
    	$delay5 = GUICtrlRead($delay_skill5)
    	$delay6 = GUICtrlRead($delay_skill6)
    	$delay7 = GUICtrlRead($delay_skill7)
    	$check_nhatdo1 = GUICtrlRead($check_nhatdo)
    	$check_ttptc1 = GUICtrlRead($check_ttptc)
    	$check_thoatnhanh1 = GUICtrlRead($check_thoatnhanh)
    	$hp_thoatnhanh1 = GUICtrlRead($hp_thoatnhanh)
    	$hide1 = GUICtrlRead($hide)
    EndFunc
    
    Func check()
    	$base_pet = 6576192
    	$base_pet = _memoryread($base_pet, $memid)
    	$base_pet = _memoryread($base_pet + 294556, $memid)
    	$pet = _memoryread(_memoryread(6577372, $memid) + 92, $memid)
    	$hppet = _memoryread($base_pet + 60 + $pet * 312, $memid)
    	$hppet_max = _memoryread($base_pet + 64 + $pet * 312, $memid)
    	GUICtrlSetData($hppet_nv, $hppet * 100 / $hppet_max)
    	$base_char = 6576180
    	$base_char = _memoryread($base_char, $memid)
    	$base_char = _memoryread($base_char + 100, $memid)
    	$base_char = _memoryread($base_char + 340, $memid)
    	$base_char = _memoryread($base_char + 4, $memid)
    	$name = _memoryread($base_char + 48, $memid, "char[16]")
    	TraySetToolTip($name)
    	GUICtrlSetData($ten_nv, $name)
    	$mp_max = _memoryread($base_char + 1860, $memid)
    	$hp_max = _memoryread($base_char + 1856, $memid)
    	$hp_cur = _memoryread($base_char + 1752, $memid)
    	$mp_cur = _memoryread($base_char + 1756, $memid)
    	GUICtrlSetData($hp_nv, $hp_cur * 100 / $hp_max)
    	GUICtrlSetData($mp_nv, $mp_cur * 100 / $mp_max)
    	$base_detect = 6559704
    	$base_detect = _memoryread($base_detect, $memid)
    	$base_detect = _memoryread($base_detect + 0, $memid)
    	$base_detect = _memoryread($base_detect + 12, $memid)
    	$detect = _memoryread($base_detect + 100, $memid)
    	If $detect = 1 Then
    		Dim $out = TimerInit()
    		While 1
    			WinSetState($handle, "", @SW_SHOW)
    			WinActivate($title)
    			SoundPlay(@WindowsDir & "\media\tada.wav", 1)
    			_soundplay($sound)
    			TrayTip("", "Canh bao co cau hoi chong auto, chuong trinh se tu thoat sau 40s...", 5)
    			Sleep(500)
    			$detect = _memoryread($base_detect + 100, $memid)
    			Select 
    				Case $detect = 0
    					_soundstop($sound)
    					ExitLoop 
    				Case TimerDiff($out) > 40000
    					WinActivate($title)
    					ProcessClose($pid)
    			EndSelect
    		WEnd
    	EndIf
    	If $check_thoatnhanh1 = 1 AND $hp_cur * 100 / $hp_max < $hp_thoatnhanh1 Then
    		ProcessClose($pid)
    	EndIf
    	If $check_hppet1 = 1 AND $hppet * 100 / $hppet_max < $hp_pet Then
    		Sleep(500)
    		_winapi_postmessage($handle, 257, $skill_hppet1, 0)
    	EndIf
    	If $check_mp1 = 1 AND $mp_cur * 100 / $mp_max < $mp Then
    		Sleep(500)
    		_winapi_postmessage($handle, 257, $skill_mp1, 0)
    	EndIf
    	If $check_hp1 = 1 AND $hp_cur * 100 / $hp_max < $hp Then
    		If $check_ttptc1 = 1 Then
    			Do
    				$winpost = WinGetPos($handle)
    				WinActivate($handle)
    				WinActive($handle)
    				MouseClick("left", $winpost[0] + 30, $winpost[1] + 60, 10, 10)
    				Sleep(500)
    				_winapi_postmessage($handle, 257, $ttptc_input1, 0)
    				$hp_max = _memoryread($base_char + 1856, $memid)
    				$hp_cur = _memoryread($base_char + 1752, $memid)
    			Until $hp_cur * 100 / $hp_max > $hp
    			_winapi_postmessage($handle, 256, 122, 0)
    		Else
    			If TimerDiff($buff_hp) > 10000 Then
    				Sleep(500)
    				_winapi_postmessage($handle, 257, $skill_hp1, 0)
    				$buff_hp = TimerInit()
    			EndIf
    		EndIf
    	EndIf
    EndFunc
    
    Sleep(500)
    While 1
    	read()
    	check()
    	If $ok Then
    		GUICtrlSetData($button, "STOP")
    		$base_atk = 6549696
    		$base_atk = _memoryread($base_atk, $memid)
    		$base_atk = _memoryread($base_atk + 4, $memid)
    		$base_atk = _memoryread($base_atk + 12, $memid)
    		$atk = _memoryread($base_atk + 100, $memid)
    		$base_mob = 6549672
    		$base_mob = _memoryread($base_mob, $memid)
    		$base_mob = _memoryread($base_mob, $memid)
    		$base_mob = _memoryread($base_mob + 12, $memid)
    		$base_mob = _memoryread($base_mob + 96, $memid)
    		$base_mob = _memoryread($base_mob + 44, $memid)
    		$base_mob = _memoryread($base_mob + 4, $memid)
    		$base_mob = _memoryread($base_mob + 44, $memid)
    		$base_mob = _memoryread($base_mob + 8, $memid)
    		$base_mob = _memoryread($base_mob + 44, $memid)
    		$base_mob = _memoryread($base_mob, $memid)
    		$mob = _memoryread($base_mob + 1888, $memid)
    		If $check_luaquai1 = 1 Then
    			If $check_nhatdo1 = 1 Then nhatdo()
    			_winapi_postmessage($handle, 256, 122, 0)
    			Sleep($target * 1000 - 1000)
    		Else
    			If $atk = 0 OR $mob = 0 Then
    				If $check_nhatdo1 = 1 Then nhatdo()
    				_winapi_postmessage($handle, 256, 122, 0)
    			EndIf
    		EndIf
    		_winapi_postmessage($handle, 257, 112, 0)
    		Sleep(500)
    		If $check_skill_2 = 1 AND TimerDiff($timer2) > $delay2 * 1000 + 3000 Then
    			_winapi_postmessage($handle, 257, $skill2, 0)
    			$timer2 = TimerInit()
    		EndIf
    		If $check_skill_3 = 1 AND TimerDiff($timer3) > $delay3 * 1000 + 3000 Then
    			_winapi_postmessage($handle, 257, $skill3, 0)
    			$timer3 = TimerInit()
    		EndIf
    		If $check_skill_4 = 1 AND TimerDiff($timer4) > $delay4 * 1000 + 3000 Then
    			_winapi_postmessage($handle, 257, $skill4, 0)
    			$timer4 = TimerInit()
    		EndIf
    		If $check_skill_5 = 1 AND TimerDiff($timer5) > $delay5 * 1000 + 3000 Then
    			_winapi_postmessage($handle, 257, $skill5, 0)
    			$timer5 = TimerInit()
    		EndIf
    		If $check_skill_6 = 1 AND TimerDiff($timer6) > $delay6 * 1000 + 3000 Then
    			_winapi_postmessage($handle, 257, $skill6, 0)
    			$timer6 = TimerInit()
    		EndIf
    		If $check_skill_7 = 1 AND TimerDiff($timer7) > $delay7 * 1000 + 3000 Then
    			_winapi_postmessage($handle, 257, $skill7, 0)
    			$timer7 = TimerInit()
    		EndIf
    		Sleep(500)
    	Else
    		GUICtrlSetData($button, "START")
    		Sleep(1000)
    	EndIf
    WEnd
    
    Func terminate()
    	Exit 0
    EndFunc
    
    Func exitme()
    	Exit 
    EndFunc
    
    Func showmessage()
    	MsgBox(64, "Thong Tin Lien He", "Auto TLBB - HuyKhang" & @CRLF & "http://clbgamesvn.com" & @CRLF & "Phone: 01234774778" & @CRLF & "             HuyKhang")
    EndFunc
    
    Func tray()
    	TrayTip("Hide Auto", "Auto duoc an duoi taskbar. nhan PGUP de hien auto", 3)
    	GUISetState(@SW_HIDE)
    	TraySetState(@SW_SHOW)
    EndFunc
    
    Func showtray()
    	GUISetState(@SW_SHOW)
    	TraySetState(@SW_HIDE)
    EndFunc
    
    Func nhatdo()
    	WinActivate($handle)
    	WinActive($handle)
    	$mau1 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 15918219, 2)
    	Sleep(100)
    	$mau2 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 15721348, 2)
    	Sleep(100)
    	$mau3 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 13745532, 2)
    	Sleep(100)
    	$mau4 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 13945207, 2)
    	Sleep(100)
    	$mau5 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 16775059, 2)
    	Sleep(100)
    	$mau6 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 12693615, 2)
    	Sleep(100)
    	$mau7 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 13813621, 2)
    	Sleep(100)
    	$mau8 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 13550451, 2)
    	Sleep(100)
    	$mau9 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 16777128, 2)
    	Sleep(100)
    	$mau10 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 15192964, 2)
    	Sleep(100)
    	$mau11 = PixelSearch(@DesktopWidth / 4, @DesktopHeight / 4, @DesktopWidth * (3 / 4), @DesktopHeight * (3 / 4), 13550451, 2)
    	If WinActive("[Class:TianLongBaBu WndClass]", "") <> 0 Then
    		If $mau1 <> 0 Then
    			MouseMove($mau1[0], $mau1[1])
    			MouseDown("right")
    			Sleep(100)
    			MouseUp("right")
    		ElseIf $mau2 <> 0 Then
    			MouseMove($mau2[0], $mau2[1])
    			MouseDown("right")
    			Sleep(100)
    			MouseUp("right")
    		ElseIf $mau3 <> 0 Then
    			MouseMove($mau3[0], $mau3[1])
    			MouseDown("right")
    			Sleep(100)
    			MouseUp("right")
    		ElseIf $mau4 <> 0 Then
    			MouseMove($mau4[0], $mau4[1])
    			MouseDown("right")
    			Sleep(200)
    			MouseUp("right")
    		ElseIf $mau5 <> 0 Then
    			MouseMove($mau5[0], $mau5[1])
    			MouseDown("right")
    			Sleep(100)
    			MouseUp("right")
    		EndIf
    	EndIf
    EndFunc
    
    #Obfuscator_Off
    việc còn lại lên google tim hiểu AutoIt
    còn nếu muôn làm auto như Gauto hay tieudattai thi chi muốn kiếm tiền và phá nát game tlbb
    có bằng chứng thi nói người ta keylog ăn cắp tài khoản , không thi bớt đồn nhảm
    Lần sửa cuối bởi shinno, ngày 28-05-17 lúc 02:07 PM.
    Khách viếng thăm hãy cùng shinno xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  5. #5
    Thành Viên Dark.Hades's Avatar
    Ngày tham gia
    Apr 2014
    Đang ở
    cd /tmp/
    Bài viết
    646
    Thanks
    205
    Thanked 628 Times in 146 Posts

    Ðề: Lập team code auto game sạch+free

    Cay đắng ?? ??
    Bạn cho mình lí do nó có ích cho cộng đồng đi
    Còn về việc muốn vọc thì cái này nói thật chỉ dành cho cá nhân thôi bạn ạ.
    Khách viếng thăm hãy cùng Dark.Hades xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  6. #6
    Because I'm Stupid makute7413's Avatar
    Ngày tham gia
    Jan 2014
    Đang ở
    LA
    Bài viết
    1,232
    Thanks
    286
    Thanked 1,099 Times in 474 Posts

    Ðề: Lập team code auto game sạch+free

    Không chỉ trích nhưng auto đang làm nát tlbb hiện giờ.
    Khách viếng thăm hãy cùng makute7413 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  7. #7
    Thành Viên Tâm Huyết wermanhme1990's Avatar
    Ngày tham gia
    Apr 2008
    Bài viết
    1,594
    Thanks
    78
    Thanked 669 Times in 483 Posts

    Ðề: Lập team code auto game sạch+free

    viết auto game có nhiều tus hướng dẫn tiếng việt có, tiếng anh có, ngôn ngữ dùng thì tùy, thích thằng nào dùng thằng đó: c++, c#, autoit, delphi ..v.v
    read/write memory, xữ lý mouse keyboard .v.v.., rồi tùy game mà có cách can thiệp khi có anti.
    cái này mình không rành, chỉ nghe ông anh trong team bảo vậy nên biết vậy.
    Khách viếng thăm hãy cùng wermanhme1990 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  8. #8
    Thành Viên GameZone thienphuc86's Avatar
    Ngày tham gia
    Jul 2015
    Đang ở
    In the Hell
    Bài viết
    183
    Thanks
    55
    Thanked 21 Times in 20 Posts

    Ðề: Lập team code auto game sạch+free

    đối với bản thân mình thì thấy tùy theo từng mục đích sử dụng mà nó được cho là tốt hay xấu . Có thể với những người bận rộn chỉ có chút ít tgian giải trí thì nó có thể thực sự là tốt . Còn với các bạn có khá nhiều tgian đầu tư cho nhân vật game, Host của 1 game nào đó thì auto là một tai hại khá lớn . Theo mình thì mình không có tgian nên mình nghĩ rằng nó có ích , ví dụ TLBB khi train làm sao bạn có tgian ngồi canh để ăn x4 , rồi với sự hút máu của nhiều game thì không phải gamer nào cũng đủ mạnh để đứng train 1 mình, cho nên auto tự hồi máu thì vẫn tốt . và khi giới hạn giờ chơi tự reset thời gian cũng là quá tốt mà bạn . Mình chỉ muốn nghiên cứu và tạo ra 1 auto theo cách đơn giản là tự ăn vật phẩm như MP, HP , x2 x4 , reset giờ chơi đơn giản là vậy . Còn auto có keylog hay không thì mình đã là nạn nhân 2 lần vì ko có đủ tgian chăm sóc nhân vật nên mình mới tìm đến auto . các bạn cũng bận rôn nên cũng hiểu . nhưng chỉ là một bộ phận nào đó tham gia trục lợi mà bất chấp thôi . không phải hàu hết ai cũng vậy đâu . Còn về auto BUG or cheat thì không cần bàn cãi nữa . Mình chỉ mong được các bạn có kinh nghiệm hỗ trợ mình để làm một auto đơn gian vậy thôi . Nên mình vẫn ghi nhận ý kiến của các bạn và không buồn gì đâu . ^^
    Khách viếng thăm hãy cùng thienphuc86 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  9. #9
    Thành Viên Tâm Huyết wermanhme1990's Avatar
    Ngày tham gia
    Apr 2008
    Bài viết
    1,594
    Thanks
    78
    Thanked 669 Times in 483 Posts

    Ðề: Lập team code auto game sạch+free

    Bạn shinno share code autoit, nếu bạn thành thạo ngôn ngữ nào đó như c++ hoặc java có thể convert code đó qua java, c++, không thì học autoit rồi chỉnh sữa theo ý muốn. không được nữa thì thuê người viết.
    Khách viếng thăm hãy cùng wermanhme1990 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

 

 

Các Chủ đề tương tự

  1. [JX] Share code tích hợp auto nạp thẻ cào cho game
    Bởi hoangtucm trong diễn đàn Releases
    Trả lời: 6
    Bài viết cuối: 21-06-16, 11:09 AM
  2. gunny.pro.vn mở sever mới share 1000 code free nhận pet 55555 free
    Bởi thanhh92 trong diễn đàn CÁC SERVER GAME PRIVATE ONLINE
    Trả lời: 32
    Bài viết cuối: 23-03-15, 10:09 AM
  3. [JX] cần xin code auto backup của PTTk bác nào có code autoit đó share giúp thanks
    Bởi Olala trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 0
    Bài viết cuối: 18-10-14, 12:49 AM
  4. Xin code auto nạp thẻ game đao kiếm vô song
    Bởi DemonSlayer trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 6
    Bài viết cuối: 26-12-12, 09:32 PM

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •  
Múi giờ GMT +7. Bây giờ là 02:15 PM.
vBulletin®, Copyright ©2000-2011, Jelsoft Enterprises Ltd.
CLBGamesVN không chịu trách nhiệm về Luật Bản Quyền của các tài liệu, bài viết v.v...được đăng tải trên diễn đàn này.
Diễn đàn phát triển dưới sự đóng góp của tất cả thành viên. BQT chỉ là những người thành lập ra sân chơi, quản lý và duy trì về mặt kỹ thuật, nội dung khi hợp lệ.