AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Determine if a WebPage is completely loaded in IE
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
bennoman



Joined: 14 Jun 2007
Posts: 11

PostPosted: Thu Jun 14, 2007 10:30 pm    Post subject: Reply with quote

hey I never even saw the zip file available. Surprised
I bet this will get around having to call over a help desk tech to re-install the newest version Very Happy

Thanks again n-l-i-d for all your help!
Back to top
View user's profile Send private message
Patrick
Guest





PostPosted: Tue Sep 25, 2007 8:59 am    Post subject: Reply with quote

Hi,
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.
Code:
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
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Tue Sep 25, 2007 11:02 am    Post subject: Reply with quote

Patrick wrote:
Code:
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.
I suggest to use the following instead:

Code:
#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
Back to top
View user's profile Send private message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 422
Location: Galil, Israel

PostPosted: Wed Sep 26, 2007 3:23 am    Post subject: Reply with quote

Quote:
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 ???
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Wed Sep 26, 2007 7:04 am    Post subject: Reply with quote

Joy2DWorld wrote:
how do we do that ?? [especially if control is inside another 'wrapper' like Maxathon, etc.]

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.

I could use it even with Firefox + IETab plugin.
Code:
SetTitleMatchMode 2
ControlGet, hIESvr, hWnd,, Internet Explorer_Server1, Firefox ahk_class MozillaUIWindowClass
Back to top
View user's profile Send private message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 422
Location: Galil, Israel

PostPosted: Wed Sep 26, 2007 3:20 pm    Post subject: Reply with quote

likely the complexity of DOM controls generally is fogging over my understanding, but....


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 ?)
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Wed Sep 26, 2007 4:27 pm    Post subject: Reply with quote

Joy2DWorld wrote:
is there away to apply to DOM controls to the 'external' control handle we've found ?

Yes, that's what this script does.

Quote:
ie. invoke "Navigate" upon the object (we did not create) ?

Navigate is for WebBrowser control, not for DOM. And yes again if the container implements WebBrowser control too, which is likely.
BTW, in this "Navigate" case, you may directly do it via DOM:
Invoke(pdoc, "url=", URL)

Quote:
(and speaking of firefox, can it too be an activeX boject, an InternetExplorer.Application equivalence ?)

The IETab plugin implements the WebBrowser control, i.e., Shell.Explorer.
Back to top
View user's profile Send private message
Murp|e



Joined: 12 Jan 2007
Posts: 240
Location: Norway

PostPosted: Thu Sep 27, 2007 8:43 am    Post subject: Reply with quote

This is very helpfull. I always had to resort to waiting for the statusbar text to show Done, but this has several disadvantages. For example, if the mouse cursor is above a link the statusbar text will normally show the URL of the link instead of showing Done. Different languages also display different Done-strings. This method seems much more reliable. I suppose it will work in both IE6 and IE7 -right?

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?
Back to top
View user's profile Send private message Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Thu Sep 27, 2007 12:00 pm    Post subject: Reply with quote

Murp|e wrote:
I suppose it will work in both IE6 and IE7 -right?

Yes.

Quote:
Sean I implemented your libcurl script

I think you meant olfen's.

Quote:
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?

Sure. It sounds great!
Back to top
View user's profile Send private message
Murp|e



Joined: 12 Jan 2007
Posts: 240
Location: Norway

PostPosted: Thu Sep 27, 2007 12:24 pm    Post subject: Reply with quote

Great.

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.
Back to top
View user's profile Send private message Visit poster's website
Joy2DWorld



Joined: 04 Dec 2006
Posts: 422
Location: Galil, Israel

PostPosted: Thu Sep 27, 2007 9:27 pm    Post subject: Reply with quote

Sean wrote:
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' ?


Quote:
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)
_________________
Joyce Jamce
Back to top
View user's profile Send private message
crxvfr



Joined: 10 Mar 2006
Posts: 54

PostPosted: Thu Sep 27, 2007 11:54 pm    Post subject: Reply with quote

majkinetor wrote:
Many times asked so far. You made ppl happy now.

YEAY!!!!
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Fri Sep 28, 2007 1:28 am    Post subject: Reply with quote

Joy2DWorld wrote:
btw, is the only way to have the WB create an object upon which to invoke DOM controls is by 'Navigate' ?

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.

Quote:
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)

No, firefox doesn't implement any ActiveX control, it uses just its own rendering engine.
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1338

PostPosted: Tue Oct 09, 2007 11:51 am    Post subject: Reply with quote

Here is another ways to access DOM of Internet Explorer_Server.
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.

Code:
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


Last edited by Sean on Wed Oct 10, 2007 12:06 am; edited 1 time in total
Back to top
View user's profile Send private message
Joy2DWorld



Joined: 04 Dec 2006
Posts: 422
Location: Galil, Israel

PostPosted: Tue Oct 09, 2007 10:26 pm    Post subject: Reply with quote

wow. staining my mind to follow that!

@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 ?
_________________
Joyce Jamce
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 2 of 6

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group