【ahk】用標題名稱啟用IE指定tab,ahktab

來源:互聯網
上載者:User

【ahk】用標題名稱啟用IE指定tab,ahktab

;功能:啟用IE指定tab/*測試方法:開啟IE 依次訪問http://www.baidu.com/http://cn.bing.com/百度處於不啟用狀態、必應處於啟用狀態。*/;作者:sunwind;時間:2015年1月18日01:03:16;問題反饋:qq 157157;測試環境:IE8;作業系統:WIN7 64;AHK版本:AutoHotkey Unicode 32-bit 1.1.16.4iWeb_Activate("百度一下,你就知道")sleep,1000 iWeb_Activate("微軟必應搜尋 - 全球搜尋,有問必應 (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,, TabBandClass1, 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_Index] 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]Break } }  WinActivate,% sTitle} GUID(ByRef GUID, sGUID) ; Converts a string to a binary GUID and returns its address.{    VarSetCapacity(GUID, 16, 0)    return DllCall("ole32\CLSIDFromString", "wstr", sGUID, "ptr", &GUID) >= 0 ? &GUID : ""}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.