如图所示的菜单如何读取?下面的程序读到的数据不对,谢谢。
#include <GuiMenu.au3>
Opt('MustDeclareVars', 1)
Local $hWnd, $hMain, $hFile
; Open Notepad
;ATL_MCMDIMainFrame
WinActivate("MultiCharts", "")
WinWaitActive("MultiCharts", "")
$hWnd = WinGetHandle("[CLASS:ATL_MCMDIMainFrame]")
If @error Then
MsgBox(4096, "错误", "不能找到指定窗口")
Else
$hMain = _GUICtrlMenu_GetMenu($hWnd)
MsgBox(4096, "提示:hmain:=", $hMain)
$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 1)
MsgBox(4096, "提示:hfile:=", $hFile)
; Get Open item state
;_GUICtrlMenu_SetItemChecked($hFile, 1)
MsgBox(0, "提示", "State: " & _GUICtrlMenu_GetItemState($hFile, 2) & " Text:" & _GUICtrlMenu_GetItemText($hFile, 2))
EndIf |