以下代码点击关闭后,双击托盘后,恢复原来的窗口,但是再点击关才时不能再隐藏了,请高手指点一下!#include <Constants.au3>
#include<ie.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <Constants.au3>
#include <ButtonConstants.au3>
#NoTrayIcon
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)
;默认菜单项目 (脚本暂停中/退出) 将不会显示.
$exititem = TrayCreateItem("退出")
TraySetState()
TraySetClick(16)
XIAO()
ds2()
Func ds2()
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"SpecialEvent")
TraySetOnEvent($TRAY_EVENT_SECONDARYUP,"SpecialEvent")
TraySetState()
EndFunc
While 1
$msg = GUIGetMsg()
Sleep(10) ; 空闲循环
WEnd
Exit
; Functions
Func SpecialEvent()
Select
Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOUBLE
GUISetState(@SW_SHOW )
Case @TRAY_ID = $TRAY_EVENT_SECONDARYUP
Msgbox(64,"SpecialEvent-Info","次鼠标键双击.")
Exit
EndSelect
EndFunc
Func ExitEvent()
Exit
EndFunc
Func XIAO() ;增
$oIE = _IECreateEmbedded ()
GUICreate(" 百度",860,632, -1,-1 , 0x04000000 + 0x00CF0000)
$GUIActiveX = GUICtrlCreateObj($oIE, 2, 2, 880, 680)
GUICtrlSetResizing($GUIActiveX , 0x0001)
GUISetState()
_IENavigate ($oIE, "http://www.baidu.com")
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Msgbox(64,"SpecialEvent-Info","次鼠标键双击.")
GUISetState(@SW_HIDE)
ExitLoop
EndSelect
WEnd
EndFunc
Func _XIAO() ;增
GUISetState(@SW_HIDE)
EndFunc
|