OtenMoten Posted September 5, 2017 Share Posted September 5, 2017 (edited) Hello dear community, definitely I need external help now. I've did all 'ControlClick() - Tutorials' and read a lot of topics about interaction betweend AutoIT and external programs. The most of them are about "Clicking a button ...". In my case it's different because I need to click a specific element within the program. The 'program' what I am talking about is called Mendeley. It's library software for documents administration. In the attachements in picture '1.jpg' you can see the red marked Help element. In the picture '2.jpg' you see the context menu of the Help element. This is what I'm trying to do with the ControlClick() function. Following I represent my code which not worked for me: #include <MsgBoxConstants.au3> Opt("WinTitleMatchMode", 2) $hWnd = WinGetHandle("Mendeley Desktop", "") MsgBox($MB_SYSTEMMODAL, "handle check", $hWnd) ControlClick($hWnd, "Mendeley Desktop", "Help") The MsgBox tells me the number of the handle of the Mendeley window. It's not 0 so for me it means the window is recognized correctly. When I'm execute the script the Help element is not clicked. Any suggestions for me? Kind regards OtenMoten Edited September 5, 2017 by OtenMoten Link to comment Share on other sites More sharing options...
Andreik Posted September 5, 2017 Share Posted September 5, 2017 What you need is WinMenuSelectItem(). OtenMoten 1 When the words fail... music speaks. Link to comment Share on other sites More sharing options...
OtenMoten Posted September 5, 2017 Author Share Posted September 5, 2017 (edited) 25 minutes ago, Andreik said: What you need is WinMenuSelectItem(). It seems not to be working. #include <MsgBoxConstants.au3> Opt("WinTitleMatchMode", 2) $hWnd = WinGetHandle("Mendeley Desktop", "") WinMenuSelectItem($hWnd, "", "&Help") I found this in the Help of WinMenuSelectItem(): "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." Any other options for me? Edited September 5, 2017 by OtenMoten Link to comment Share on other sites More sharing options...
Andreik Posted September 5, 2017 Share Posted September 5, 2017 (edited) I don't have the application to test but you might use some keystroke combination or AutoIt recorder to see what code generate. PS: use Au3Info and post a picture to see what type of control it is Edited September 5, 2017 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
junkew Posted September 5, 2017 Share Posted September 5, 2017 read FAQ 31 and try the different spy tools and show the output of these spying apps (au3inf and simplespy: If it highlights you can program it) It looks a normal menu and most likely Au3Info snapshot will help. If not you have to a. switch to sendkeys (alt+h) b. switch to IUIAutomation see references in FAQ 31 OtenMoten 1 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets 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