serena_knight Posted July 15, 2021 Share Posted July 15, 2021 the following code was adopted form various topics vis the search to try to click on file then get click on an item under file $winh = winactivate("Power") $menuh = _guictrlmenu_getmenu($winh) $titletxt = _guictrlmenu_getitemtext($menuh,0) ; get File ; returns &File $rc = winmenuselectitem($winh, "", $titletxt) ; returns 0 ; tied $rc = winmenuselectitem(menuh,"", $titletxt) ; also returns 0 i need to click on File to get the dropdown can you help? Link to comment Share on other sites More sharing options...
Nine Posted July 15, 2021 Share Posted July 15, 2021 The handle of WinMenuSelectItem function is the handle of the window, not the handle of the menu... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
serena_knight Posted July 15, 2021 Author Share Posted July 15, 2021 yes that why i tried both and neither works Link to comment Share on other sites More sharing options...
serena_knight Posted July 15, 2021 Author Share Posted July 15, 2021 note i tried $rc = winmenuselectitem($winh, "", $titletxt) which points to the window handle it does not works,,, returns a 0 Link to comment Share on other sites More sharing options...
Nine Posted July 15, 2021 Share Posted July 15, 2021 As per help file : Quote WinMenuSelectItem() will only work on standard menus. Unfortunately, many menus in use today are actually custom written or toolbars "pretending" to be menus. This is true for most Microsoft applications. Try to make it worked with Notepad first. We will be able to assist you since we do not have your application. And use this tool, when you post code. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
serena_knight Posted July 15, 2021 Author Share Posted July 15, 2021 $winh = winactivate("notepad") $menuh = _guictrlmenu_getmenu($winh) $titletxt = _guictrlmenu_getitemtext($menuh,0) ; get File ; returns &File $rc = winmenuselectitem($winh, "", $titletxt) ; returns 0 ok i used notepad ..same thing Link to comment Share on other sites More sharing options...
Nine Posted July 15, 2021 Share Posted July 15, 2021 Try this : #include <GuiMenu.au3> #include <Array.au3> Run ("notepad.exe") $winh = WinWait("[CLASS:Notepad]") ConsoleWrite($winh & @CRLF) $menuh = _guictrlmenu_getmenu($winh) $titletxt = _guictrlmenu_getitemtext($menuh,0) ; get File ConsoleWrite($titletxt & @CRLF) $aRect = _GUICtrlMenu_GetItemRect($winh, $menuh, 0) ;_ArrayDisplay($aRect) MouseClick("left", $aRect[0]+10, $aRect[1]+5, 1, 1) “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
serena_knight Posted July 15, 2021 Author Share Posted July 15, 2021 this is not making any sense, i have done this before and guess what ? the following is returning a 0 instead of a handle. no changes to the code $winh = winactivate("notepad") Link to comment Share on other sites More sharing options...
Nine Posted July 15, 2021 Share Posted July 15, 2021 Your winactivate statement is wrong, you need to use CLASS like I did. Or use exact title... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
serena_knight Posted July 15, 2021 Author Share Posted July 15, 2021 ok that is good, still the winmenuselectitem is not working is there anohter way to click on file Link to comment Share on other sites More sharing options...
Solution serena_knight Posted July 15, 2021 Author Solution Share Posted July 15, 2021 problem has been resolved ty you all for your attention Link to comment Share on other sites More sharing options...
Nine Posted July 15, 2021 Share Posted July 15, 2021 Mark it as solve and provide your end result for anyone to who is interested to your solution... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
JockoDundee Posted July 16, 2021 Share Posted July 16, 2021 On 7/15/2021 at 10:09 AM, serena_knight said: problem has been resolved ty you all for your attention don’t forget to tip your servers Code hard, but don’t hard code... 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