tank wrote:
what sort of debachery is this
you post the most intense misuse and misunderstanding of my old and posted to be discontinued functions in Seans thread of a no longer supported library. you have obviously no understanding whatsoever what your attempting to do or the slightest ability to learn from dozens of examples
there is nothing productive about your code at all
Now i want to be clear here dont play with fire. you dont have yet working code nor is this working code yet because you have a condition and a step that cant work without other things happening first
I would like to makes 4 points about your reply. I realize this is long but after your reply I think you should read it completely. thanks for your time.
1.
tank wrote:
there is nothing productive about your code at all
My code was a
DEMONSTRATION code, just as I said here
Anxious_Patient wrote:
I added more code to demostrate what I am trying to do.
It was not meant to be productive. It was meant to demostrate what I wanted to do.
2.
tank wrote:
you post the most intense misuse and misunderstanding of my old and posted to be discontinued functions in Seans thread of a no longer supported library
Please notice what I said
Anxious_Patient wrote:
I am using Tanks IE7 functions for everything else and it is working great. I see Tank has updated his IE7 to iWeb. I plan on leaving my script using IE7 because it is working so well.
Notice, I said my script was working so well using your IE7 Functions, I just needed to learn how to GoBack a page. I came across Seans GOBACK function and wanted to know how to either use it or use an update version of it. As you can see, I know that Sean does not use IE.ahk anymore and your IE7 functions are discontinued. But my script works so I see no need to change it now.
Notice what I said, I do have a working script
Anxious_Patient wrote:
My script is able to navigate an IE webpage even with the webpage minimized. I just need this one last thing fixed.
3.
tank wrote:
you post the most intense misuse and misunderstanding of my old and posted to be discontinued functions in Seans thread
Also, notice on my first post to Sean that I did not have any of your IE7 functions in it. I only added more code to my post to show Sean I had a webpage that I could GOBACK to.
4.
tank wrote:
you have obviously no understanding whatsoever what your attempting to do or the slightest ability to learn from dozens of examples
Actually I do have some idea. I have automated a webpage using your IE7 function examples that can run 24 hours a day without any errors. How could I do that if I had no ability to learn from dozens of examples.
As you noticed I do not know COM nor do I need to know COM to use your IE7 functions.
I just needed to know how to GOBACK a page hence my original post.
I am posting another
DEMONSTRATION code using your iWeb functions. Your suggestion on how to use Seans GOBACK works perfectly.
I thank you for that.
Simply
Code:
pwb:=iWeb_getwin("google")
COM_Invoke(pwb, "GoBack")
would have been enough to send me in the right direction.
You completely misunderstood my entire situation.
Here is my
WORKING DEMONSTRATION . I put some notes for you at the bottom.
Code:
iWeb_Init()
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance,force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#Include COM.ahk
OnExit,Term
SetTitleMatchMode,2
MsgBox -----------------This is only a DEMONSTRATION-----------------`n`nIt is not designed to do anything PRODUCTIVE.`n`nIt will DEMONSTRATE to me that the code is working as planned.`n`n1. Code will click on Google news.`n2. Get the html source code`n3. Parse the code for keywords.`n4. Do something based on the keywords it finds`n5. Then GOBACK a page to DEMONSTRATE that it can GOBACK a page.`n`nOnce I see that it works I will apply it to my CONFIDENTIAL script.`n`nPlease open www.google.com, then click Ok
IfWinNotExist,Google
MsgBox A Google window could not be found.`n`nOpen www.google.com, then click OK
pwb:=iWeb_getwin("google")
iWeb_clickDomObj(pwb,17)
sleep 1000
iWeb_complete(pwb)
sleep 1000
Gosub GetHtmlSourceCode
sleep 1000
IfInString,HtmlCode,Obama
MsgBox Obama keyword is in the source code`n`nClick okay and see if it goes back a page
Else
MsgBox Obama keyword was not found in the source code`n`nClick okay and see if it goes back a page
COM_Invoke(pwb, "GoBack")
iWeb_complete(pwb)
MsgBox The DEMONSTRATION code is now complete.`n`nDid it GOBACK a page?`n`nScript will now exit
term:
iWeb_Term()
exitapp
GetHtmlSourceCode:
ControlGet, hIESvr, Hwnd,, Internet Explorer_Server1,Google
WinGetClass, class, ahk_id %hIESvr%
if (!hIESvr or class != "Internet Explorer_Server")
return
COM_Error(0)
WM_HTML_GETOBJECT := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT")
SendMessage, WM_HTML_GETOBJECT,,,, ahk_id %hIESvr%
lResult := ErrorLevel
DllCall("oleacc\ObjectFromLresult", "uint", lResult, "uint", COM_GUID4String(IID_IHTMLDocument2,"{332C4425-26CB-11D0-B483-00C04FD90119}"), "int", 0, "uint*", pDoc)
DocEle:=COM_Invoke(pDoc, "documentElement")
htmlcode:=COM_Invoke(DocEle,"innerHTML")
COM_Release(DocEle)
COM_Release(pDoc)
return
/*
Tank - Please Note: the iWeb_complete(pwb) posted on the first page of your thread... http://www.autohotkey.com/forum/topic30599.html did not work for me, using Vista and IE8
I found your alternate method which works very well posted here and listed below...http://www.autohotkey.com/forum/topic30599-120.html
iWeb_complete(pwb) ; returns bool for success or failure
{
If !pwb ; test to see if we have a valid interface pointer
sleep, 5000 ; ExitApp if we dont
else {
loop 10 ; sets limit if itenerations to 40 seconds 80*500=40000=40 secs
{
If not (rdy:=COM_Invoke(pwb,"readyState") = 4)
Break ; return success
Sleep,100 ; sleep .1 second between cycles
}
loop 80 ; sets limit if itenerations to 40 seconds 80*500=40000=40 secs
{
If (rdy:=COM_Invoke(pwb,"readyState") = 4)
Return 1 ; return success
Sleep,500 ; sleep half second between cycles
}
}
Return 0 ; lets face it if it got this far it failed
} ; end complete
*/
take care
Anxious_Patient