#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=C:\Documents and Settings\Administrator\桌面\testtray.exe
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include "ModernMenuRaw.au3" ;没有它就没有Tray ICON的建立
#include "SystemTools.au3" ;系统工具菜单功能由改文件实现
$nTrayIcon1 = _TrayIconCreate("托盘菜单示例", "shell32.dll", -40);创建托盘图标
_TrayIconSetClick(-1, 16) ;是设置托盘右键单击显示菜单吗?
$bUseAdvTrayMenu = FALSE;菜单样式(可取值 TRUE 和 False),托盘显示风格不同啊!
$nTrayMenu1 = _TrayCreateContextMenu() ;创建托盘上下文菜单,即右键点击托盘图标显示的菜单
$nSideItem3 = _CreateSideMenu($nTrayMenu1) ; 在上下文菜单上建立侧面菜单
_SetSideMenuText($nSideItem3, "我的菜单");设置侧面菜单文本即左边竖条显示的文字
_SetSideMenuColor($nSideItem3, 0xFFFFFF) ;设置侧面菜单文字颜色
_SetSideMenuBkColor($nSideItem3, 0x802222);设置侧面菜单文字背景开始颜色
_SetSideMenuBkGradColor($nSideItem3, 0x4477AA) ;设置侧面菜单文字背景结束颜色
$FrequtentlyTroubleFixed = _TrayCreateMenu("常见故障解决");创建托盘菜单
_TrayItemSetIcon($FrequtentlyTroubleFixed, @WindowsDir&"\regedit.exe", 0);设置托盘菜单图标
$DieMachine=_TrayCreateItem("假死机", $FrequtentlyTroubleFixed, -1, 1) ;创建托盘菜单“常见故障解决”下的托盘菜单项
_TrayItemSetIcon($DieMachine, "shell32.dll", -24) ;创建菜单项的图标,图标库都来源于系统自带 的shell32.dll
;_TrayItemSetIcon($DieMachine, "", 0) ;创建菜单项的图标
_TrayCreateItem("") ;创建与下一个托盘菜单(项)的分隔线
$CleanVirus=_TrayCreateItem("清理病毒")
_TrayItemSetIcon($CleanVirus, "shell32.dll", -164)
$PatchsManager=_TrayCreateItem("补丁管理")
_TrayItemSetIcon($PatchsManager, "shell32.dll", -165)
$SecurityTools=_TrayCreateMenu("安全工具")
_TrayItemSetIcon($SecurityTools, "shell32.dll", -166)
_TrayCreateItem("")
$SystemOptimization=_TrayCreateMenu("系统优化")
_TrayItemSetIcon($SystemOptimization, "shell32.dll", -167)
_TrayCreateItem("")
$SEP=_TrayCreateMenu("SEP问题解决集锦")
_TrayItemSetIcon($SEP, "shell32.dll", -168)
_TrayCreateItem("")
$SystemTools=_TrayCreateMenu("系统工具")
_TrayItemSetIcon($SystemTools, "shell32.dll", -169)
$Msconfig=_TrayCreateItem("系统配置实用程序",$SystemTools,-1,1)
GUICtrlSetOnEvent($Msconfig,"_SystemToolsEvent")
_TrayItemSetIcon($Msconfig,"shell32.dll",-2)
$MSTSC=_TrayCreateItem(" 远程登陆",$SystemTools,-1,1)
_TrayItemSetIcon($MSTSC,"shell32.dll",-3)
$TaskManager=_TrayCreateItem("任务管理器",$SystemTools,-1,1)
_TrayItemSetIcon($TaskManager,"shell32.dll",-4)
$DiskClean=_TrayCreateItem("磁盘清理",$SystemTools,-1,1)
_TrayItemSetIcon($DiskClean,"shell32.dll",-5)
$Defrag=_TrayCreateItem("磁盘碎片整理",$SystemTools,-1,1)
_TrayItemSetIcon($Defrag,"shell32.dll",-6)
$SystemAttribute=_TrayCreateItem("系统属性",$systemtools,-1,1)
_TrayItemSetIcon($SystemAttribute,"shell32.dll",-7)
$SystemInfo=_TrayCreateItem("系统信息",$SystemTools,-1,1)
_TrayItemSetIcon($SystemInfo,"shell32.dll",-8)
$UserAccount=_TrayCreateItem("用户帐户",$systemtools,-1,1)
_TrayItemSetIcon($UserAccount,"shell32.dll",-9)
$LocalSecuritySetting=_TrayCreateItem("本地安全设置",$systemtools,-1,1)
_TrayItemSetIcon($LocalSecuritySetting,"shell32.dll",-10)
$AreaAndLanguageOption=_TrayCreateItem("区域和语言选项",$systemtools,-1,1)
_TrayItemSetIcon($AreaAndLanguageOption,"shell32.dll",-11)
$ShareFolder=_TrayCreateItem("共享文件夹",$systemtools,-1,1)
_TrayItemSetIcon($ShareFolder,"shell32.dll",-12)
$AddAndDeleteProgram=_TrayCreateItem("添加和删除程序",$systemtools,-1,1)
_TrayItemSetIcon($AddAndDeleteProgram,"shell32.dll",-13)
_TrayCreateItem("")
$AboutWebs=_TrayCreateMenu("相关网站")
_TrayItemSetIcon($AboutWebs, "shell32.dll", -170)
_TrayCreateItem("")
$OnlineUpdate=_TrayCreateMenu("在线更新")
_TrayItemSetIcon($OnlineUpdate, "shell32.dll", -171)
_TrayCreateItem("")
$AboutMe=_TrayCreateItem("关于")
_TrayItemSetIcon($AboutMe, "shell32.dll", -172)
_TrayCreateItem("")
$TrayExit=_TrayCreateItem("退出")
_TrayItemSetIcon($TrayExit, "shell32.dll", -173)
_TrayItemSetIcon(-1, "shell32.dll", -28)
_TrayIconSetState(); 显示托盘图标,就是$nTrayIcon1 所代表的图标
While 1
Sleep(2000)
WEnd
Func _SystemToolsEvent()
Local $nMsg=@GUI_CtrlId
Select
Case $nMsg=$TrayExit ;根据捕获的信息进行响应操作,如捕获的是$TrayExit=_TrayCreateItem("退出")执行它相关语句
Exit
Case $nMsg=$AboutMe
Msgbox(64,"关于","托盘菜单示例")
Case $nMsg=$Msconfig ;以下是完成“系统工具”菜单下的各个功能
_Msconfig()
Case $nMsg=$MSTSC
_Mstsc()
Case $nMsg=$TaskManager
_TaskManager()
Case $nMsg=$DiskClean
_DiskClean()
Case $nMsg=$Defrag
_DiskDfrag()
Case $nMsg=$SystemAttribute
_DiskAttribute()
Case $nMsg=$SystemInfo
_SystemInfo()
Case $nMsg=$UserAccount
_UserAccount()
Case $nMsg=$LocalSecuritySetting
_LocalSecuritySetting()
Case $nMsg=$AreaAndLanguageOption
_AreaAndLagurage()
Case $nMsg=$ShareFolder
_ShareFolder()
Case $nMsg=$AddAndDeleteProgram
_AddAndDelete() ;结束“系统工具”菜单下的各个功能
EndSelect
EndFunc
_TrayIconDelete($nTrayIcon1);退出菜单