# Function Reference

# _GUICtrlMenu_GetMenuInfo

Retrieves information about a specified menu

#include <GuiMenu.au3>
_GUICtrlMenu_GetMenuInfo ( $hMenu )

## Parameters

$hMenu | Handle of the menu

## Return Value

Success: | a $tagMENUINFO structure.
Failure: | sets the @error flag to non-zero.

## Related

$tagMENUINFO, _GUICtrlMenu_SetMenuInfo

## See Also

Search GetMenuInfo in MSDN Library.

## Example

    #include "Extras\HelpFileInternals.au3"

    #include <GuiMenu.au3>
    #include <StructureConstants.au3>

    Global $g_hWnd

    Example()

    Func Example()
        Local $hMain, $hFile, $tInfo

        ; Open Notepad
        Run("notepad.exe")
        $g_hWnd = WinWaitActive("[CLASS:Notepad]")
        $hMain = _GUICtrlMenu_GetMenu($g_hWnd)
        $hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)

        ; Get/Set File menu information
        $tInfo = _GUICtrlMenu_GetMenuInfo($hFile)
        Writeln("Menu style ..........: " & DllStructGetData($tInfo, "Style"))
        Writeln("Menu max height .....: " & DllStructGetData($tInfo, "YMax"))
        Writeln("Menu background brush: " & DllStructGetData($tInfo, "hBack"))
        Writeln("Menu context help ID : " & DllStructGetData($tInfo, "ContextHelpID"))
        Writeln("Menu data ...........: " & DllStructGetData($tInfo, "MenuData"))
        Writeln("")
        $tInfo = DllStructCreate($tagMENUINFO)
        DllStructSetData($tInfo, "Size", DllStructGetSize($tInfo))
        DllStructSetData($tInfo, "Mask", BitOR($MIM_HELPID, $MIM_MAXHEIGHT, $MIM_MENUDATA))
        DllStructSetData($tInfo, "YMax", 100)
        DllStructSetData($tInfo, "ContextHelpID", 1234)
        DllStructSetData($tInfo, "MenuData", 4567)
        _GUICtrlMenu_SetMenuInfo($hFile, $tInfo)
        $tInfo = _GUICtrlMenu_GetMenuInfo($hFile)
        Writeln("Menu style ..........: " & DllStructGetData($tInfo, "Style"))
        Writeln("Menu max height .....: " & DllStructGetData($tInfo, "YMax"))
        Writeln("Menu background brush: " & DllStructGetData($tInfo, "hBack"))
        Writeln("Menu context help ID : " & DllStructGetData($tInfo, "ContextHelpID"))
        Writeln("Menu data ...........: " & DllStructGetData($tInfo, "MenuData"))
        Writeln("")

        _NotepadForceClose($g_hWnd)
    EndFunc   ;==>Example

    ; Write a line of text to Notepad
    Func Writeln($sText, $hWnd = $g_hWnd)
        ControlSend($hWnd, "", ControlGetFocus($hWnd), $sText & @CRLF)
    EndFunc   ;==>Writeln