Retrieves the maximum height of a menu
#include <GuiMenu.au3>
_GUICtrlMenu_GetMenuHeight ( $hMenu )
$hMenu | Handle of the menu |
When the menu items exceed the space available, scroll bars are automatically used. The default (0) is the screen height.
#include "Extras\HelpFileInternals.au3"
#include <GuiMenu.au3>
Global $g_hWnd
Example()
Func Example()
Local $hMain, $hFile
; Open Notepad
Run("notepad.exe")
$g_hWnd = WinWaitActive("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($g_hWnd)
$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)
; Get/Set File menu max height
Writeln("File menu max height: " & _GUICtrlMenu_GetMenuHeight($hFile))
_GUICtrlMenu_SetMenuHeight($hFile, 100)
Writeln("File menu max height: " & _GUICtrlMenu_GetMenuHeight($hFile))
_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