AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Embed an Internet Explorer control in your AHK Gui via COM
Goto page 1, 2, 3 ... 10, 11, 12  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Sean



Joined: 12 Feb 2007
Posts: 1279

PostPosted: Tue Feb 27, 2007 3:46 pm    Post subject: Embed an Internet Explorer control in your AHK Gui via COM Reply with quote

This is a standard library for IE/WebBrowser controls.

DOWNLOAD IE.ahk and COM.ahk.

(Note from moderator: This topic was originally part of http://www.autohotkey.com/forum/viewtopic.php?t=15885. It was split off at the author's request.)


Last edited by Sean on Mon Sep 10, 2007 3:16 am; edited 25 times in total
Back to top
View user's profile Send private message
daonlyfreez



Joined: 16 Mar 2005
Posts: 740
Location: Berlin

PostPosted: Tue Feb 27, 2007 7:51 pm    Post subject: Reply with quote

Brilliant! Cool

I found out that the Mozilla ActiveX can very easily be used too...

Code:
   GUID4String(CLSID_MozillaBrowser, "{1339B54C-3453-11D2-93B9-000000000000}")

   ;GUID4String(CLSID_WebBrowser, "{8856F961-340A-11D0-A96B-00C04FD705A2}")
   GUID4String(IID_IWebBrowser2, "{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}")

   hModule := DllCall("LoadLibrary", "str", "atl.dll")
   DllCall(DllCall("GetProcAddress", "Uint", hModule, "str", "AtlAxWinInit"))
   DllCall("FreeLibary", "Uint", hModule)

   hCtrl := DllCall("CreateWindowEx"
      , "Uint", 0x200            ; WS_EX_CLIENTEDGE
      , "str",  "AtlAxWin"         ; ClassName
      , "str",  CLSID_MozillaBrowser      ; WindowName
      , "Uint", 0x10000000 | 0x40000000   ; WS_VISIBLE | WS_CHILD
      , "int",  x            ; Left

...



Just make sure you register the mozctlx.dll first...

Cool

This is very good... Now one could use IE as default and add/download the Mozilla ActiveX if necessary.
_________________
(sorry, homesite offline atm)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Tue Feb 27, 2007 8:11 pm    Post subject: Reply with quote

superb guys
_________________
Back to top
View user's profile Send private message MSN Messenger
Sean



Joined: 12 Feb 2007
Posts: 1279

PostPosted: Wed Feb 28, 2007 8:13 am    Post subject: Reply with quote

I modified it to accommodate UrlHistory. Please copy it again.
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Feb 28, 2007 7:25 pm    Post subject: Reply with quote

Thanks a million for this. I think many AHK developers will find embedding a browser into their application useful.
Back to top
Guest






PostPosted: Wed Feb 28, 2007 8:39 pm    Post subject: Reply with quote

The new COM implementation more accurately grabs the Current URL via Gui_IEGetURL() - using lbbrowse3.dll I had mixed results...

One somewhat major problem I'm experiencing using the latest CoHelper.ahk and this new IE4AHK COM code is that the main scroll bar doesn't appear, and you can't use pageup/pagedown/arrowup/arrowdown to move arround inside the page.

Another smaller issue that exists in both versions of IE4AHK is that the enter key doesnt properly focus. For example, go to google.com by typing the address into the address bar. You have to click the 'Google Search' button, since enter just reloads the page.

Both of these problems exist with the latest version of AHK, IE4AHK, using IE 6.0.2900.2180 on XP SP2.

Thanks a lot for contributing this great work back to the AHK community.
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1279

PostPosted: Thu Mar 01, 2007 1:04 am    Post subject: Reply with quote

Quote:
One somewhat major problem I'm experiencing using the latest CoHelper.ahk and this new IE4AHK COM code is that the main scroll bar doesn't appear, and you can't use pageup/pagedown/arrowup/arrowdown to move arround inside the page.

I think this part is easy to correct. I updated the script. The only change is:

Code:
, "Uint", 0x10000000 | 0x40000000 | 0x04200000   ; WS_VISIBLE | WS_CHILD | ...
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Thu Mar 01, 2007 9:27 am    Post subject: Reply with quote

Wiki page:
http://www.autohotkey.com/wiki/index.php?title=COM_Wrappers
_________________
Back to top
View user's profile Send private message MSN Messenger
Guest






PostPosted: Thu Mar 01, 2007 3:32 pm    Post subject: Reply with quote

Sean wrote:
Quote:
One somewhat major problem I'm experiencing using the latest CoHelper.ahk and this new IE4AHK COM code is that the main scroll bar doesn't appear, and you can't use pageup/pagedown/arrowup/arrowdown to move arround inside the page.

I think this part is easy to correct. I updated the script. The only change is:

Code:
, "Uint", 0x10000000 | 0x40000000 | 0x04200000   ; WS_VISIBLE | WS_CHILD | ...


Thanks Sean, this fixed the scroll bar issues.
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1279

PostPosted: Mon Mar 05, 2007 11:18 am    Post subject: Reply with quote

I modified the script using indirections like Shell.Explorer and IID_IDispatch.
Although there is no difference in features, I recommend updating to it.
Back to top
View user's profile Send private message
vlcek



Joined: 19 Feb 2007
Posts: 321
Location: Czech Republic

PostPosted: Sun Mar 11, 2007 6:34 pm    Post subject: Re: Embed an Internet Explorer control in your AHK Gui Reply with quote

Good program. Bat. I can't open any internet address. Please Help
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Mar 11, 2007 10:19 pm    Post subject: Reply with quote

vicek - IE4AHK will use your IE connection settings, so if one works so should the other Smile Maybe temporarily disabling your software firewall will help.

Sean - I'd really like to see a New > Window button in the IE4AHK interface. This opens a new window, but without spawning another process. Do you know of a way to do this with COM? I can post some GUI code for adding the button.
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1279

PostPosted: Mon Mar 12, 2007 1:51 am    Post subject: Reply with quote

Quote:
Sean - I'd really like to see a New > Window button in the IE4AHK interface. This opens a new window, but without spawning another process. Do you know of a way to do this with COM? I can post some GUI code for adding the button.

It looks like not a COM problem, may be done by creating another GUI and start a new WebControl. Store them as (pweb1, hCtrol1), (pweb2, hCtrl2), etc and switch (pweb, hCtrl) to appropriate one among them whenever one of the GUI's becomes active.
Or, might simulate multi-tab features by creating multi WebControls in a single GUI, however, I'm not sure if there will be no glitch at all.
Back to top
View user's profile Send private message
vlcek



Joined: 19 Feb 2007
Posts: 321
Location: Czech Republic

PostPosted: Mon Mar 12, 2007 7:04 am    Post subject: Reply with quote

Graphics button can't read my screenreader. I open any web page, but i can't read this. I'm blind. I Programming in autohotkey, but I can't programming any graphics button. Thank.
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1279

PostPosted: Tue Mar 13, 2007 1:08 am    Post subject: Reply with quote

I updated the script as to now depend solely on pwb, no need to save hCtrl separately which is now derived from pwb.
So, if using multiple WebControls, only need to store pwb1, pwb2, etc.
I may add further a function to reverse the process, i.e. retrieving pwb from hCtrl if there is a demand.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3 ... 10, 11, 12  Next
Page 1 of 12

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group