#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Constants.au3>
;~ #Include <WinAPIEx.au3>
Opt("GUIOnEventMode",1)
Opt("TrayMenuMode",1)
Opt("TrayOnEventMode",1)
Global $MsgBoard,$Exit,$Login,$Cancel,$WCode = 1,$TrayMouseHover = 0
TraySetOnEvent($TRAY_EVENT_MOUSEOVER,"TrayMouseHover")
TrayTip("鼠标悬停到图标上","鼠标悬停到图标上",15,1)
While $WCode
Sleep(50)
WEnd
Func TrayMouseHover()
If Not $TrayMouseHover Then
$TrayMouseHover = 1
MsgBoard()
EndIf
EndFunc
Func LoginFunc()
MsgBox(0,"","重新登录执行函数")
EndFunc
Func CancelFunc()
MsgBox(0,"","取消执行函数")
EndFunc
Func MsgBoard()
;~ Local $tRECT = _WinAPI_GetWorkArea()
;~ Local $LowerR_X = DllStructGetData($tRECT,'Right')
;~ Local $LowerR_Y = DllStructGetData($tRECT,'Bottom')
;~ $MsgBoard = GUICreate("",200,100,$LowerR_X-300,$LowerR_Y-100,$WS_POPUP+$WS_BORDER,$WS_EX_TOPMOST)
$MsgBoard = GUICreate("",200,100,@DesktopWidth-300,@DesktopHeight-150,$WS_POPUP+$WS_BORDER,$WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)
GUISetBkColor(0xfef9d6)
$Exit = GUICtrlCreateIcon("shell32.dll",-132,180,6,16,16,BitOR($SS_NOTIFY,$WS_GROUP,$WS_TABSTOP))
GUICtrlSetCursor(-1,0)
GUICtrlSetTip(-1,"Exit")
GUICtrlSetOnEvent(-1,"GUIFunction")
$Login = GUICtrlCreateLabel("重新登录",100,80,50,18)
GUICtrlSetCursor(-1,0)
GUICtrlSetColor(-1,0x0000c6)
GUICtrlSetTip(-1,"重新登录")
GUICtrlSetOnEvent(-1,"GUIFunction")
$Cancel = GUICtrlCreateLabel("取消",165,80,30,18)
GUICtrlSetCursor(-1,0)
GUICtrlSetColor(-1,0x0000c6)
GUICtrlSetTip(-1,"取消")
GUICtrlSetOnEvent(-1,"GUIFunction")
GUISetState()
EndFunc
Func GUIFunction()
Switch @GUI_CtrlId
Case $Exit
$WCode = 0
Case $Login
LoginFunc()
Case $Cancel
CancelFunc()
EndSwitch
EndFunc