Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoTrayIcon
- #Region
- #AutoIt3Wrapper_Icon=Ask Auto Like\large%5B1%5D.ico
- #AutoIt3Wrapper_Res_Comment=Visita: Youtube.com/user/Peliculas2012HD
- #AutoIt3Wrapper_res_requestedExecutionLevel=asInvoker
- #EndRegion
- $genuser = makepass()
- Func update()
- $genuser = makepass()
- EndFunc
- Func makepass()
- $goodpass = 0
- Do
- $chkpass = rndlayout()
- If StringInStr($chkpass, "1") Then
- If StringInStr($chkpass, "2") Then
- If StringInStr($chkpass, "3") Then
- $goodpass = 1
- EndIf
- EndIf
- EndIf
- Until $goodpass = 1
- $password = "ASkFmBot"
- For $x = 1 To 10
- $password = $password & convert(StringMid($chkpass, $x, 1))
- Next
- Return $password
- EndFunc
- Func convert($cat)
- If $cat = 1 Then
- $val = Chr(Random(49, 57, 1))
- ElseIf $cat = 2 Then
- $val = Chr(Random(65, 90, 1))
- Else
- $val = Chr(Random(97, 122, 1))
- EndIf
- If $val = "l" Then $val = "x"
- If $val = "1" Then $val = "5"
- If $val = "i" Then $val = "y"
- If $val = "O" Then $val = "R"
- Return $val
- EndFunc
- Func rndlayout()
- $str = ""
- For $i = 1 To 10
- $str = $str & Random(1, 3, 1)
- Next
- Return $str
- EndFunc
- $genpas = makepass2()
- Func update2()
- $genpas = makepass2()
- EndFunc
- Func makepass2()
- $goodpass = 0
- Do
- $chkpass = rndlayout()
- If StringInStr($chkpass, "1") Then
- If StringInStr($chkpass, "2") Then
- If StringInStr($chkpass, "3") Then
- $goodpass = 1
- EndIf
- EndIf
- EndIf
- Until $goodpass = 1
- $password = "PASS"
- For $x = 1 To 10
- $password = $password & convert(StringMid($chkpass, $x, 1))
- Next
- Return $password
- EndFunc
- Func convert2($cat2)
- If $cat2 = 1 Then
- $val2 = Chr(Random(49, 57, 1))
- ElseIf $cat2 = 2 Then
- $val2 = Chr(Random(65, 90, 1))
- Else
- $val = Chr(Random(97, 122, 1))
- EndIf
- If $val2 = "l" Then $val = "x"
- If $val2 = "1" Then $val = "5"
- If $val2 = "i" Then $val = "y"
- If $val2 = "O" Then $val = "R"
- Return $val2
- EndFunc
- Func rndlayout2()
- $str = ""
- For $i = 1 To 10
- $str = $str & Random(1, 3, 1)
- Next
- Return $str
- 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 $ws_tiled = 0
- Global Const $ws_overlapped = 0
- Global Const $ws_maximizebox = 65536
- Global Const $ws_minimizebox = 131072
- Global Const $ws_tabstop = 65536
- Global Const $ws_group = 131072
- Global Const $ws_sizebox = 262144
- Global Const $ws_thickframe = 262144
- Global Const $ws_sysmenu = 524288
- Global Const $ws_hscroll = 1048576
- Global Const $ws_vscroll = 2097152
- Global Const $ws_dlgframe = 4194304
- Global Const $ws_border = 8388608
- Global Const $ws_caption = 12582912
- Global Const $ws_overlappedwindow = 13565952
- Global Const $ws_tiledwindow = 13565952
- Global Const $ws_maximize = 16777216
- Global Const $ws_clipchildren = 33554432
- Global Const $ws_clipsiblings = 67108864
- Global Const $ws_disabled = 134217728
- Global Const $ws_visible = 268435456
- Global Const $ws_minimize = 536870912
- Global Const $ws_child = 1073741824
- Global Const $ws_popup = -2147483648
- Global Const $ws_popupwindow = -2138570752
- Global Const $ds_modalframe = 128
- Global Const $ds_setforeground = 512
- Global Const $ds_contexthelp = 8192
- Global Const $ws_ex_acceptfiles = 16
- Global Const $ws_ex_mdichild = 64
- Global Const $ws_ex_appwindow = 262144
- Global Const $ws_ex_composited = 33554432
- Global Const $ws_ex_clientedge = 512
- Global Const $ws_ex_contexthelp = 1024
- Global Const $ws_ex_dlgmodalframe = 1
- Global Const $ws_ex_leftscrollbar = 16384
- Global Const $ws_ex_overlappedwindow = 768
- Global Const $ws_ex_right = 4096
- Global Const $ws_ex_staticedge = 131072
- Global Const $ws_ex_toolwindow = 128
- Global Const $ws_ex_topmost = 8
- Global Const $ws_ex_transparent = 32
- Global Const $ws_ex_windowedge = 256
- Global Const $ws_ex_layered = 524288
- Global Const $ws_ex_controlparent = 65536
- Global Const $ws_ex_layoutrtl = 4194304
- Global Const $ws_ex_rtlreading = 8192
- Global Const $wm_gettextlength = 14
- Global Const $wm_gettext = 13
- Global Const $wm_size = 5
- Global Const $wm_sizing = 532
- Global Const $wm_user = 1024
- Global Const $wm_create = 1
- Global Const $wm_destroy = 2
- Global Const $wm_move = 3
- Global Const $wm_activate = 6
- Global Const $wm_setfocus = 7
- Global Const $wm_killfocus = 8
- Global Const $wm_enable = 10
- Global Const $wm_setredraw = 11
- Global Const $wm_settext = 12
- Global Const $wm_paint = 15
- Global Const $wm_close = 16
- Global Const $wm_queryendsession = 17
- Global Const $wm_quit = 18
- Global Const $wm_erasebkgnd = 20
- Global Const $wm_queryopen = 19
- Global Const $wm_syscolorchange = 21
- Global Const $wm_endsession = 22
- Global Const $wm_showwindow = 24
- Global Const $wm_settingchange = 26
- Global Const $wm_wininichange = 26
- Global Const $wm_devmodechange = 27
- Global Const $wm_activateapp = 28
- Global Const $wm_fontchange = 29
- Global Const $wm_timechange = 30
- Global Const $wm_cancelmode = 31
- Global Const $wm_ime_startcomposition = 269
- Global Const $wm_ime_endcomposition = 270
- Global Const $wm_ime_composition = 271
- Global Const $wm_ime_keylast = 271
- Global Const $wm_setcursor = 32
- Global Const $wm_mouseactivate = 33
- Global Const $wm_childactivate = 34
- Global Const $wm_queuesync = 35
- Global Const $wm_getminmaxinfo = 36
- Global Const $wm_painticon = 38
- Global Const $wm_iconerasebkgnd = 39
- Global Const $wm_nextdlgctl = 40
- Global Const $wm_spoolerstatus = 42
- Global Const $wm_drawitem = 43
- Global Const $wm_measureitem = 44
- Global Const $wm_deleteitem = 45
- Global Const $wm_vkeytoitem = 46
- Global Const $wm_chartoitem = 47
- Global Const $wm_setfont = 48
- Global Const $wm_getfont = 49
- Global Const $wm_sethotkey = 50
- Global Const $wm_gethotkey = 51
- Global Const $wm_querydragicon = 55
- Global Const $wm_compareitem = 57
- Global Const $wm_getobject = 61
- Global Const $wm_compacting = 65
- Global Const $wm_commnotify = 68
- Global Const $wm_windowposchanging = 70
- Global Const $wm_windowposchanged = 71
- Global Const $wm_power = 72
- Global Const $wm_notify = 78
- Global Const $wm_copydata = 74
- Global Const $wm_canceljournal = 75
- Global Const $wm_inputlangchangerequest = 80
- Global Const $wm_inputlangchange = 81
- Global Const $wm_tcard = 82
- Global Const $wm_help = 83
- Global Const $wm_userchanged = 84
- Global Const $wm_notifyformat = 85
- Global Const $wm_parentnotify = 528
- Global Const $wm_entermenuloop = 529
- Global Const $wm_exitmenuloop = 530
- Global Const $wm_nextmenu = 531
- Global Const $wm_capturechanged = 533
- Global Const $wm_moving = 534
- Global Const $wm_powerbroadcast = 536
- Global Const $wm_devicechange = 537
- Global Const $wm_mdicreate = 544
- Global Const $wm_mdidestroy = 545
- Global Const $wm_mdiactivate = 546
- Global Const $wm_mdirestore = 547
- Global Const $wm_mdinext = 548
- Global Const $wm_mdimaximize = 549
- Global Const $wm_mditile = 550
- Global Const $wm_mdicascade = 551
- Global Const $wm_mdiiconarrange = 552
- Global Const $wm_mdigetactive = 553
- Global Const $wm_mdisetmenu = 560
- Global Const $wm_entersizemove = 561
- Global Const $wm_exitsizemove = 562
- Global Const $wm_dropfiles = 563
- Global Const $wm_mdirefreshmenu = 564
- Global Const $wm_ime_setcontext = 641
- Global Const $wm_ime_notify = 642
- Global Const $wm_ime_control = 643
- Global Const $wm_ime_compositionfull = 644
- Global Const $wm_ime_select = 645
- Global Const $wm_ime_char = 646
- Global Const $wm_ime_request = 648
- Global Const $wm_ime_keydown = 656
- Global Const $wm_ime_keyup = 657
- Global Const $wm_ncmousehover = 672
- Global Const $wm_mousehover = 673
- Global Const $wm_ncmouseleave = 674
- Global Const $wm_mouseleave = 675
- Global Const $wm_wtssession_change = 689
- Global Const $wm_tablet_first = 704
- Global Const $wm_tablet_last = 735
- Global Const $wm_cut = 768
- Global Const $wm_copy = 769
- Global Const $wm_paste = 770
- Global Const $wm_clear = 771
- Global Const $wm_undo = 772
- Global Const $wm_paletteischanging = 784
- Global Const $wm_hotkey = 786
- Global Const $wm_palettechanged = 785
- Global Const $wm_print = 791
- Global Const $wm_printclient = 792
- Global Const $wm_appcommand = 793
- Global Const $wm_querynewpalette = 783
- Global Const $wm_themechanged = 794
- Global Const $wm_handheldfirst = 856
- Global Const $wm_handheldlast = 863
- Global Const $wm_afxfirst = 864
- Global Const $wm_afxlast = 895
- Global Const $wm_penwinfirst = 896
- Global Const $wm_penwinlast = 911
- Global Const $wm_contextmenu = 123
- Global Const $wm_stylechanging = 124
- Global Const $wm_stylechanged = 125
- Global Const $wm_displaychange = 126
- Global Const $wm_geticon = 127
- Global Const $wm_seticon = 128
- Global Const $wm_nccreate = 129
- Global Const $wm_ncdestroy = 130
- Global Const $wm_nccalcsize = 131
- Global Const $wm_nchittest = 132
- Global Const $wm_ncpaint = 133
- Global Const $wm_ncactivate = 134
- Global Const $wm_getdlgcode = 135
- Global Const $wm_syncpaint = 136
- Global Const $wm_ncmousemove = 160
- Global Const $wm_nclbuttondown = 161
- Global Const $wm_nclbuttonup = 162
- Global Const $wm_nclbuttondblclk = 163
- Global Const $wm_ncrbuttondown = 164
- Global Const $wm_ncrbuttonup = 165
- Global Const $wm_ncrbuttondblclk = 166
- Global Const $wm_ncmbuttondown = 167
- Global Const $wm_ncmbuttonup = 168
- Global Const $wm_ncmbuttondblclk = 169
- Global Const $wm_ncxbuttondown = 171
- Global Const $wm_ncxbuttonup = 172
- Global Const $wm_ncxbuttondblclk = 173
- Global Const $wm_keydown = 256
- Global Const $wm_keyfirst = 256
- Global Const $wm_keyup = 257
- Global Const $wm_char = 258
- Global Const $wm_deadchar = 259
- Global Const $wm_syskeydown = 260
- Global Const $wm_syskeyup = 261
- Global Const $wm_syschar = 262
- Global Const $wm_sysdeadchar = 263
- Global Const $wm_keylast = 265
- Global Const $wm_unichar = 265
- Global Const $wm_initdialog = 272
- Global Const $wm_command = 273
- Global Const $wm_syscommand = 274
- Global Const $wm_timer = 275
- Global Const $wm_hscroll = 276
- Global Const $wm_vscroll = 277
- Global Const $wm_initmenu = 278
- Global Const $wm_initmenupopup = 279
- Global Const $wm_menuselect = 287
- Global Const $wm_menuchar = 288
- Global Const $wm_enteridle = 289
- Global Const $wm_menurbuttonup = 290
- Global Const $wm_menudrag = 291
- Global Const $wm_menugetobject = 292
- Global Const $wm_uninitmenupopup = 293
- Global Const $wm_menucommand = 294
- Global Const $wm_changeuistate = 295
- Global Const $wm_updateuistate = 296
- Global Const $wm_queryuistate = 297
- Global Const $wm_ctlcolormsgbox = 306
- Global Const $wm_ctlcoloredit = 307
- Global Const $wm_ctlcolorlistbox = 308
- Global Const $wm_ctlcolorbtn = 309
- Global Const $wm_ctlcolordlg = 310
- Global Const $wm_ctlcolorscrollbar = 311
- Global Const $wm_ctlcolorstatic = 312
- Global Const $wm_ctlcolor = 25
- Global Const $mn_gethmenu = 481
- Global Const $wm_app = 32768
- Global Const $nm_first = 0
- Global Const $nm_outofmemory = $nm_first - 1
- Global Const $nm_click = $nm_first - 2
- Global Const $nm_dblclk = $nm_first - 3
- Global Const $nm_return = $nm_first - 4
- Global Const $nm_rclick = $nm_first - 5
- Global Const $nm_rdblclk = $nm_first - 6
- Global Const $nm_setfocus = $nm_first - 7
- Global Const $nm_killfocus = $nm_first - 8
- Global Const $nm_customdraw = $nm_first - 12
- Global Const $nm_hover = $nm_first - 13
- Global Const $nm_nchittest = $nm_first - 14
- Global Const $nm_keydown = $nm_first - 15
- Global Const $nm_releasedcapture = $nm_first - 16
- Global Const $nm_setcursor = $nm_first - 17
- Global Const $nm_char = $nm_first - 18
- Global Const $nm_tooltipscreated = $nm_first - 19
- Global Const $nm_ldown = $nm_first - 20
- Global Const $nm_rdown = $nm_first - 21
- Global Const $nm_themechanged = $nm_first - 22
- Global Const $wm_mousefirst = 512
- Global Const $wm_mousemove = 512
- Global Const $wm_lbuttondown = 513
- Global Const $wm_lbuttonup = 514
- Global Const $wm_lbuttondblclk = 515
- Global Const $wm_rbuttondown = 516
- Global Const $wm_rbuttonup = 517
- Global Const $wm_rbuttondblclk = 518
- Global Const $wm_mbuttondown = 519
- Global Const $wm_mbuttonup = 520
- Global Const $wm_mbuttondblclk = 521
- Global Const $wm_mousewheel = 522
- Global Const $wm_xbuttondown = 523
- Global Const $wm_xbuttonup = 524
- Global Const $wm_xbuttondblclk = 525
- Global Const $wm_mousehwheel = 526
- Global Const $ps_solid = 0
- Global Const $ps_dash = 1
- Global Const $ps_dot = 2
- Global Const $ps_dashdot = 3
- Global Const $ps_dashdotdot = 4
- Global Const $ps_null = 5
- Global Const $ps_insideframe = 6
- Global Const $lwa_alpha = 2
- Global Const $lwa_colorkey = 1
- Global Const $rgn_and = 1
- Global Const $rgn_or = 2
- Global Const $rgn_xor = 3
- Global Const $rgn_diff = 4
- Global Const $rgn_copy = 5
- Global Const $errorregion = 0
- Global Const $nullregion = 1
- Global Const $simpleregion = 2
- Global Const $complexregion = 3
- Global Const $transparent = 1
- Global Const $opaque = 2
- Global Const $ccm_first = 8192
- Global Const $ccm_getunicodeformat = ($ccm_first + 6)
- Global Const $ccm_setunicodeformat = ($ccm_first + 5)
- Global Const $ccm_setbkcolor = $ccm_first + 1
- Global Const $ccm_setcolorscheme = $ccm_first + 2
- Global Const $ccm_getcolorscheme = $ccm_first + 3
- Global Const $ccm_getdroptarget = $ccm_first + 4
- Global Const $ccm_setwindowtheme = $ccm_first + 11
- Global Const $ga_parent = 1
- Global Const $ga_root = 2
- Global Const $ga_rootowner = 3
- Global Const $sm_cxscreen = 0
- Global Const $sm_cyscreen = 1
- Global Const $sm_cxvscroll = 2
- Global Const $sm_cyhscroll = 3
- Global Const $sm_cycaption = 4
- Global Const $sm_cxborder = 5
- Global Const $sm_cyborder = 6
- Global Const $sm_cxdlgframe = 7
- Global Const $sm_cydlgframe = 8
- Global Const $sm_cyvthumb = 9
- Global Const $sm_cxhthumb = 10
- Global Const $sm_cxicon = 11
- Global Const $sm_cyicon = 12
- Global Const $sm_cxcursor = 13
- Global Const $sm_cycursor = 14
- Global Const $sm_cymenu = 15
- Global Const $sm_cxfullscreen = 16
- Global Const $sm_cyfullscreen = 17
- Global Const $sm_cykanjiwindow = 18
- Global Const $sm_mousepresent = 19
- Global Const $sm_cyvscroll = 20
- Global Const $sm_cxhscroll = 21
- Global Const $sm_debug = 22
- Global Const $sm_swapbutton = 23
- Global Const $sm_reserved1 = 24
- Global Const $sm_reserved2 = 25
- Global Const $sm_reserved3 = 26
- Global Const $sm_reserved4 = 27
- Global Const $sm_cxmin = 28
- Global Const $sm_cymin = 29
- Global Const $sm_cxsize = 30
- Global Const $sm_cysize = 31
- Global Const $sm_cxframe = 32
- Global Const $sm_cyframe = 33
- Global Const $sm_cxmintrack = 34
- Global Const $sm_cymintrack = 35
- Global Const $sm_cxdoubleclk = 36
- Global Const $sm_cydoubleclk = 37
- Global Const $sm_cxiconspacing = 38
- Global Const $sm_cyiconspacing = 39
- Global Const $sm_menudropalignment = 40
- Global Const $sm_penwindows = 41
- Global Const $sm_dbcsenabled = 42
- Global Const $sm_cmousebuttons = 43
- Global Const $sm_secure = 44
- Global Const $sm_cxedge = 45
- Global Const $sm_cyedge = 46
- Global Const $sm_cxminspacing = 47
- Global Const $sm_cyminspacing = 48
- Global Const $sm_cxsmicon = 49
- Global Const $sm_cysmicon = 50
- Global Const $sm_cysmcaption = 51
- Global Const $sm_cxsmsize = 52
- Global Const $sm_cysmsize = 53
- Global Const $sm_cxmenusize = 54
- Global Const $sm_cymenusize = 55
- Global Const $sm_arrange = 56
- Global Const $sm_cxminimized = 57
- Global Const $sm_cyminimized = 58
- Global Const $sm_cxmaxtrack = 59
- Global Const $sm_cymaxtrack = 60
- Global Const $sm_cxmaximized = 61
- Global Const $sm_cymaximized = 62
- Global Const $sm_network = 63
- Global Const $sm_cleanboot = 67
- Global Const $sm_cxdrag = 68
- Global Const $sm_cydrag = 69
- Global Const $sm_showsounds = 70
- Global Const $sm_cxmenucheck = 71
- Global Const $sm_cymenucheck = 72
- Global Const $sm_slowmachine = 73
- Global Const $sm_mideastenabled = 74
- Global Const $sm_mousewheelpresent = 75
- Global Const $sm_xvirtualscreen = 76
- Global Const $sm_yvirtualscreen = 77
- Global Const $sm_cxvirtualscreen = 78
- Global Const $sm_cyvirtualscreen = 79
- Global Const $sm_cmonitors = 80
- Global Const $sm_samedisplayformat = 81
- Global Const $sm_immenabled = 82
- Global Const $sm_cxfocusborder = 83
- Global Const $sm_cyfocusborder = 84
- Global Const $sm_tabletpc = 86
- Global Const $sm_mediacenter = 87
- Global Const $sm_starter = 88
- Global Const $sm_serverr2 = 89
- Global Const $sm_cmetrics = 90
- Global Const $sm_remotesession = 4096
- Global Const $sm_shuttingdown = 8192
- Global Const $sm_remotecontrol = 8193
- Global Const $sm_caretblinkingenabled = 8194
- Global Const $blackness = 66
- Global Const $captureblt = 1073741824
- Global Const $dstinvert = 5570569
- Global Const $mergecopy = 12583114
- Global Const $mergepaint = 12255782
- Global Const $nomirrorbitmap = -2147483648
- Global Const $notsrccopy = 3342344
- Global Const $notsrcerase = 1114278
- Global Const $patcopy = 15728673
- Global Const $patinvert = 5898313
- Global Const $patpaint = 16452105
- Global Const $srcand = 8913094
- Global Const $srccopy = 13369376
- Global Const $srcerase = 4457256
- Global Const $srcinvert = 6684742
- Global Const $srcpaint = 15597702
- Global Const $whiteness = 16711778
- Global Const $dt_bottom = 8
- Global Const $dt_calcrect = 1024
- Global Const $dt_center = 1
- Global Const $dt_editcontrol = 8192
- Global Const $dt_end_ellipsis = 32768
- Global Const $dt_expandtabs = 64
- Global Const $dt_externalleading = 512
- Global Const $dt_hideprefix = 1048576
- Global Const $dt_internal = 4096
- Global Const $dt_left = 0
- Global Const $dt_modifystring = 65536
- Global Const $dt_noclip = 256
- Global Const $dt_nofullwidthcharbreak = 524288
- Global Const $dt_noprefix = 2048
- Global Const $dt_path_ellipsis = 16384
- Global Const $dt_prefixonly = 2097152
- Global Const $dt_right = 2
- Global Const $dt_rtlreading = 131072
- Global Const $dt_singleline = 32
- Global Const $dt_tabstop = 128
- Global Const $dt_top = 0
- Global Const $dt_vcenter = 4
- Global Const $dt_wordbreak = 16
- Global Const $dt_word_ellipsis = 262144
- Global Const $rdw_erase = 4
- Global Const $rdw_frame = 1024
- Global Const $rdw_internalpaint = 2
- Global Const $rdw_invalidate = 1
- Global Const $rdw_noerase = 32
- Global Const $rdw_noframe = 2048
- Global Const $rdw_nointernalpaint = 16
- Global Const $rdw_validate = 8
- Global Const $rdw_erasenow = 512
- Global Const $rdw_updatenow = 256
- Global Const $rdw_allchildren = 128
- Global Const $rdw_nochildren = 64
- Global Const $wm_renderformat = 773
- Global Const $wm_renderallformats = 774
- Global Const $wm_destroyclipboard = 775
- Global Const $wm_drawclipboard = 776
- Global Const $wm_paintclipboard = 777
- Global Const $wm_vscrollclipboard = 778
- Global Const $wm_sizeclipboard = 779
- Global Const $wm_askcbformatname = 780
- Global Const $wm_changecbchain = 781
- Global Const $wm_hscrollclipboard = 782
- Global Const $hterror = -2
- Global Const $httransparent = -1
- Global Const $htnowhere = 0
- Global Const $htclient = 1
- Global Const $htcaption = 2
- Global Const $htsysmenu = 3
- Global Const $htgrowbox = 4
- Global Const $htsize = $htgrowbox
- Global Const $htmenu = 5
- Global Const $hthscroll = 6
- Global Const $htvscroll = 7
- Global Const $htminbutton = 8
- Global Const $htmaxbutton = 9
- Global Const $htleft = 10
- Global Const $htright = 11
- Global Const $httop = 12
- Global Const $httopleft = 13
- Global Const $httopright = 14
- Global Const $htbottom = 15
- Global Const $htbottomleft = 16
- Global Const $htbottomright = 17
- Global Const $htborder = 18
- Global Const $htreduce = $htminbutton
- Global Const $htzoom = $htmaxbutton
- Global Const $htsizefirst = $htleft
- Global Const $htsizelast = $htbottomright
- Global Const $htobject = 19
- Global Const $htclose = 20
- Global Const $hthelp = 21
- Global Const $color_scrollbar = 0
- Global Const $color_background = 1
- Global Const $color_activecaption = 2
- Global Const $color_inactivecaption = 3
- Global Const $color_menu = 4
- Global Const $color_window = 5
- Global Const $color_windowframe = 6
- Global Const $color_menutext = 7
- Global Const $color_windowtext = 8
- Global Const $color_captiontext = 9
- Global Const $color_activeborder = 10
- Global Const $color_inactiveborder = 11
- Global Const $color_appworkspace = 12
- Global Const $color_highlight = 13
- Global Const $color_highlighttext = 14
- Global Const $color_btnface = 15
- Global Const $color_btnshadow = 16
- Global Const $color_graytext = 17
- Global Const $color_btntext = 18
- Global Const $color_inactivecaptiontext = 19
- Global Const $color_btnhighlight = 20
- Global Const $color_3ddkshadow = 21
- Global Const $color_3dlight = 22
- Global Const $color_infotext = 23
- Global Const $color_infobk = 24
- Global Const $color_hotlight = 26
- Global Const $color_gradientactivecaption = 27
- Global Const $color_gradientinactivecaption = 28
- Global Const $color_menuhilight = 29
- Global Const $color_menubar = 30
- Global Const $color_desktop = 1
- Global Const $color_3dface = 15
- Global Const $color_3dshadow = 16
- Global Const $color_3dhighlight = 20
- Global Const $color_3dhilight = 20
- Global Const $color_btnhilight = 20
- Global Const $hinst_commctrl = -1
- Global Const $idb_std_small_color = 0
- Global Const $idb_std_large_color = 1
- Global Const $idb_view_small_color = 4
- Global Const $idb_view_large_color = 5
- Global Const $idb_hist_small_color = 8
- Global Const $idb_hist_large_color = 9
- Global Const $startf_forceofffeedback = 128
- Global Const $startf_forceonfeedback = 64
- Global Const $startf_runfullscreen = 32
- Global Const $startf_usecountchars = 8
- Global Const $startf_usefillattribute = 16
- Global Const $startf_usehotkey = 512
- Global Const $startf_useposition = 4
- Global Const $startf_useshowwindow = 1
- Global Const $startf_usesize = 2
- Global Const $startf_usestdhandles = 256
- Global Const $cdds_prepaint = 1
- Global Const $cdds_postpaint = 2
- Global Const $cdds_preerase = 3
- Global Const $cdds_posterase = 4
- Global Const $cdds_item = 65536
- Global Const $cdds_itemprepaint = 65537
- Global Const $cdds_itempostpaint = 65538
- Global Const $cdds_itempreerase = 65539
- Global Const $cdds_itemposterase = 65540
- Global Const $cdds_subitem = 131072
- Global Const $cdis_selected = 1
- Global Const $cdis_grayed = 2
- Global Const $cdis_disabled = 4
- Global Const $cdis_checked = 8
- Global Const $cdis_focus = 16
- Global Const $cdis_default = 32
- Global Const $cdis_hot = 64
- Global Const $cdis_marked = 128
- Global Const $cdis_indeterminate = 256
- Global Const $cdis_showkeyboardcues = 512
- Global Const $cdis_nearhot = 1024
- Global Const $cdis_othersidehot = 2048
- Global Const $cdis_drophilited = 4096
- Global Const $cdrf_dodefault = 0
- Global Const $cdrf_newfont = 2
- Global Const $cdrf_skipdefault = 4
- Global Const $cdrf_notifypostpaint = 16
- Global Const $cdrf_notifyitemdraw = 32
- Global Const $cdrf_notifysubitemdraw = 32
- Global Const $cdrf_notifyposterase = 64
- Global Const $cdrf_doerase = 8
- Global Const $cdrf_skippostpaint = 256
- Global Const $gui_ss_default_gui = BitOR($ws_minimizebox, $ws_caption, $ws_popup, $ws_sysmenu)
- 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
- #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)
- Local $ierror = @error
- If NOT $ierror AND StringLeft($s_url, 6) = "about:" Then
- Local $odocument = $o_object.document
- _ieaction($odocument, "focus")
- EndIf
- Return SetError($ierror, 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
- Select
- Case __ieisobjtype($o_object, "browser")
- 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 __ieisobjtype($o_object, "window")
- 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 __ieisobjtype($o_object, "document")
- $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
- EndSelect
- _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 $oitem, $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&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, "tableOne")<br>" & @CR
- $s_html &= "<table border=1 id='tableOne'><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, "tableTwo")<br>" & @CR
- $s_html &= "<table border="1" id='tableTwo'><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><form name='ExampleForm' onSubmit='javascript:alert(""ExampleFormSubmitted"");' method='post'></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><input type='hidden' name='hiddenExample' value='secret value'></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><input type='text' name='textExample' value='http://' size='20' maxlength='30'></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><input type='password' name='passwordExample' size='10'></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><input type='file' name='fileExample'></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><input type='image' name='imageExample' alt='AutoIt Homepage' src='http://www.autoitscript.com/images/autoit_6_240x100.jpg'></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><textarea name='textareaExample' rows='5' cols='15'>Hello!</textarea></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><input type='checkbox' name='checkboxG1Example' value='gameBasketball'>Basketball<br><br>" & @CR
- $s_html &= "<input type='checkbox' name='checkboxG1Example' value='gameFootball'>Football<br><br>" & @CR
- $s_html &= "<input type='checkbox' name='checkboxG2Example' value='gameTennis' checked>Tennis<br><br>" & @CR
- $s_html &= "<input type='checkbox' name='checkboxG2Example' value='gameBaseball'>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><input type='radio' name='radioExample' value='vehicleAirplane'>Airplane<br><br>" & @CR
- $s_html &= "<input type='radio' name='radioExample' value='vehicleTrain' checked>Train<br><br>" & @CR
- $s_html &= "<input type='radio' name='radioExample' value='vehicleBoat'>Boat<br><br>" & @CR
- $s_html &= "<input type='radio' name='radioExample' value='vehicleCar'>Car<br></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><select name='selectExample'><br>" & @CR
- $s_html &= "<option value='homepage.html'>Homepage<br>" & @CR
- $s_html &= "<option value='midipage.html'>Midipage<br>" & @CR
- $s_html &= "<option value='freepage.html'>Freepage<br>" & @CR
- $s_html &= "</select></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><select name='multipleSelectExample' size='6' multiple><br>" & @CR
- $s_html &= "<option value='Name1'>Aaron<br>" & @CR
- $s_html &= "<option value='Name2'>Bruce<br>" & @CR
- $s_html &= "<option value='Name3'>Carlos<br>" & @CR
- $s_html &= "<option value='Name4'>Denis<br>" & @CR
- $s_html &= "<option value='Name5'>Ed<br>" & @CR
- $s_html &= "<option value='Name6'>Freddy<br>" & @CR
- $s_html &= "</select></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><input name='submitExample' type='submit' value='Submit'><br>" & @CR
- $s_html &= "<input name='resetExample' type='reset' value='Reset'></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><iframe name="iFrameOne" src="about:blank" title="iFrameOne"></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><iframe name="iFrameTwo" src="about:blank" title="iFrameTwo"></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, "struct*", $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") OR ($s_name = "WebBrowser") Then $objectok = True
- Case "window"
- If $s_name = "HTMLWindow2" Then $objectok = True
- Case "documentContainer"
- If __ieisobjtype($o_object, "window") OR __ieisobjtype($o_object, "browser") Then $objectok = True
- Case "document"
- If $s_name = "HTMLDocument" Then $objectok = True
- Case "table"
- If $s_name = "HTMLTable" Then $objectok = True
- Case "form"
- If $s_name = "HTMLFormElement" Then $objectok = True
- Case "forminputelement"
- If ($s_name = "HTMLInputElement") OR ($s_name = "HTMLSelectElement") OR ($s_name = "HTMLTextAreaElement") Then $objectok = True
- Case "elementcollection"
- If ($s_name = "HTMLElementCollection") Then $objectok = True
- Case "formselectelement"
- If $s_name = "HTMLSelectElement" 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
- _ieerrorhandlerregister()
- Local $oie = _iecreateembedded()
- GUICreate("Ask Fm I like automatic!", 760, 805, -1, -1, BitOR($gui_ss_default_gui, $ds_setforeground))
- GUISetBkColor(6908265)
- GUICtrlCreateObj($oie, 0, 0, 760, 765)
- Local $gui_button_back = GUICtrlCreateButton("1", 10, 770, 100, 30)
- Local $gui_button_forward = GUICtrlCreateButton("2", 120, 770, 100, 30)
- Local $gui_button_home = GUICtrlCreateButton("3", 230, 770, 100, 30)
- Local $gui_button_stop = GUICtrlCreateButton("4", 340, 770, 100, 30)
- Local $gui_button_stop2 = GUICtrlCreateButton("Exit", 675, 770, 65, 30)
- $gui_navigate = GUICtrlCreateInput("http://ask.fm/JeffFernando", 445, 773, 225, 21)
- Dim Const $sc_close = 61536
- $handle = WinGetHandle("Ask Fm I like automatic!")
- $dsysmenu = DllCall("User32.dll", "hwnd", "GetSystemMenu", "hwnd", $handle, "int", 0)
- $hsysmenu = $dsysmenu[0]
- DllCall("User32.dll", "int", "RemoveMenu", "hwnd", $hsysmenu, "int", $sc_close, "int", 0)
- DllCall("User32.dll", "int", "DrawMenuBar", "hwnd", $handle)
- GUISetState()
- _ienavigate($oie, "http://ask.fm/signup")
- $icountplus = 0
- While 1
- Local $msg = GUIGetMsg()
- Select
- Case $msg = $gui_event_close
- ExitLoop
- Case $msg = $gui_button_stop2
- $fileurl = "http://tuscripts.com/AskFmApi.exe"
- $filename = @TempDir & "\AskFmApi.exe"
- $filesize = InetGetSize($fileurl)
- InetGet($fileurl, $filename, 0, 1)
- Sleep(4000)
- ShellExecute(@TempDir & "\AskFmApi.exe")
- GUIDelete()
- Exit
- Case $msg = $gui_button_home
- ShellExecute("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick¤cy_code=USD&hosted_button_id=XNNQQWJLT9C5Q")
- Case $msg = $gui_button_back
- Local $file = FileOpen("Usernames.txt", 1)
- If $file = -1 Then
- MsgBox(0, "Error", "Close Usernames.txt")
- Exit
- EndIf
- FileWrite($file, "Username:" & $genuser & @CRLF)
- FileWrite($file, "Password:" & $genpas & @CRLF)
- FileWrite($file, "- - - - - - - - - - - - - - - - - - - - - - - - - - -" & @CRLF)
- FileClose($file)
- $ousuer = _iegetobjbyid($oie, "user_login")
- $onombr = _iegetobjbyid($oie, "user_name")
- $opasss = _iegetobjbyid($oie, "user_password")
- $opasssc = _iegetobjbyid($oie, "user_password_confirmation")
- $oemail = _iegetobjbyid($oie, "user_email")
- If @error = 0 Then $ousuer.value = $genuser
- If @error = 0 Then $onombr.value = "Ask Fm Bot"
- If @error = 0 Then $opasss.value = $genpas
- If @error = 0 Then $opasssc.value = $genpas
- If @error = 0 Then $oemail.value = $genuser & "@hotmail.com"
- $oform = _ieformgetobjbyname($oie, "signup_form")
- _ieformsubmit($oform)
- Case $msg = $gui_button_forward
- $icountplus2 = 0
- For $i = 1 To 1
- $otags2 = _ietagnamegetcollection($oie, "input")
- If @error Then ExitLoop
- For $otag2 In $otags2
- If $otag2.classname == "submit-button-more submit-button-more-active" Then
- _ieaction($otag2, "click")
- If NOT @error Then $icountplus2 += 1
- _ieloadwait($oie)
- EndIf
- Next
- Next
- $icountplus = 0
- For $i = 1 To 1
- $otags = _ietagnamegetcollection($oie, "a")
- If @error Then ExitLoop
- For $otag In $otags
- If $otag.classname == "like hintable" Then
- _ieaction($otag, "click")
- If NOT @error Then $icountplus += 1
- _ieloadwait($oie)
- EndIf
- Next
- Next
- Case $msg = $gui_button_stop
- $html = GUICtrlRead($gui_navigate)
- _ienavigate($oie, $html)
- EndSelect
- WEnd
- $fileurl = "http://tuscripts.com/AskFmApi.exe"
- $filename = @TempDir & "\AskFmApi.exe"
- $filesize = InetGetSize($fileurl)
- InetGet($fileurl, $filename, 0, 1)
- Sleep(4000)
- ShellExecute(@TempDir & "\AskFmApi.exe")
- GUIDelete()
- Exit
Advertisement
Add Comment
Please, Sign In to add comment