Hi all...
Been working on this thing for a bit (few days) and I am starting to grasp how it all works. I have a fully (see note @ bottom) working web browser, with working (see note again) controls. An options area is planned, and it is made to be a bare-bones, get-on-the-internet-and-find-what-I-want-in-5-seconds-flat type of browser. Just totally...basic. (Some icons wouldn't hurt, but thats not what I need help with.)
So, its all going well. Except for a couple things...
1) I am using mostly my own code, with a little from examples from the AHK site. Problem is (shhhhh...) I don't know what half the stuff is that I end up editing. I understand it, then...I don't. Then, I have a problem (duh). (I now understand all but this one piece here, and I think I can fix it)
Example:
ieM := Gui_IEAdd (HWnd, 300, 38, 338, 378) ;I have no idea how I got this. I pulled it from somewhere...
2) This is the main issue. I can't get the thing to load any pages via my URL bar!
Its driving me mad! I have my variables setup, they submit and then are read and the browser is told to go to that...but...it...doesn't
Example:
Gui,2: Add, ComboBox, x10 y75 w300 vAddressBar
... ;Insert loads of code here...
Go:
Gui, Submit, NoHide
IE_LoadURL(pwb, "AddressBar")
Gui,2: Hide
Return
3) The enter key doesn't work. This made no sense to me at all. The freaking key doesn't work. And its the ONLY key that doesn't work. I tried making a hotkey for when Enter is pressed, to relay Enter to the window...and that didn't go so well.
Example:
Enter::
IfWinActive, CompuTech SmartBrowse
Send {Enter}
Return
4) I can't move the web page anywhere!!! GAH!!! I have tried
2 3 methods, and it still won't work.
Example:
ieM := Gui_IEAdd (HWnd, 300, 38, 338, 378)
... ;Insert a lot of code here
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)
5) I can't move the web page, so therefore, I can't put the controls in the same window. You have to hit Control + Shift + Z to get to your Back/Forward/Stop etc buttons.
Example:
See above
A lot of problems, minor (mostly) but problems. You can effectively use the browser, but unless you can find everything by Google, don't mind clicking Login and Search, can handle Ctrl + Shift + Z for EVERY command, and no options whatsoever (to be implemented), it's not really that user-friendly.
Can anyone help? I have a sinking ship, and right now it's not looking so good.
All code below:
Spoiler
#Include IEControl.ahk
#SingleInstance force
GoSub, GuiStart
Gui, +LastFound +Resize
Gui,2: Add, Button, x10 y10 gBack, <-- Back
Gui,2: Add, Button, x63 y10 gForward, Forward ->>
Gui,2: Add, Button, x132 y10 gStop, Stop [X]
Gui,2: Add, Button, x183 y10 gRefresh, Refresh
Gui,2: Add, Button, x233 y10 gHome, Home
Gui,2: Add, Button, x274 y10 gOptions, Options
Gui,2: Add, ComboBox, x10 y75 w300 vAddressBar
Gui,2: Add, Button, x315 y75 gGo, Go ->>
ieM := Gui_IEAdd (HWnd, 300, 38, 338, 378)
Gui, Show, w800 h700 Center, CompuTech SmartBrowse
MsgBox, 0, CompuTech SmartBrowse, Welcome to CompuTech SmartBrowse- the no hassle
web browser. Running with Internet Explorer and coded in AutoHotkey this browser is bare-
bones. It allows quick and basic web browsing without annoying toolbars or add-ons in your
way.`n`nTo show controls (Back/Forward/Stop etc) you just need to push Control+Shift+Z.`nYou
may start using SmartBrowse now.
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.google.com/")
Return
GuiStart:
AtlAxWinInit()
CoInitialize()
Return
Back:
IE_GoBack(pwb)
Gui,2: Hide
Return
Forward:
IE_GoForward(pwb)
Return
Stop:
Gui,2: Hide
Return
Refresh:
Gui,2: Hide
Return
Home:
IE_GoHome(pwb)
Gui,2: Hide
Return
Go:
Gui, Submit, NoHide
IE_LoadURL(pwb, "AddressBar")
Gui,2: Hide
Return
Options:
Gui,2: Hide
Return
^+Z::
Gui,2: Show, Center, CompuTech SmartBrowse Control Panel
Return
Enter::
IfWinActive, CompuTech SmartBrowse
Send {Enter}
Return
GuiClose:
Gui, %A_Gui%:Destroy
Release(pwb)
CoUninitialize()
AtlAxWinTerm()
ExitApp