本帖最后由 xwt620 于 2011-10-19 21:12 编辑
回复 2# zcx880517
研究了一下,这个相当于是用gui创建的系统托盘#include "ModernMenuRaw.au3"
#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
Opt("TrayMenuMode",1)
$nTrayIcon1 = _TrayIconCreate("Tools", "shell32.dll", -13)
_TrayIconSetClick(-1, 16)
_TrayIconSetState()
$nTrayMenu1 = _TrayCreateContextMenu() ;没有这个点击右键则无反应
$TrayAbout = _TrayCreateItem("关于")
$TrayRun = _TrayCreateItem("运行")
_TrayCreateItem("")
_TrayItemSetIcon(-1, "", 0)
$TrayExit = _TrayCreateItem("退出")
GUICtrlSetState($TrayAbout , $GUI_DEFBUTTON)
GUICtrlSetOnEvent($TrayAbout , "MenuEvents")
GUICtrlSetOnEvent($TrayExit, "MenuEvents")
Func MenuEvents()
Local $Msg = @GUI_CtrlID
Switch $Msg
Case $GUI_EVENT_CLOSE, $TrayExit
_TrayIconDelete($nTrayIcon1)
Exit
Case $TrayAbout
MsgBox(64,"关于:","AutoIt3-托盘-例子")
EndSwitch
EndFunc
While 1
Sleep(10)
WEnd
那么有没有不用UDF的方式设置Autoit的系统托盘的字体样式呢?
因为我在单位的电脑上没有这个UDF,也就意味着这个方式我用不了啊 |