稍微改动了下官方帮助里的例子,多看帮助!!!#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 640, 580, _
(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
$GUI_Input = GUICtrlCreateInput("http://www.baidu.com",20,420,400,20)
$GUI_Button_Go = GUICtrlCreateButton("Go", 430, 420, 50, 20)
$GUI_Button_Back = GUICtrlCreateButton("Back", 10, 470, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 470, 100, 30)
$GUI_Button_Home = GUICtrlCreateButton("Home", 230, 470, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 470, 100, 30)
GUISetState() ;Show GUI
_IENavigate ($oIE, "http://www.baidu.com")
; Waiting for user to close the window
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Home
_IENavigate ($oIE, "http://www.baidu.com")
Case $msg = $GUI_Button_Back
_IEAction ($oIE, "back")
Case $msg = $GUI_Button_Forward
_IEAction ($oIE, "forward")
Case $msg = $GUI_Button_Stop
_IEAction ($oIE, "stop")
Case $msg = $GUI_Button_Go
_IENavigate ($oIE, GUICtrlRead($GUI_Input))
EndSelect
WEnd
GUIDelete()
Exit
|