#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Icon=EXE.ico
#PRE_Compression=4
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <Misc.au3>
#include <WinAPI.au3>
HotKeySet("{f6}", "_xsgui")
Opt("GUIOnEventMode", 1)
Dim $Text, $Text2 = "", $URL = "http://844841.gnway.net:81"
Global $sd = 0, $jskl
$dll = DllOpen("user32.dll")
$GUIMain = GUICreate("free", 800, 560,-1,-1,$WS_SIZEBOX)
GUISetOnEvent($GUI_EVENT_CLOSE,"_exit")
$button1 = GUICtrlCreateButton("刷新", 5, 5, 40, 30)
GUICtrlSetOnEvent(-1,"_GUIMainbtclick")
$button2 = GUICtrlCreateButton("后退", 45, 5, 40, 30)
GUICtrlSetOnEvent(-1,"_GUIMainbtclick")
$button3 = GUICtrlCreateButton("前进", 85, 5, 40, 30)
GUICtrlSetOnEvent(-1,"_GUIMainbtclick")
$button4 = GUICtrlCreateButton("固定", 125, 5, 40, 30)
GUICtrlSetOnEvent(-1,"_GUIMainbtclick")
$button5 = GUICtrlCreateButton("锁定", 165, 5, 40, 30)
GUICtrlSetOnEvent(-1,"_GUIMainbtclick")
$button6 = GUICtrlCreateButton("隐藏", 205, 5, 40, 30)
GUICtrlSetOnEvent(-1,"_GUIMainbtclick")
$button7 = GUICtrlCreateButton("重登", 245, 5, 40, 30)
GUICtrlSetOnEvent(-1,"_GUIMainbtclick")
$StateLab = GUICtrlCreateLabel("Label1", 8, 542, 1000, 17)
GUISetState(@SW_SHOW,$GUIMain)
$oIE = _IECreateEmbedded()
GUICtrlCreateObj($oIE, 1, 40, 800, 500)
$EventObject = ObjEvent($oIE, "IEEvent_", "DWebBrowserEvents")
If @error Then Exit MsgBox(0, "错误!", "不可使用COM接口 'DWebBrowserEvents'. 错误代码: " & Hex(@error, 8))
$oIE.Navigate($URL)
Sleep(1000)
GUISwitch($GUIMain)
$form1 = GUICreate("设置解锁口令",200,100,-1,-1,$WS_EX_TOOLWINDOW)
$fomr1input1 = GUICtrlCreateInput("123456",10,10,100,20)
$fomr1button1 = GUICtrlCreateButton("设置",120,10,40,20)
GUICtrlSetOnEvent(-1,"_form1btclick")
GUISetState(@SW_HIDE,$form1)
$form2 = GUICreate("输入解锁口令解锁",200,100,-1,-1,$WS_EX_TOOLWINDOW)
$fomr2input1 = GUICtrlCreateInput("",10,10,100,20)
$fomr2button1 = GUICtrlCreateButton("解锁",120,10,40,20)
GUICtrlSetOnEvent(-1,"_form2btclick")
GUISetState(@SW_HIDE,$form2)
While 1
Sleep(100)
WEnd
Func _form1btclick()
Switch @GUI_CtrlId
Case $fomr1button1
If GUICtrlRead($fomr1input1) <> "" Then
$jskl = GUICtrlRead($fomr1input1)
GUICtrlSetData($fomr1input1,"")
GUISetState(@SW_HIDE,$form1)
GUISetState(@SW_SHOW,$form2)
GUICtrlSetData($fomr2input1,"")
Else
MsgBox(0+16,"错误","口令不允许为空")
endif
EndSwitch
EndFunc
Func _form2btclick()
Switch @GUI_CtrlId
Case $fomr2button1
If GUICtrlRead($fomr2input1) = $jskl Then
GUISetState(@SW_HIDE,$form2)
GUISetState(@SW_SHOW,$GUIMain)
GUISetState(@SW_RESTORE,$GUIMain)
GUISwitch($GUIMain)
$sd = 0
Else
MsgBox(0+16,"错误","口令错误")
EndIf
EndSwitch
EndFunc
Func _GUIMainbtclick()
Switch @GUI_CtrlId
Case $button1
_IEAction($oIE, "Refresh")
Case $button2
_IEAction($oIE, "back")
Case $button3
_IEAction($oIE, "forward")
Case $button4
MsgBox(0, 0, "此按钮没处理")
Case $button5
_sd()
Case $button6
GUISetState(@SW_HIDE,$GUIMain)
MsgBox(0, 0, "F6还原窗口", 1)
Case $button7
_IELinkClickByText($oIE, "退出")
EndSwitch
EndFunc
Func _sd()
$sd = 1
GUISetState(@SW_HIDE,$GUIMain)
GUISetState(@SW_SHOW,$form1)
EndFunc
Func _exit()
Exit
EndFunc
Func _xsgui()
If $sd = 0 Then
GUISetState(@SW_SHOW,$GUIMain)
GUISetState(@SW_RESTORE,$GUIMain)
GUISwitch($GUIMain)
EndIf
EndFunc ;==>_xsgui
Func IEEvent_StatusTextChange($Text)
If $Text <> '' And StringLeft($Text, 4) = "http" Then $Text2 = $Text
GUICtrlSetData($StateLab, $Text)
EndFunc ;==>IEEvent_StatusTextChange