ute_man Posted April 29, 2019 Share Posted April 29, 2019 Hi everyone, I am an absolute beginner and please pardon me if I don't make any sense. I have an application (App), seemingly developed with VB. I do not have any information about the application except for the information that I obtain with AutoIT info tool. In my App window, there are 2 main panes of which the right pane is MSFlexGridWndClass. What I normally do is I double click on any row of this pane to generate an output on to the left pane. It is working fine when I click manually using mouse. I would like to automate this task now. For example, I want to write a code to double click on the third, tenth and thirteenth rows one after another with 10 seconds in between each double click. I tried to use the below but it always clicks on a certain row (row 32): WinActivate("App") Global $hWndWindow = WinGetHandle("App") Global $hWndLv = ControlGetHandle($hWndWindow, "", "[CLASS:MSFlexGridWndClass; INSTANCE:1]") Sleep(10) ControlClick($hWndLv, "", "", "left", 2) Then I tried to move the focus using below using UP and DOWN. It highlights the row in Blue, but when I send the ControlClick again, it does not click on the highlighted row, but the same row as before (row 32) I searched Internet for 2 days, but I was not able to find a way. I have seen the below post, but I do not understand anything as I am absolutely a beginner. I do not even know whether my requirement is addressed there or not (as I do not understand). Please help me, all what I want to do is to double click on a selected FlexGrid row. Thank you everyone. Link to comment Share on other sites More sharing options...
junkew Posted April 29, 2019 Share Posted April 29, 2019 I think you can only get this iinformation with UIA automation in examples thread one of the first posts. Start with au3inf, simplespy, inspect tools to see if they see your information from your app. If its highlighted then next step can be retrieving the information. Probably you are already helped by using controlsend with UP/Down keys and ENTER or RETURN key. Controlclick like you use above says more or less click in the middle of the grid with rows which is not what you want. Something like this ControlSend($hWndWindow, "", "[CLASS:MSFlexGridWndClass; INSTANCE:1]", "{HOME}") for $i=1 to 10 ControlSend($hWndWindow, "", "", "{DOWN}") ControlSend($hWndWindow, "", "", "{ENTER}") Sleep(10) next 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...
ute_man Posted April 30, 2019 Author Share Posted April 30, 2019 Thank you so much junkew and much appreciated. I think, I have not made it very clear in my previous post. All what I want to do it to doubleclick on the selected (highlighted in blue) row - that's it. (I do not want the row information to be saved or read - all I need is to doubleclick on the highlighted row) ControlClick($hWndLv, "", "", "left", 2) always doubleclicks on row32 IRRESPECTIVE of the row highlighted. My code : #include <MsgBoxConstants.au3> #include <GuiListView.au3> WinActivate("App") Global $hWndWindow = WinGetHandle("App") Global $hWndLv = ControlGetHandle($hWndWindow, "", "[CLASS:MSFlexGridWndClass; INSTANCE:1]") Sleep(10) ControlClick($hWndLv, "", "", "left", 1) ; ------This is to set focus to MSFlexGridWndClass pane on the right and it highlights the default row32Sleep(10) Send ("^{HOME}") ; ------This highlights the first row Sleep(10) Send ("{DOWN}{DOWN}{DOWN}") ; ----This moves to Row4 and Row 4 is highlighted in blue ------ ControlClick($hWndLv, "", "", "left", 2) ; ----This doubleclicks on row32 --- NOT on highlighted Row4 - This is my issue. - why doesn't it double click on the highlighted row ??? What wrong am I doing ? Please help and thank you again. ps - I have checked your post at, But, I did not find a way to doubleclick on the selected row. Link to comment Share on other sites More sharing options...
ute_man Posted April 30, 2019 Author Share Posted April 30, 2019 By the way, I forgot to mention that the following does not work. ControlSend($hWndWindow, "", "", "{ENTER}") ONLY "DoubleClick" on selected (highlighted) row works. Link to comment Share on other sites More sharing options...
junkew Posted May 1, 2019 Share Posted May 1, 2019 You could calculate mouse x y and move mouse and do mouseclick function https://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm 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...
ute_man Posted May 2, 2019 Author Share Posted May 2, 2019 Thank you again junkew. With your hints, I achieved this with: ControlClick("App", "", $hWndLv, "left", 2, x, y) MouseClick() did not work. Thank you again for all your help and it is much appreciated. 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