Jump to content

Get the selected row value from a grid control


Recommended Posts

Grid controls are drawn by their parent applications without using the standard Windows APIs. As a result, AutoIt has no way to know how to interface with them.

If you can navigate around in it with the keyboard, then you can ControlSend() "{TAB}"/"{UP}"/"{DOWN}" stuff to move around, and then ControlSend() "^c" to copy text.

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Grid controls are drawn by their parent applications without using the standard Windows APIs. As a result, AutoIt has no way to know how to interface with them.

If you can navigate around in it with the keyboard, then you can ControlSend() "{TAB}"/"{UP}"/"{DOWN}" stuff to move around, and then ControlSend() "^c" to copy text.

:mellow:

Thanks for your reply.

Using Autoit Window Info following info is displayed....

So can we use any of these info (without using coords OR Mouse Move/Click events OR Send() function)? because I don't want the script to be hardcoded

<<Window>>

Property Value

Title MyWindow

Class classMyWinMainFrame

Position 612, 1

Size 626, 650

Style 0x14CF0000

ExStyle 0x00000100

Handle 0x000307EE

<<Control>>

Property Value

Class SysListView32

Instance 1

ClassnameNN SysListView321

Name

Advanced Mode [CLASS:SysListView32; INSTANCE:1]

ID 1001

Text List1

Position 12, 60

Size 411, 304

ControlClick Coords 71, 80

Style 0x5601018D

ExStyle 0x00000325

Handle 0x0002085C

BR,

Yogesh

Link to comment
Share on other sites

Au3Info shows it is a listview, so try adapting this example.

Thank you Sir. Thank you very much.....

Now I am facing the problem to identify the selected item from the list. The selection is made through mouse or keyboard; is there any function to get the selected / focused item from the list...?

Link to comment
Share on other sites

Thanks for your reply.

Using Autoit Window Info following info is displayed....

<snip>

<<Control>>

Property Value

Class SysListView32

Instance 1

ClassnameNN SysListView321

Name

Advanced Mode [CLASS:SysListView32; INSTANCE:1]

For the record, that's NOT a grid control...

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...