boyhong 发表于 2012-12-2 10:25:34

请教使用ModernMenu中的ICO start flashing的不能执行。。

请教使用ModernMenu中的ICO start flashing的不能执行。。
ModernMenuRaw.au3可在:http://www.autoitscript.com/forum/topic/20967-guitray-menu-with-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

boyhong 发表于 2012-12-8 09:58:19

顶一下~~谢谢~~~
页: [1]
查看完整版本: 请教使用ModernMenu中的ICO start flashing的不能执行。。