Created
April 27, 2012 05:22
-
-
Save jethrow/2506120 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wb := WBGet() | |
MsgBox % wb.document.documentElement.innerHTML | |
WBGet(WinTitle="ahk_class IEFrame", Svr#=1) { ; based on ComObjQuery docs | |
static msg := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT") | |
, IID := "{332C4427-26CB-11D0-B483-00C04FD90119}" ; IID_IWebBrowserApp | |
SendMessage msg, 0, 0, Internet Explorer_Server%Svr#%, %WinTitle% | |
if (ErrorLevel != "FAIL") { | |
lResult:=ErrorLevel, VarSetCapacity(GUID,16,0) | |
if DllCall("ole32\CLSIDFromString", "wstr","{332C4425-26CB-11D0-B483-00C04FD90119}", "ptr",&GUID) >= 0 { | |
DllCall("oleacc\ObjectFromLresult", "ptr",lResult, "ptr",&GUID, "ptr",0, "ptr*",pdoc) | |
return ComObj(9,ComObjQuery(pdoc,IID,IID),1), ObjRelease(pdoc) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment