本帖最后由 happytc 于 2011-2-18 09:47 编辑
看了,这个玩意ModerMenu默认不提供这个功能,就只好用下面的“暴力”方法了
#Include <GuiToolBar.au3>
PseuTrayMenu()
Func PseuTrayMenu()
Local $hTray = WinGetHandle("[CLASS:Shell_TrayWnd]")
Local $hToolbar = ControlGetHandle($hTray, "", "[CLASSNN:ToolbarWindow321]")
Local $iCnt = _GUICtrlToolbar_ButtonCount($hToolbar)
Local $iCmdTrue = -1
Local $sText, $iCmd
For $n = 0 To $iCnt - 1
$iCmd = _GUICtrlToolbar_IndexToCommand($hToolbar, $n)
$sText = _GUICtrlToolbar_GetButtonText($hToolbar, $iCmd)
If StringInStr($sText, "MyProgram") Then
$iCmdTrue = $iCmd
ExitLoop
EndIf
Next
_GUICtrlToolbar_SetButtonState($hToolbar, $iCmdTrue, $TBSTATE_HIDDEN)
Sleep(5000)
_GUICtrlToolbar_SetButtonState($hToolbar, $iCmdTrue, $TBSTATE_ENABLED)
EndFunc
|