欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基 礎(chǔ) 函 數(shù) 參 考


TrayItemGetHandle

返回托盤菜單或菜單項目的句柄.

TrayItemGetHandle ( 控件ID )

參 數(shù)

控件ID TrayCreateItemTrayCreateMenu 函數(shù)返回的控件標識符.

返 回 值

成功: 返回指定控件ID的句柄.
失敗: 返回 0.

備 注

要獲取托盤上下文菜單本身的句柄, 設(shè)置 "控件ID" 參數(shù)值為 0 即可.

相 關(guān) 函 數(shù)

TrayItemGetState, TrayItemGetText

函 數(shù) 示 例


#include <Constants.au3>

Opt("TrayMenuMode", 1) ; 不顯示托盤的默認上下文菜單

Global Const $MIM_APPLYTOSUBMENUS = 0x80000000
Global Const $MIM_BACKGROUND = 0x00000002

TraySetIcon("shell32.dll", 21)
TraySetToolTip("顯示彩色托盤菜單" & @LF & "需要 Windows 2000 或更高版本的支持.")

Local $OptionsMenu = TrayCreateMenu("選項")
TrayCreateItem("總在最上", $OptionsMenu)
TrayItemSetState(-1, $TRAY_CHECKED)
TrayCreateItem("總是重復(fù)", $OptionsMenu)
TrayCreateItem("")
Local $AboutItem = TrayCreateItem("關(guān)于...")
TrayCreateItem("")
Local $ExitItem = TrayCreateItem("退出示例")

SetMenuColor(0, 0xEEBB99) ; BGR 顏色值,'0' 表示獲取托盤上下文菜單本身的句柄
SetMenuColor($OptionsMenu, 0x66BB99); BGR 顏色值

While 1
    Local $Msg = TrayGetMsg()

    Switch $Msg
        Case $ExitItem
            ExitLoop

        Case $AboutItem
            MsgBox(64, "關(guān)于...", "彩色托盤菜單演示")
    EndSwitch
WEnd

Exit


; 應(yīng)用菜單顏色
Func SetMenuColor($nMenuID, $nColor)
    Local $hMenu = TrayItemGetHandle($nMenuID) ; 獲取菜單句柄

    Local $hBrush = DllCall("gdi32.dll", "hwnd", "CreateSolidBrush", "int", $nColor)
    $hBrush = $hBrush[0]

    Local $stMenuInfo = DllStructCreate("dword;dword;dword;uint;ptr;dword;ptr")
    DllStructSetData($stMenuInfo, 1, DllStructGetSize($stMenuInfo))
    DllStructSetData($stMenuInfo, 2, BitOR($MIM_APPLYTOSUBMENUS, $MIM_BACKGROUND))
    DllStructSetData($stMenuInfo, 5, $hBrush)

    DllCall("user32.dll", "int", "SetMenuInfo", "hwnd", $hMenu, "ptr", DllStructGetPtr($stMenuInfo))
EndFunc   ;==>SetMenuColor

provider with jb51.net (unicode)