#include <GuiMenu.au3>
Run('Notepad.exe')
WinWaitActive('[CLASS:Notepad]')
$hWnd = WinGetHandle('[CLASS:Notepad]')
$hMain = _GUICtrlMenu_GetMenu($hWnd)
$str = ''
$n_Menu = _GUICtrlMenu_GetItemCount($hMain)
For $i = 0 To $n_Menu - 1
$str &= _GUICtrlMenu_GetItemText($hMain, $i) & @CRLF & '==================' & @CRLF
$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, $i)
$n_SubMenu = _GUICtrlMenu_GetItemCount($hFile)
For $x = 0 To $n_SubMenu - 1
$ss = _GUICtrlMenu_GetItemText($hFile, $x)
If $ss = '' Then $ss = '————————————'
$str &= ' ' & $ss & @CRLF
Next
$str &= @CRLF & @CRLF
Next
MsgBox(0, 0, $str)
WinClose($hWnd)
|