AutoHotkey Community

It is currently May 26th, 2012, 8:08 pm

All times are UTC [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: May 29th, 2009, 12:40 am 
I can't even get this to work:

Code:
#q::        ; test hotkey
{
windowname="Google"
java=yahoo.com

COM_Init() ; Initialize COM - requires COM.ahk library
pageSearched:="Samikkelsen.com - Windows Internet Explorer"

Loop, %   COM_Invoke(psw := COM_Invoke(psh:=COM_CreateObject("Shell.Application"), "Windows"), "Count")
   {
      LocationName:=COM_Invoke(pwb:=COM_Invoke(psw, "Item", A_Index-1), "LocationName")
      IfInString,LocationName,%windowname%
         Break
      COM_Release(pwb) ;didnt break so release the one we didnt use
   }
COM_Invoke(pwb, "Navigate", java)
COM_Release(pwb)
COM_Term()

Return
}


I open an instance of IE7 and open Google.com, then run the script. Still gives me the not connected error. This is driving me crazy!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2009, 3:21 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
so the question is
how in the @#$%^&*() can a page google.com going to have a title of Samikkelsen.com - Windows Internet Explorer

how
think
i already told you the problem was the title you used and yet you insist on continuing

Code:
pageSearched:="Google"
Loop, %   COM_Invoke(psw := COM_Invoke(psh:=COM_CreateObject("Shell.Application"), "Windows"), "Count")
   {
      LocationName:=COM_Invoke(pwb:=COM_Invoke(psw, "Item", A_Index-1), "LocationName")
      IfInString,LocationName,%pageSearched%
         Break
      COM_Release(pwb) ;didnt break so release the one we didnt use
   }
would return a pointer to a goole page open in a browser
Samikkelsen.com - Windows Internet Explorer isnt ever going to give you didly because the
- Windows Internet Explorer
is a suffix added by IE it has nothing to do with the page title
Samikkelsen.com would only work if a page was open to that page and the <title>...</title> if the page was Samikkelsen.com

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2009, 8:55 am 
Offline

Joined: June 24th, 2008, 8:30 am
Posts: 126
I don't mean to be rude, but I don't think you read my code all the way through. It was my mistake to leave that extra peice of code in there, but if you look, the variable referenced for the wintitle, it is "windowname" not "pagesearched".


It still doesn't work for me, i'm at a loss here.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2009, 12:45 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
ok right you are my apologies
and your using internet explorer????????

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 29th, 2009, 8:00 pm 
Offline

Joined: June 24th, 2008, 8:30 am
Posts: 126
Yes, IE7.

I actually figured out the problem, and it did in fact have something to do with the variables.

I was using the variable like this:
Code:
windowname="Google"


instead of:
Code:
windowname:="Google"


Small error makes a huge difference!

Thanks for all the help.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2009, 5:19 pm 
Offline

Joined: July 11th, 2009, 3:50 pm
Posts: 67
Using the info in this thread i was able understand my browser better and got it to work the way i wanted.

2 questions i wanted to asked, can i input information and get data back without a webpage visible and if i make my script an exe do i need the com file in the same folder if i want to send my finished script to other people?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2009, 5:33 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
There is nothing about the techniques demonstrated within this thread for Internet explorer that require the browser to be visible. But be cautious. Invisible windows and lax security are the hackers play ground

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2009, 6:16 pm 
Offline

Joined: July 11th, 2009, 3:50 pm
Posts: 67
i used this script and changed it to my specs but i could not undertsnad how to reuse the same browser instead of a new browser.

Code:
gUser:="myName"
gPass:="myPass"
COM_Init()
pwb := COM_CreateObject("InternetExplorer.Application")
COM_Invoke(pwb , "Visible=", "True") ;"False" ;"True" ;
GETdata := "?Email=" gUser "&Passwd=" gPass "&ltmpl=default&ltmplcache=2&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3F&service=mail&rm=false&ltmpl=default&ltmpl=default&rmShown=1&signIn=Sign+in"
url:="https://www.google.com/accounts/ServiceLoginAuth"
COM_Invoke(pwb, "Navigate", url GETdata)
COM_Release(pwb)
COM_Term()


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2009, 7:33 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
seriously if your not gonna read the tutorial dont post a question
first fragging post on the first friggin page wrote:
Re-using exisitng instances of IE

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 15th, 2009, 1:26 am 
Offline

Joined: July 11th, 2009, 3:50 pm
Posts: 67
Gees if you are not going to read the question don't bother answering, i said I DID NOT UNDERSTAND, there was nothing in there about not reading the pages.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 4:44 am 
Thanks ALOT for the tutorial, I'm not 100% clear on everything tank, sean, and everybody else but you guys rock. Besides who wants to end up pushing buttons all day like that mom on the jet-sons cartoon!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 7:23 pm 
Offline

Joined: February 19th, 2007, 9:03 am
Posts: 338
Location: Czech Republic
Good evening.
Can you help me?
I have problems.
I want create web browser with your tutorial, but I have problem with my script.
Can you create for me gui window with loaded page google.com and keyboard navigation?
I'm blind and I browse pages with key up, down, left, right and with tab key.

I created this, but navigation with tab key not work.


Code:
#include com.ahk

COM_AtlAxWinInit()
Gui, +LastFound +Resize
;pwb := COM_AtlAxGetControl(COM_AtlAxCreateContainer(WinExist(),top,left,width,height, "Shell.Explorer") )  ;left these here just for reference of the parameters
pwb := COM_AtlAxGetControl(COM_AtlAxCreateContainer(WinExist(),0,0,510,600, "Shell.Explorer") )
;http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.ole.interop.ioleinplaceactiveobject(VS.80).aspx
IOleInPlaceActiveObject_Interface:="{00000117-0000-0000-C000-000000000046}"
pipa := COM_QueryInterface(pwb, "IOleInPlaceActiveObject_Interface")
OnMessage(WM_KEYDOWN:=0x0100, "WM_KEYDOWN")
OnMessage(WM_KEYUP:=0x0101, "WM_KEYDOWN")
gui,show, w510 h600 ,Gui Browser
;take from the IE example
url:="http://www.google.com"
COM_Invoke(pwb, "Navigate", url)
loop
      If (rdy:=COM_Invoke(pwb,"readyState") = 4)
         break
return

GuiClose:
Gui, Destroy
COM_CoUninitialize()
COM_AtlAxWinTerm()
ExitApp

GuiSize:
WinMove, % "ahk_id " . COM_AtlAxGetContainer(pwb), , 0,0, A_GuiWidth, A_GuiHeight
return
WM_KEYDOWN(wParam, lParam, nMsg, hWnd)
{
;  Critical 20
;tooltip % wparam
  If  (wParam = 0x09 || wParam = 0x0D || wParam = 0x2E || wParam = 0x26 || wParam = 0x28) ; tab enter delete up down
  ;If  (wParam = 9 || wParam = 13 || wParam = 46 || wParam = 38 || wParam = 40) ; tab enter delete up down
  {
      WinGetClass, Class, ahk_id %hWnd%
      ;tooltip % class
      If  (Class = "Internet Explorer_Server")
          {
            Global pipa
             VarSetCapacity(Msg, 28)
             NumPut(hWnd,Msg), NumPut(nMsg,Msg,4), NumPut(wParam,Msg,8), NumPut(lParam,Msg,12)
             NumPut(A_EventInfo,Msg,16), NumPut(A_GuiX,Msg,20), NumPut(A_GuiY,Msg,24)
             DllCall(NumGet(NumGet(1*pipa)+20), "Uint", pipa, "Uint", &Msg)
             Return 0
          }
  }
}


_________________
Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 5th, 2009, 8:58 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
I have had no luck with the tab key either ??? Sean, Lexikos either of you have any ideas?

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2009, 1:30 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Code:
pipa := COM_QueryInterface(pwb, IOleInPlaceActiveObject_Interface)
Notice no quotes here.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2009, 4:23 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
roflma wow cant beleive i missed that

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], notsoobvious, Uberi and 23 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