本帖最后由 半芯竹 于 2012-2-5 21:02 编辑
回复 1# pp648852
#include <GuiConstantsEx.au3>
#include <GUIEdit.au3>
#Include <APIConstants.au3>
#Include <WinAPIEx.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#NoTrayIcon
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode",1+2)
Opt("TrayAutoPause",0)
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 320, 200,-1,-1,-1, -1, WinGetHandle(AutoItWinGetTitle()))
$Button1 = GUICtrlCreateButton("Button1", 24, 152, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 208, 152, 75, 25)
Global $prefsitem = TrayCreateItem("参数选择")
TrayItemSetOnEvent($prefsitem, "select1")
Global $aboutitem = TrayCreateItem("关于...")
TrayItemSetOnEvent($aboutitem, "aboutscript")
Global $exititem = TrayCreateItem("退出")
TrayItemSetOnEvent($exititem, "ExitScript")
GUISetState(@SW_SHOW)
TraySetState()
#endregion ### END Koda GUI section ###
TraySetOnEvent ($TRAY_EVENT_PRIMARYDOWN,'show')
TraySetClick (8)
While 1
Switch GUIGetMsg($Form1)
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_HIDE, $Form1)
Case $GUI_EVENT_CLOSE
ExitScript()
Case $Button1
MsgBox(0, '测试1', '只是一个测试')
Case $Button2
MsgBox(0, '测试2', '只是一个测试')
EndSwitch
WEnd
Func Select1()
MsgBox(0,0,'This is a test!')
EndFunc
Func ExitScript()
Exit
EndFunc
Func aboutscript()
MsgBox(0,"关于本程序!","程序版本: 2012.01.20"&@LF&"编译时间: 20012.01.20 "&@LF&"程序作者: 半芯竹."&@LF&"版权所有: Copyright(c) 2012 半芯竹 ."&@LF&"My Blog : JosonYang.Blog.163.com.")
EndFunc
Func show()
GUISetState(@SW_SHOW, $Form1)
WinActivate($Form1)
EndFunc
|