Deletes a menu item or detaches a submenu from the specified menu
#include <GuiMenu.au3>
_GUICtrlMenu_RemoveMenu ( $hMenu, $iItem [, $bByPos = True] )
$hMenu | Handle to the menu to be changed |
$iItem | Identifier or position of the menu item |
$bByPos | [optional] Menu identifier flag: True - $iItem is a 0-based item position False - $iItem is a menu item identifier |
Success: | True. |
Failure: | False. |
If the menu item opens a drop down menu or submenu, _GUICtrlMenu_RemoveMenu() does not destroy the menu or its handle, allowing the menu to be reused.
Before this function is called, the _GUICtrlMenu_GetItemSubMenu() function should be used retrieve a handle to the drop-down menu or submenu.
Search RemoveMenu in MSDN Library.
#include <GuiMenu.au3>
Example()
Func Example()
Local $hWnd, $hMain
; Open Notepad
Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]")
$hWnd = WinGetHandle("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($hWnd)
; Remove Help menu
_GUICtrlMenu_RemoveMenu($hMain, 4)
EndFunc ;==>Example