#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $oIE, $GUIActiveX, $GUI_Button_Back, $GUI_Button_Forward, $GUI_Button_Leixing,$GUI_CHECKED
Local $GUI_Button_Home, $GUI_Button_Stop, $msg, $oForm, $oText,$cols,$lForm
$oIE = ObjCreate("Shell.Explorer.2")
GUICreate("工单系统", 800, 600, (@DesktopWidth - 800) / 2, (@DesktopHeight - 600) / 2, BitOR($WS_CAPTION,$WS_POPUP,$WS_SYSMENU))
$GUIActiveX = GUICtrlCreateObj ($oIE, -230, -250, 1024, 750)
$GUI_Button_Back = GUICtrlCreateButton("填入IP", 10, 550, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton("刷新", 230, 550, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton("关闭", 470, 550, 100, 30)
GUISetState()
$oIE.navigate("http://www.baidu.com")
_IELoadWait($oIE,1000)
_IEHeadInsertEventScript ($oIE, "document", "oncontextmenu", "alert('No Context Menu');return false")
; Waiting for user to close the window
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Home
Case $msg = $GUI_Button_Back
$oForm = _IEFormGetObjByName ($oIE, "ds")
$oText = _IEFormElementGetObjByName ($oForm, "example1")
_IEFormElementSetValue ($oText, "116.255.150.243")
Case $msg = $GUI_Button_Forward
Send("{F5}")
Case $msg = $GUI_Button_Leixing
Case $msg = $GUI_Button_Stop
Exit
EndSelect
WEnd
GUIDelete()
EndFunc