; function: Activate IE to specify tab/* test method: open IE in order to access http://www.baidu.com/http://cn.bing.com/Baidu is inactive, Bing is in the active state. */;sunwind; Time: January 18, 2015 01:03:16; problem feedback: QQ 157157; test environment: IE8; operating system: WIN7 64; Ahk version: AutoHotkey Unicode 32-bit 1.1.16.4iweb_activate ("Baidu a bit, you Know") sleep,1000 iweb_activate ("Microsoft Bing Search-Global search, Ask Bing" ") Returniweb_activate (stitle) {; Thanks Sean; http://www.autohotkey.com/forum/viewtopic.php?p=231093#231093 Dllcall ("LoadLibrary", "str", "Oleacc.dll") Detecthiddenwindows, ON, ~ winactivate,% "ahk_id" hwnd;~ winwaitactive,% "ahk_id" Hwnd,,5controlget, HTabBand, HWND,, Ta BBandClass1, Ahk_class ieframecontrolget, Htabui, HWnd, DirectUIHWND1, ahk_id%htabband% If htabui && Dllcall ("Oleacc\accessibleobjectfromwindow", "uint", Htabui, "uint", -4, "uint", GUID (Iid_iaccessible, "{ 618736E0-3C3D-11CF-810C-00AA00389B71} ")," UINTP ", Pacc) =0 {Loop,% pacc.accchildcount If paccchild:=pacc.accchild[a_i Ndex] if paccchild.accrole[0] = 0x3C {pacctab:=paccchild break}} If pacc:=pacctab {Loop,% pacc.acCchildcount if Paccchild:=pacc.accchild[a_index] if paccchild.accname[0] = stitle {paccchild.accdodefaultaction[0]b Reak}} winactivate,% Stitle} GUID (ByRef GUID, sguid); Converts a string to a binary GUID and returns its address. {varsetcapacity (GUID, 0) return Dllcall ("ole32\clsidfromstring", "Wstr", Sguid, "ptr", &guid) >= 0? &am P GUID: ""}
"Ahk" activates IE with title name to specify tab