 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Astrognaw
Joined: 27 Mar 2009 Posts: 26
|
Posted: Sat Aug 22, 2009 1:23 pm Post subject: Question on COM/DOM access/manipulation |
|
|
Hello,
I'm trying to access the DOM of a "module" within a browser so i can use COM functions to manipulate it (clicking buttons and so forth, hell, just seeing that it exists would be a start). It's a javascript-coded window that pops up within the browser without its own hwnd, but with separate source code. I need a pwb for the module within the browser within the application (IE for now). It asks for options that I'm currently using mouse clicks for. This is probably vague, let me know if you need further information!
Also, if anyone knows how to access the filepaths for temporary internet files that might be helpful for FileRead.
Thanks for anything and everything! |
|
| Back to top |
|
 |
jethrow
Joined: 24 May 2009 Posts: 1907 Location: Iowa, USA
|
Posted: Sat Aug 22, 2009 5:47 pm Post subject: |
|
|
What do you mean by a "module" within a browser? Can you provide an example? Is it a separate window, like a pop-up confirmation box? Is it like a new frame that is generated within the webpage? _________________
- in case I forgot to smile
Basic Webpage Controls
COM Object Reference |
|
| Back to top |
|
 |
Astrognaw
Joined: 27 Mar 2009 Posts: 26
|
Posted: Sat Aug 22, 2009 8:34 pm Post subject: |
|
|
| Precisely a frame, yes. I should've said that. I'll search about for a proper example. Thanks! |
|
| Back to top |
|
 |
Astrognaw
Joined: 27 Mar 2009 Posts: 26
|
Posted: Thu Sep 03, 2009 5:00 pm Post subject: |
|
|
I know I made this post awhile ago but I figured out how to do it (for some things):
| Code: | #include COM.ahk
#include GetWebBrowser.ahk
COM_Init()
^f12::
COM_Init()
pwb := GetWebBrowser()
pwbHtml := COM_Invoke(pwb,"document.documentelement.outerHTML")
pwbframe0 := COM_Invoke(pwb,"document.frames.item[0]")
frame0Html := COM_Invoke(pwbframe0,"document.documentelement.outerHTML")
pwbframe1 := COM_Invoke(pwb,"document.frames.item[1]")
frame1Html := COM_Invoke(pwbframe1,"document.documentelement.outerHTML")
COM_Term()
return
|
(Sean's GetWebBrowser)
| Code: |
GetWebBrowser() ; written by Sean
{
ControlGet, hIESvr, hWnd, , Internet Explorer_Server1, ahk_class IEFrame
If Not hIESvr
Return
DllCall("SendMessageTimeout", "Uint", hIESvr, "Uint", DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT"), "Uint", 0, "Uint", 0, "Uint", 2, "Uint", 1000, "UintP", lResult)
DllCall("oleacc\ObjectFromLresult", "Uint", lResult, "Uint", COM_GUID4String(IID_IHTMLDocument2,"{332C4425-26CB-11D0-B483-00C04FD90119}"), "int", 0, "UintP", pdoc)
IID_IWebBrowserApp := "{0002DF05-0000-0000-C000-000000000046}"
pweb := COM_QueryService(pdoc,IID_IWebBrowserApp,IID_IWebBrowserApp)
COM_Release(pdoc)
Return pweb
} |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|