AutoHotkey Community

It is currently May 27th, 2012, 10:15 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 309 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 21  Next
Author Message
 Post subject:
PostPosted: May 16th, 2007, 1:17 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
2Sean

Lets try again with DOM.

You said you don't see a point in accessing DOM. The point is that user will be able to create rich looking applications, by constructing them in any Web IDE around, skin them using CSS etc.. You can do so now, but you can't access what the user does with controls on the form. For instance, if there is a button, I should be notiified when button is clicked so I can rise appropriate AHK action. Thus, web design and standard application design can be mixed and the best of both worlds can be taken. Many apps out there use this mechanism. For instance, Ashampoo Uninstaler has complete start up interface in IE but you can not see that unless you use some spy technique.

As you are already most familiar with COM and this topic, I belive you can at least initialise DOM - provide several basic functions so ppl interested can extend your work.

If you provide such features, ppl would literally be able to create apps that can look like the one bellow

Image

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 16th, 2007, 1:42 pm 
Offline

Joined: March 16th, 2005, 10:33 pm
Posts: 969
Location: Frisia
Yes! We want DOM access! :P 8)

No, really, that would be the ultimate...

_________________
Image mirror 1mirror 2mirror 3ahk4.me • PM or Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 16th, 2007, 2:02 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
While updating IEControl.ahk, I added a function IE_Document(pwb) which is the gateway from WebControl to DOM.
And, the function GetWebControl() can directly access DOM already.

The problem is that DOM provides literally thousands of functions, so, have to decide which ones to include or not.
So, if people show me what they need mostly in any form, e.g. oIE.document.documentElement.outerHTML in VBS syntax, then I could start implementing DOM.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 16th, 2007, 2:31 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Thx Sean for reconsidering.

I think this is enough for the start

  • Ability to access any element by ID (GetElementByID), eventualy list of all elements of the same class (in JS framewors usualy noted as $$, for instance $$("a") will create array of all anchors)
  • Set/Get InnerHtml property ( <tag> InnerHtml </tag> ) (DOM_SetInnerHtml( domID, ctlID, HTML ) )
  • Set/Get Attribute of DOM element ( <tag attrrib="value">... </tag> ) (DOM_SetAttrib( domID, ctlID, "attribname", "attribval" ) )
  • Click/Change notificiations on DOM elements (for instance in form DOM_ElementClick( domID, ctlID, subroutine)

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 20th, 2007, 4:49 pm 
Offline

Joined: November 26th, 2006, 8:10 pm
Posts: 77
Can someone point me to or cut-and-paste a running example of the latest integration of Browser..... bare bones without any special features, just load Google and also call raw HTML. :-) Thank you for any help and direction!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 6:16 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
AngieX wrote:
Can someone point me to or cut-and-paste a running example of the latest integration of Browser

Here is one example. Need the latest IEControl.ahk & CoHelper.ahk.

Code:
#Include IEControl.ahk
#SingleInstance force

GoSub, GuiStart

Gui, +LastFound +Resize
Gui, Show, w800 h600 Center, WebBrowser
hWnd := WinExist()

CLSID_WebBrowser := "{8856F961-340A-11D0-A96B-00C04FD705A2}"
IID_IWebBrowser2 := "{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}"
pwb := CreateObject(CLSID_WebBrowser, IID_IWebBrowser2)

AtlAxAttachControl(pwb, hWnd)

IE_LoadURL(pwb, "http://www.autohotkey.com/")
Sleep 5000
IE_LoadURL(pwb, "http://www.autohotkey.com/forum/")
Sleep 5000
IE_GoBack(pwb)
Sleep 3000
IE_GoForward(pwb)
Return

GuiStart:
AtlAxWinInit()
CoInitialize()
Return
GuiClose:
Gui, %A_Gui%:Destroy
Release(pwb)
CoUninitialize()
AtlAxWinTerm()
ExitApp


Last edited by Sean on May 27th, 2007, 2:15 pm, edited 4 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 7:18 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
Thanks for the example Sean. It runs great here but Windows asks if I'd like to send a report to Microsoft when I close the window (XP Pro SP2). Commenting out AtlAxWinTerm() and CoUninitialize() seems to prevent the message... :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 7:45 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
corrupt wrote:
Thanks for the example Sean. It runs great here but Windows asks if I'd like to send a report to Microsoft when I close the window (XP Pro SP2). Commenting out AtlAxWinTerm() and CoUninitialize() seems to prevent the message... :?

Thanks. BTW, that's strange... It doesn't output an error message here with IE7 in XPSP2 Pro.
The sole purpose of these two are just cleaning up, and not absolutely necessary in this case as they will be cleaned up anyway with the exit of AHK.
So, you may just comment out them and there will be no problem at all, I believe.

PS. I changed the order of the initialize/uninitialize of ATL & COM for a purely experimental purpose.
Does it still produce an error?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 7:53 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
It seemed a bit strange to me too. I'm not sure if it something machine specific (IE6 here). I'll try on another machine soon.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 7:57 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
Sean wrote:
PS. I changed the order of the initialize/uninitialize of ATL & COM for a purely experimental purpose.
Does it still produce an error?
I still get the message. I also tried commenting out only one or the other...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 8:07 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
corrupt wrote:
I still get the message. I also tried commenting out only one or the other...

Thanks for testing it.
I can't explain this, btw.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 8:47 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
Hmm... If I destroy the Gui Window first then I don't get the error.
Code:
GuiClose:
Release(pwb)
Gui, +LastFound
Gui1 := WinExist()
DllCall("DestroyWindow", "UInt", Gui1)
CoUninitialize()
AtlAxWinTerm()
ExitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 9:10 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
corrupt wrote:
Hmm... If I destroy the Gui Window first then I don't get the error.

Thanks for the info. So, adding the following will prevent the error message?

Code:
DllCall("DestroyWindow", "Uint", hWnd)


OTOH, I'm a bit surprised with this.
Isn't GuiClose: supposed to be executed after the Gui window is destroyed?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 9:18 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
Sean wrote:
OTOH, I'm a bit surprised with this.
Isn't GuiClose: supposed to be executed after the Gui window is destroyed?
GuiClose: seems to be executed before the window is destroyed (at least the window is still visible).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 22nd, 2007, 9:49 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
corrupt wrote:
GuiClose: seems to be executed before the window is destroyed (at least the window is still visible).

OK, I added DestroyWindow, being commented initially. Thanks for figuring it out.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], specter333, XX0 and 26 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