IfEqual, A_IsUnicode,, ExitApp, DllCall("MessageBoxTimeoutA", "Ptr", 0 , "Str", "Unicode versions only!" , "Str", "Usage:" , "UInt", 262160 , "Int", 0 , "UInt", 1500) DetectHiddenWindows, On Run, % "hh.exe "A_WinDir "\Help\mui\0419_\ntcmds.chm::/dos_cmds.htm",, Hide, uPID Sleep, 300 MsgBox, % 262 . (IsObject(ret:=HTMLGetObject("ahk_pid "uPID " ahk_class HH Parent")) ? 208:160) , % IsObject(ret) ? "Result:":"Oops!" , % IsObject(ret) ? (ret.document.getElementsByTagName("title")[0].innerText, ret:="") . "" : "An error has occured!" Process, Close, % uPID ; http://l.autohotkey.net/docs/commands/ComObjQuery.htm ; http://www.autohotkey.com/board/topic/47052-basic-webpage-controls-with-javascript-com-tutorial HTMLGetObject(winTitle:="ahk_class IEFrame", instance:=1) { Static msg:=DllCall("RegisterWindowMessage", "Str", "WM_HTML_GETOBJECT", "UInt") , IID1:="{332C4425-26CB-11D0-B483-00C04FD90119}" ; IID_IHTMLDocument2 , IID2:="{0002DF05-0000-0000-C000-000000000046}" ; IID_IWebBrowserApp , VT_DISPATCH:=9 , F_OWNVALUE:=1 SendMessage, msg,,, % "Internet Explorer_Server"instance, % winTitle If % ErrorLevel!="FAIL" And (lResult:=ErrorLevel, VarSetCapacity(GUID, 16, 0)) If DllCall("ole32\CLSIDFromString", "Str", IID1 , "Ptr", &GUID , "UInt")=0 If DllCall("oleacc\ObjectFromLresult", "Ptr", lResult , "Ptr", &GUID , "Ptr", 0 , "Ptr*", pDoc , "UInt")=0 Return, ComObject(VT_DISPATCH, ComObjQuery(pDoc, IID2, IID2), F_OWNVALUE) , ObjRelease(pDoc) Return, ErrorLevel } |