Determine if a WebPage is completely loaded in IE
I bet this will get around having to call over a help desk tech to re-install the newest version
Thanks again n-l-i-d for all your help!
Sorry for my poor knowledge of AHK, but the solution provided here doesn't work with me.
I downloaded "CoHelper.ahk" and I have saved Seans' script in "WebSiteFinished.ahk".
In a testfile "test.ahk" I put this code. But when launching the script (F12), the calculator appears before the web page has completely finished loading.
What am I doing wrong?
Many thanks for your help.
Patrick.
F12:: Run, C:\Program Files\Internet Explorer\iexplore.exe http://maps.google.ca/maps?ie=UTF-8&oe=UTF-8&hl=en&tab=wl&q=,,,Pid RunWait, WebsiteFinished.ahk run calc.exe Return
The key here is to obtain the window handle of Internet Explorer_Server control, but, if you run new iexplore.exe, this control seems not created until the web page starts loading, so it defeats the purpose of the script in a sense.F12:: Run, C:\Program Files\Internet Explorer\iexplore.exe http://maps.google.ca/maps?ie=UTF-8&oe=UTF-8&hl=en&tab=wl&q=,,,Pid RunWait, WebsiteFinished.ahk run calc.exe Return
I suggest to use the following instead:
#Include CoHelper.ahk F12:: CoInitialize() pie := ActiveXObject("InternetExplorer.Application") Invoke(pie, "Visible=", "True") Invoke(pie, "Navigate", "http://maps.google.ca/maps?ie=UTF-8&oe=UTF-8&hl=en&tab=wl&q=") Loop { If Invoke(pie, "ReadyState") = 4 Break Sleep, 500 } Release(pie) CoUninitialize() Run, calc.exe Return
The key here is to obtain the window handle of Internet Explorer_Server control
ok, (silly question...)
how do we do that ?? [especially if control is inside another 'wrapper' like Maxathon, etc.]
and
Invoke() will then work as usual ???
I can't see the problem with it. If it's a control inside any top-level window, you can use it no matter what the top-level window really is, unless the proggy tries to fake it.how do we do that ?? [especially if control is inside another 'wrapper' like Maxathon, etc.]
I could use it even with Firefox + IETab plugin.
SetTitleMatchMode 2 ControlGet, hIESvr, hWnd,, Internet Explorer_Server1, Firefox ahk_class MozillaUIWindowClass
is there away to apply to DOM controls to the 'external' control handle we've found ?
ie. invoke "Navigate" upon the object (we did not create) ?
(and speaking of firefox, can it too be an activeX boject, an InternetExplorer.Application equivalence ?)
Yes, that's what this script does.is there away to apply to DOM controls to the 'external' control handle we've found ?
Navigate is for WebBrowser control, not for DOM. And yes again if the container implements WebBrowser control too, which is likely.ie. invoke "Navigate" upon the object (we did not create) ?
BTW, in this "Navigate" case, you may directly do it via DOM:
Invoke(pdoc, "url=", URL)
The IETab plugin implements the WebBrowser control, i.e., Shell.Explorer.(and speaking of firefox, can it too be an activeX boject, an InternetExplorer.Application equivalence ?)
P.S. Sean I implemented your libcurl script to create a very simple software upgrade function for my program. It downloads a text file to get the newest version of the program, if a new version is available it can download the -NSIS- installer. The script creates an on-the-fly VBS script which silently uninstalls the old version, then silently installs the new version. The program is about 1 mb so the whole process is very fast. Might be something worth posting?
Yes.I suppose it will work in both IE6 and IE7 -right?
I think you meant olfen's.Sean I implemented your libcurl script
Sure. It sounds great!It downloads a text file to get the newest version of the program, if a new version is available it can download the -NSIS- installer. The script creates an on-the-fly VBS script which silently uninstalls the old version, then silently installs the new version. The program is about 1 mb so the whole process is very fast. Might be something worth posting?
You're right, I suppose I remember your name because his example implements your filehelper.ahk. Thanks to the both of you then, I'll be sure to update my credits.
Alright, I'll start a new thread in the forum.
Navigate is for WebBrowser control, not for DOM.
Sean, so simple you make it. Very much helpful, thanks.
btw, is the only way to have the WB create an object upon which to invoke DOM controls is by 'Navigate' ?
The IETab plugin implements the WebBrowser control, i.e., Shell.Explorer.
in the inverse direction, can we pull up an active x 'webrowser' like control for FFox html rendering object ? (vs. MS IE's webbrowser control)
YEAY!!!!Many times asked so far. You made ppl happy now.
I'm not sure if I understood you here. I believe DOM and WB are completely independent objects. So, in strict logical sense, they don't require each other, I suppose.btw, is the only way to have the WB create an object upon which to invoke DOM controls is by 'Navigate' ?
No, firefox doesn't implement any ActiveX control, it uses just its own rendering engine.in the inverse direction, can we pull up an active x 'webrowser' like control for FFox html rendering object ? (vs. MS IE's webbrowser control)
Although it's not extensively tested, worked fine so far here in XPSP2 and IE7.
Please execute it when mouse is on the IE window or alike.
It's done through Accessibility Standard Library.
CoordMode, Mouse MouseGetPos, xpos, ypos, , hIESvr, 2 IID_IHTMLWindow2 := "{332C4427-26CB-11D0-B483-00C04FD90119}" IID_IHTMLElement := "{3050F1FF-98B5-11CF-BB82-00AA00BDCE0B}" ACC_Init() pacc := ACC_AccessibleObjectFromWindow(hIESvr) pwin := COM_QueryService(pacc,IID_IHTMLWindow2,IID_IHTMLWindow2) sResult .= "Window Object: " . pwin . "`tRole: " . acc_Role(pacc) . "`n" COM_Release(pacc) pacc := 0 pacc := ACC_AccessibleObjectFromPoint(xpos, ypos) plmt := COM_QueryService(pacc,IID_IHTMLElement,IID_IHTMLElement) sResult .= "Element Object: " . plmt . "`tRole: " . acc_Role(pacc) . "`n" COM_Release(pacc) COM_Release(pwin) COM_Release(plmt) ACC_Term() MsgBox, % sResult
@Sean,
tiny suggestion. in the ACC_ library, important maybe to keep *all* functions tied to the library. ie. HEX() to acc_hex() ... because... otherwise risk conflicting with other hex() function on other libraries or user's own! (example too in the dde wrapper, for example.. also has a hex()... "dde_hex()" if that makes sense.)
huge(?) question. been tearing with my mind on this, but not finding the path... How to turn the document object handle (or any other object, actually) into handle that can be bound COM_events ?
COM_ConnectObject(pobj,"ON_") such thing, if my comprehension isn't too foggy on this...
how to turn events into callbacks ?