AutoHotkey Community

It is currently May 25th, 2012, 4:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 119 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 8  Next
Author Message
 Post subject:
PostPosted: June 14th, 2007, 10:30 pm 
Offline

Joined: June 14th, 2007, 6:43 pm
Posts: 11
hey I never even saw the zip file available. :o
I bet this will get around having to call over a help desk tech to re-install the newest version :D

Thanks again n-l-i-d for all your help!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2007, 8:59 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2007, 11:02 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 26th, 2007, 3:23 am 
Offline

Joined: December 4th, 2006, 10:35 am
Posts: 561
Location: Galil, Israel
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 26th, 2007, 7:04 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 26th, 2007, 3:20 pm 
Offline

Joined: December 4th, 2006, 10:35 am
Posts: 561
Location: Galil, Israel
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 26th, 2007, 4:27 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 27th, 2007, 8:43 am 
Offline

Joined: January 12th, 2007, 4:30 am
Posts: 531
Location: Norway
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 27th, 2007, 12:00 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 27th, 2007, 12:24 pm 
Offline

Joined: January 12th, 2007, 4:30 am
Posts: 531
Location: Norway
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 27th, 2007, 9:27 pm 
Offline

Joined: December 4th, 2006, 10:35 am
Posts: 561
Location: Galil, Israel
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 27th, 2007, 11:54 pm 
Offline

Joined: March 10th, 2006, 7:41 pm
Posts: 89
majkinetor wrote:
Many times asked so far. You made ppl happy now.

YEAY!!!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 28th, 2007, 1:28 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 9th, 2007, 11:51 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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 October 10th, 2007, 12:06 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 9th, 2007, 10:26 pm 
Offline

Joined: December 4th, 2006, 10:35 am
Posts: 561
Location: Galil, Israel
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 119 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 8  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Rajat, sarevok9 and 24 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group