 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
bennoman
Joined: 14 Jun 2007 Posts: 11
|
Posted: Thu Jun 14, 2007 10:30 pm Post subject: |
|
|
hey I never even saw the zip file available.
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! |
|
| Back to top |
|
 |
Patrick Guest
|
Posted: Tue Sep 25, 2007 8:59 am Post subject: |
|
|
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
|
Posted: Tue Sep 25, 2007 11:02 am Post subject: |
|
|
| 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 |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Wed Sep 26, 2007 3:23 am Post subject: |
|
|
| 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 |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1338
|
Posted: Wed Sep 26, 2007 7:04 am Post subject: |
|
|
| 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 |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Wed Sep 26, 2007 3:20 pm Post subject: |
|
|
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 |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1338
|
Posted: Wed Sep 26, 2007 4:27 pm Post subject: |
|
|
| 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 |
|
 |
Murp|e
Joined: 12 Jan 2007 Posts: 240 Location: Norway
|
Posted: Thu Sep 27, 2007 8:43 am Post subject: |
|
|
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 |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1338
|
Posted: Thu Sep 27, 2007 12:00 pm Post subject: |
|
|
| 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 |
|
 |
Murp|e
Joined: 12 Jan 2007 Posts: 240 Location: Norway
|
Posted: Thu Sep 27, 2007 12:24 pm Post subject: |
|
|
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 |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Thu Sep 27, 2007 9:27 pm Post subject: |
|
|
| 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 |
|
 |
crxvfr
Joined: 10 Mar 2006 Posts: 54
|
Posted: Thu Sep 27, 2007 11:54 pm Post subject: |
|
|
| majkinetor wrote: | | Many times asked so far. You made ppl happy now. |
YEAY!!!! |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1338
|
Posted: Fri Sep 28, 2007 1:28 am Post subject: |
|
|
| 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 |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1338
|
Posted: Tue Oct 09, 2007 11:51 am Post subject: |
|
|
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 |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Tue Oct 09, 2007 10:26 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|