Function Reference


_GUICtrlMenu_SetItemType

Sets the menu item type

#include <GuiMenu.au3>
_GUICtrlMenu_SetItemType ( $hMenu, $iItem, $iType [, $bByPos = True] )

Parameters

$hMenu Menu handle
$iItem Identifier or position of the menu item
$iType Menu item type. This can be one or more of the following values:
    $MFT_BITMAP - Item is displayed using a bitmap
    $MFT_MENUBARBREAK - Item is placed on a new line. A vertical line separates the new column from the old.
    $MFT_MENUBREAK - Item is placed on a new line. The columns are not separated by a vertical line.
    $MFT_OWNERDRAW - Item is owner drawn
    $MFT_RADIOCHECK - Item is displayed using a radio button mark
    $MFT_RIGHTJUSTIFY - Item is right justified
    $MFT_RIGHTORDER - Item cascades from right to left
    $MFT_SEPARATOR - Item is a separator
$bByPos [optional] Menu identifier flag:
    True - $iItem is a 0-based item position
    False - $iItem is a menu item identifier

Return Value

Success: True.
Failure: False.

Related

_GUICtrlMenu_GetItemType

Example

#include <GuiMenu.au3>

Example()

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

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

    ; Change Open item type
    Writeln("Open item type: 0x" & Hex(_GUICtrlMenu_GetItemType($hFile, 1)))
    _GUICtrlMenu_SetItemType($hFile, 1, $MFT_RADIOCHECK)
    _GUICtrlMenu_CheckRadioItem($hFile, 0, 8, 1)
    Writeln("Open item type: 0x" & Hex(_GUICtrlMenu_GetItemType($hFile, 1)))
EndFunc   ;==>Example

; Write a line of text to Notepad
Func Writeln($sText)
    ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CRLF)
EndFunc   ;==>Writeln