HR78 Posted September 7, 2011 Posted September 7, 2011 Hi. I have this script: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister () Dim $oIE = _IECreateEmbedded () ;Dim $oIE2 = _IECreateEmbedded () Opt("GUIResizeMode", 1) Opt("GUIOnEventMode", 1) ; OnEvent mode Dim $gui = GUICreate("resizable", 1000, 600,-1,-1,$WS_OVERLAPPEDWINDOW) $Button1 = GUICtrlCreateButton("Button1", 900, 60, 90, 33) $Button2 = GUICtrlCreateButton("Button2", 900, 100, 90, 33) Dim $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0,900,600) _IENavigate ($oIE, "http://google.com") ;Dim $GUIActiveX2 = GUICtrlCreateObj($oIE2, 0, 300,800,250) ;_IENavigate ($oIE2, "http://images.google.com") GUISetState (@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _IENavigate ($oIE, "www.autoitscript.com") Case $Button2 _IENavigate ($oIE, "http://www.autoitscript.com/forum/") EndSwitch WEnd How make Button1 and Button2 navigate "_IENavigate" to another sites?? Thanks.
Herb191 Posted September 7, 2011 Posted September 7, 2011 GUIOnEventMode set to 1 is keeping it from working try this: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister() Dim $oIE = _IECreateEmbedded() ;Dim $oIE2 = _IECreateEmbedded () Opt("GUIResizeMode", 1) ;Opt("GUIOnEventMode", 1) ; OnEvent mode Dim $gui = GUICreate("resizable", 1000, 600, -1, -1, $WS_OVERLAPPEDWINDOW) $Button1 = GUICtrlCreateButton("Button1", 900, 60, 90, 33) $Button2 = GUICtrlCreateButton("Button2", 900, 100, 90, 33) Dim $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 900, 600) _IENavigate($oIE, "http://google.com") ;Dim $GUIActiveX2 = GUICtrlCreateObj($oIE2, 0, 300,800,250) ;_IENavigate ($oIE2, "http://images.google.com") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _IENavigate($oIE, "www.autoitscript.com") Case $Button2 _IENavigate($oIE, "http://www.autoitscript.com/forum/") EndSwitch WEnd
HR78 Posted September 8, 2011 Author Posted September 8, 2011 GUIOnEventMode set to 1 is keeping it from working try this: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister() Dim $oIE = _IECreateEmbedded() ;Dim $oIE2 = _IECreateEmbedded () Opt("GUIResizeMode", 1) ;Opt("GUIOnEventMode", 1) ; OnEvent mode Dim $gui = GUICreate("resizable", 1000, 600, -1, -1, $WS_OVERLAPPEDWINDOW) $Button1 = GUICtrlCreateButton("Button1", 900, 60, 90, 33) $Button2 = GUICtrlCreateButton("Button2", 900, 100, 90, 33) Dim $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 900, 600) _IENavigate($oIE, "http://google.com") ;Dim $GUIActiveX2 = GUICtrlCreateObj($oIE2, 0, 300,800,250) ;_IENavigate ($oIE2, "http://images.google.com") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _IENavigate($oIE, "www.autoitscript.com") Case $Button2 _IENavigate($oIE, "http://www.autoitscript.com/forum/") EndSwitch WEnd Thanks Herb191 work perfect
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now