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

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


GUICtrlGetHandle

返回控件或特定項目(Menu, ContextMenu, TreeViewItem)的句柄.

GUICtrlGetHandle ( 控件ID )

參 數(shù)

控件ID GUICtrlCreate... 返回的控件標識符

返 回 值

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

備 注

! 不支持右列控件: Dummy, Graphic, Object, ListViewItem 與 TabItem !

ListViewItems 與 TabItems 使用索引管理.
要獲取這些項目的索引請使用 DllCall()DllStructCreate().

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

IsHWnd

函 數(shù) 示 例


#include <GUIConstantsEx.au3>

Example()

Func Example()
    Local $FileMenu, $OptionsMenu
    Local $exititem , $HelpMenu, $aboutitem
    Local $EndBtn, $Msg


    GUICreate("我的 GUI", 300, 200)

    $FileMenu = GUICtrlCreateMenu("文件 &F")
    GUICtrlCreateMenuItem ("打開 &O", $FileMenu)
    GUICtrlCreateMenuItem ("保存 &S", $FileMenu)
    GUICtrlCreateMenuItem ("", $FileMenu)

    $OptionsMenu = GUICtrlCreateMenu("選項 &p", $FileMenu)
    GUICtrlCreateMenuItem ("查看", $OptionsMenu)
    GUICtrlCreateMenuItem ("", $OptionsMenu)
    GUICtrlCreateMenuItem ("工具", $OptionsMenu)

    GUICtrlCreateMenuItem ("", $FileMenu)
    $exititem  = GUICtrlCreateMenuItem ("退出 &E", $FileMenu)

    $HelpMenu = GUICtrlCreateMenu("&?")
    $aboutitem  = GUICtrlCreateMenuItem ("關(guān)于... &A", $HelpMenu)

    $EndBtn = GUICtrlCreateButton("結(jié)束", 110, 140, 70, 20)

    SetMenuColor($FileMenu, 0xEEBB99) ; BGR 顏色值
    SetMenuColor($OptionsMenu, 0x66BB99); BGR 顏色值
    SetMenuColor($HelpMenu, 0x99BBEE) ; BGR 顏色值

    GUISetState()

    While 1
        $Msg = GUIGetMsg()

        Switch $Msg
            Case $exititem , $EndBtn, $GUI_EVENT_CLOSE
                ExitLoop

            Case $aboutitem
                MsgBox(64, "關(guān)于...", "彩色菜單示例")
        EndSwitch
    WEnd
EndFunc   ;==>Example


; 將顏色應(yīng)用到菜單
Func SetMenuColor($nMenuID, $nColor)
    Local $hMenu, $hBrush, $stMenuInfo
    Local Const $MIM_APPLYTOSUBMENUS = 0x80000000
    Local Const $MIM_BACKGROUND = 0x00000002

    $hMenu = GUICtrlGetHandle($nMenuID)

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

    $stMenuInfo = DllStructCreate("dword;dword;dword;uint;dword;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))

    ; 釋放結(jié)構(gòu)不是真正需要的, 因為它只是一個局部結(jié)構(gòu)
    $stMenuInfo = 0
EndFunc   ;==>SetMenuColor

provider with jb51.net (unicode)