找回密码
 加入
搜索
查看: 3060|回复: 1

[AU3基础] 请教使用ModernMenu中的ICO start flashing的不能执行。。

[复制链接]
发表于 2012-12-2 10:25:34 | 显示全部楼层 |阅读模式
请教使用ModernMenu中的ICO start flashing的不能执行。。
ModernMenuRaw.au3可在:http://www.autoitscript.com/foru ... h-icons-and-colors/ 的贴子附件里下载获得。
如下例子所示,我想实现点击托盘菜单里的$TrayHelp理论上会start flashing啊。。。难道:_TrayIconSetState($nTrayIcon1, 5) ; 不是这么用?
希望有经验的朋友帮忙测试一下。感谢。
#NoTrayIcon
#include <GUIConstants.au3>
#include "ModernMenuRaw.au3" ; Only unknown constants are declared here
Global $nTrayIcon2=0
Opt("GUIOnEventMode", 1) ; This is for both - GUI and Tray ownerdrawn menu items

;Create the tray icon
$nTrayIcon1                = _TrayIconCreate("Tools", "shell32.dll", -13)
_TrayIconSetClick(-1, 16)
_TrayIconSetState() ; Show the tray icon

; *** Create the tray context menu ***
$nTrayMenu1                = _TrayCreateContextMenu() ; is the same like _TrayCreateContextMenu(-1) or _TrayCreateContextMenu($nTrayIcon1)
$nSideItem3                = _CreateSideMenu($nTrayMenu1)
_SetSideMenuText($nSideItem3, "My Tray Menu")
_SetSideMenuColor($nSideItem3, 0x00FFFF) ; yellow; default color - white
_SetSideMenuBkColor($nSideItem3, 0x802222) ; bottom start color - dark blue
_SetSideMenuBkGradColor($nSideItem3, 0x4477AA) ; top end color - orange

$MenuMenu                = _TrayCreateMenu("Menu") ; is the same like _TrayCreateMenu("Menu", -1) or _TrayCreateMenu("Menu", $nTrayMenu1)
_TrayCreateItem("")
_TrayItemSetIcon(-1, "", 0)

$TrayHelp                = _TrayCreateItem("flashing")
_TrayCreateItem("")
_TrayItemSetIcon($TrayHelp, "shell32.dll", -24)
GUICtrlSetState($TrayHelp, $GUI_DEFBUTTON)

GUICtrlSetOnEvent($TrayHelp, "MenuEvents")
$TrayExit                = _TrayCreateItem("Exit")
_TrayItemSetIcon($TrayExit, "shell32.dll", -28)
GUICtrlSetOnEvent($TrayExit, "MenuEvents")
_TrayItemSetIcon($MenuMenu, "", 0)

_TrayIconSetState()
While 1
        Sleep(10)        
WEnd
Exit

Func MenuEvents()
        Local $Msg = @GUI_CtrlID
        
        Switch $Msg
                Case $TrayExit
                        Exit
                Case $TrayHelp
                        _TrayIconSetState($nTrayIcon1, 5) ; Show icon and start flashing -> 1 + 4
        EndSwitch
EndFunc
 楼主| 发表于 2012-12-8 09:58:19 | 显示全部楼层
顶一下~~谢谢~~~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 21:06 , Processed in 0.109418 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表