Embed IE GoBack, GoForward

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
Location: Seoul
Contact:

Embed IE GoBack, GoForward

17 Feb 2015, 23:05

Hello,
I'm making embed browser that has back, forward button

problem is , when I click the back or forward button when there is no history (when the script starts)
error msg occur, saying bla bla ~ continue running this script?

I think I need to use
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
this functions..

I tried CommandStateChange(0x2, bool), msgbox, % bool but it didnt worked at all?
help me!

Code: Select all

Gui Add, Edit, w930 r1 vURL, http://ahkscript.org/boards/
Gui, Add, Button, x5 y25 gBrB, <
Gui, Add, Button, x+1 y25 gBrF, >
Gui Add, Button, x+6 yp w44 Default, Go
Gui Add, ActiveX, xm w980 h640 vWB, Shell.Explorer
ComObjConnect(WB, WB_events)  ; Connect WB's events to the WB_events class object.
Gui Show
; Continue on to load the initial page:
ButtonGo:
Gui Submit, NoHide
WB.Navigate(URL)
return

Brb:
WB.GoBack()
return

BrF:
WB.GoForward()
return

class WB_events
{
    NavigateComplete2(wb, NewURL)
    {
        GuiControl,, URL, %NewURL%  ; Update the URL edit control.
    }
}

GuiClose:
ExitApp
AutoHotkey & AutoHotkey_H v1.1.22.07
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Embed IE GoBack, GoForward

18 Feb 2015, 01:35

Easier to use try WB.GoBack()

CommandStateChange is an event, not a function. You handle it the same way as the NavigateComplete2 event you're already handling.
User avatar
Soft
Posts: 174
Joined: 07 Jan 2015, 13:18
Location: Seoul
Contact:

Re: Embed IE GoBack, GoForward

18 Feb 2015, 04:03

@lexikos / brilliant lexikos... thank you! never thought about try command..
AutoHotkey & AutoHotkey_H v1.1.22.07

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Hansielein, Lpanatt and 315 guests