Jump to content

Selecting & Double clicking on a specific MSFlexGridWndClass grid row.


Recommended Posts

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.

 

Capture.PNG

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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 row32
Sleep(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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...