mehafi Posted January 12, 2017 Share Posted January 12, 2017 Hi, In win8 I can use AutoIt v3 Window Info to get control Class Name or ID - example printscreen win8_calc_class.png - I can identify any button of calculator But in win10 the sam action show me the same Class Name ( ApplicationFrameInputSkinWindow1 ) and in fact all data except Control Click Cords are the same for almost entire surface of calculator ( win10_calc_btn_noclass.png ). The same in application writen in C++ QT - I can not identify buttons Refresh and Cancel to click on them, what is my purpose ( tableau_refreshAll_noClass.png ). Does anyone have any suggestions / solutions ? thanks in advance Link to comment Share on other sites More sharing options...
junkew Posted January 12, 2017 Share Posted January 12, 2017 See faq 31. Check with simplespy and or inspect.exe. although on my w10 system i do not observe this behavior. 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...
Subz Posted January 13, 2017 Share Posted January 13, 2017 When the Windows is active and you press Alt do you get an underline below one of the letters on "Refresh" or "Cancel"? Link to comment Share on other sites More sharing options...
mehafi Posted January 13, 2017 Author Share Posted January 13, 2017 @Subz - no, therre are no underlines. I gues what probably you want to advise - underline means keyboard shortcuts means I could use Send function to 'press' this button. @junkew - on printscren is what inspect.exe shows me when I point the button in dialog box which I am intrested. So there is no Class Name, Id ... is there a way I can identify this button and press / click on it ? Link to comment Share on other sites More sharing options...
mehafi Posted January 13, 2017 Author Share Posted January 13, 2017 I have tried: Local $hControl = ControlGetHandle( $hWndRefreshWindow, "", "[TEXT:Close Enter]" ) Local $hControl = ControlClick( $hWndRefreshWindow, "", "", "left") Local $hControl = ControlClick( $hWndRefreshWindow, "", "", "right") but it not works Link to comment Share on other sites More sharing options...
Subz Posted January 13, 2017 Share Posted January 13, 2017 You may need to use ControlClick with coords. Link to comment Share on other sites More sharing options...
mehafi Posted January 13, 2017 Author Share Posted January 13, 2017 @Subz unfortunatelly it does not works. I used: Local $x = ControlClick( $hWndRefreshWindow, "", "", "", 1, 832, 704) ; values returned in Bounded rectangle property by Inspect.exe Local $x = ControlClick( $hWndRefreshWindow, "", "", "", 1, 235, 290) ; values counted by my related to the top left corner of dialog box Local $x = ControlClick( $hWndRefreshWindow, "", "", "", 1, 5, 5) ; values related to top left corner of button Interesting - function return 1 = success, but button is not presed Link to comment Share on other sites More sharing options...
Subz Posted January 13, 2017 Share Posted January 13, 2017 What about: ;~ Cancel Button If WinActive('[CLASS:QT5QWindow]') Then $QT_REFRESH = WinGetPos('[CLASS:QT5QWindow]', '') ControlClick('[CLASS:QT5QWindow]', 'Refresh All Extracts', '', 'left', 1, $QT_REFRESH[2] - 50, $QT_REFRESH[3] - 20) EndIf ;~ Refresh Button If WinActive('[CLASS:QT5QWindow]') Then $QT_REFRESH = WinGetPos('[CLASS:QT5QWindow]', '') ControlClick('[CLASS:QT5QWindow]', 'Refresh All Extracts', '', 'left', 1, $QT_REFRESH[2] - 130, $QT_REFRESH[3] - 20) EndIf Link to comment Share on other sites More sharing options...
mehafi Posted January 13, 2017 Author Share Posted January 13, 2017 Unfortunately it not works. I think the issue is this are QT controls Link to comment Share on other sites More sharing options...
Subz Posted January 13, 2017 Share Posted January 13, 2017 Can you do ArrayDisplay after WinGetPos, from the WIndows Info Tool it appears to pick up QT5QWindow as the Class. Link to comment Share on other sites More sharing options...
mehafi Posted January 13, 2017 Author Share Posted January 13, 2017 Strange but: Local $hWndRefreshWindow = WinWaitActive("[CLASS:Qt5QWindow]") ; works and return correct hwnd bu later: $QT_REFRESH = WinGetPos("[CLASS:Qt5QWindow]") ; NOT works but $QT_REFRESH = WinGetPos($hWndRefreshWindow) ; WORKS Link to comment Share on other sites More sharing options...
junkew Posted January 13, 2017 Share Posted January 13, 2017 apparently you did not read faq 31 thru with the reference to iuiautomation in examples. As you can see it with AU3Inf, Simplespy and Inspect its possible to click Different solutions use the treewalkers in example 1 of uiautomation use the uiawrappers with index n or offset n or relative n use the AutoIt logic of index n 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...
Subz Posted January 13, 2017 Share Posted January 13, 2017 (edited) So then can you now try: ;~ Refresh Button MouseClick('left', $QT_REFRESH[0] + $QT_REFRESH[2] - 130, $QT_REFRESH[1] + $QT_REFRESH[3] - 20) ;~ Cancel Button MouseClick('left', $QT_REFRESH[0] + $QT_REFRESH[2] - 50, $QT_REFRESH[1] + $QT_REFRESH[3] - 20) Edited January 13, 2017 by Subz Typos - Added Cancel Link to comment Share on other sites More sharing options...
mehafi Posted January 13, 2017 Author Share Posted January 13, 2017 @Subz thanks, MouseClick works. But I prefer not to use automation required moving mouse cursor if absolutely not needed. But once again thanks for working solution! Link to comment Share on other sites More sharing options...
mehafi Posted January 13, 2017 Author Share Posted January 13, 2017 @junkew I have read FAQ, but have'nt have time to try all solutions. No I have just tried UIAutomation and it works! Thanks a lot! 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