回复 8# qwe4919705
你说的是像QQ那样吗? 你说的是运行的时候托盘不显示,最小化显示到托盘,双击托盘恢复窗口吗?#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#Region ### START Koda GUI section ### Form=
#NoTrayIcon
Dim $Exit
$Exit = ""
$Form1 = GUICreate("Form1", 637, 468, 192, 124)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Opt("TrayMenuMode", 3)
$Exit = TrayCreateItem("退 出")
TraySetState()
TraySetClick(16)
Opt("TrayOnEventMode", 1)
;TraySetState()
Opt("TrayIconHide", 1)
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "show")
;TraySetOnEvent($TRAY_EVENT_SECONDARYUP, "quit")
Global $trayMsg
While 1
$nMsg = GUIGetMsg()
$trayMsg = TrayGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_MINIMIZE
Opt("TrayIconHide", 0)
GUISetState(@SW_HIDE, $Form1)
EndSwitch
Select
Case $trayMsg = $Exit
Exit
EndSelect
WEnd
Func show()
Opt("TrayIconHide", 1)
GUISetState(@SW_SHOW, $Form1)
EndFunc ;==>show
Func quit()
EndFunc ;==>quit
|