Jump to content

Get selected listview item ID?


 Share

Recommended Posts

Hello all,

First of all, I must say I love AutoIt. I'm a long time programmer but never heard of it until recently, have been using it ever since.

I got a question concerning listviews (GUICtrlCreateListView()); How am I able to get the selected item ID (ID returned from GUICtrlCreateListViewItem())?

The situation is this; I have a listview with a few items and I made a context menu for it, but I find myself unable to be able to retrieve the item ID that is selected (After invoking the context menu event).

Kind regards,

Myrddin

Link to comment
Share on other sites

_GUICtrlListView_GetSelectedIndices() or _GUICtrlListView_HitTest()

Hello Waithdu,

I already looked at _GUICtrlListView_GetSelectedIndices(), it returns the listview item number instead of the ID, because the items are spawned in random order it is no use to me.

Didn't knew about _GUICtrlListView_HitTest(), found _GUICtrlListView_SubItemHitTest(), but this function also returns the number, and not the ID.

Kind regards,

Myrddin

Link to comment
Share on other sites

Is it the controlID you want? Use GUICtrlRead() if your items was creted with GUICtrlCreateListViewItem().

ListView Control identifier (controlID) of the selected ListViewItem. 0 means no item is selected

Thank you so much! I have been looking everywhere, this was the only place I didn't look. Thank you so much.

Kind regards,

Myrddin

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...