MZXPTLK Posted August 26, 2010 Share Posted August 26, 2010 (edited) I do some test with adding menuentries to existing programs. Found '_GUICtrlMenu_GetMenuDefaultItem.au3' sample that uses notepad.exe (in AutoIt examples). It should return the DefaultMenuItems. The sample seems to not work, because "_GUICtrlMenu_GetMenuDefaultItem($hFile))" returns -1. I heared about that some Autoit Menu functions don't work with newer menus. Is this correct? Manfred #include <GuiMenu.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() 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) ; Get/Set File menu default item Writeln("File menu default item: " & _GUICtrlMenu_GetMenuDefaultItem($hFile)) _GUICtrlMenu_SetMenuDefaultItem($hFile, 1) Writeln("File menu default item: " & _GUICtrlMenu_GetMenuDefaultItem($hFile)) EndFunc ;==>_Main ; Write a line of text to Notepad Func Writeln($sText) ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CR) EndFunc ;==>Writeln Edited August 26, 2010 by MZXPTLK Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 26, 2010 Share Posted August 26, 2010 It doesn't look to me like Notepad has a default MenuItem. What do you really expect of that script? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
MZXPTLK Posted August 26, 2010 Author Share Posted August 26, 2010 It doesn't look to me like Notepad has a default MenuItem. What do you really expect of that script? Yes, maybe, I don't know.I thought the first items in each menu are returned!?That's why I'm asking.But why did the Autoit developers create this script? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now