Myrddin Posted July 29, 2009 Share Posted July 29, 2009 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 More sharing options...
wraithdu Posted July 29, 2009 Share Posted July 29, 2009 _GUICtrlListView_GetSelectedIndices() or _GUICtrlListView_HitTest() Link to comment Share on other sites More sharing options...
Myrddin Posted July 30, 2009 Author Share Posted July 30, 2009 _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 More sharing options...
AdmiralAlkex Posted July 30, 2009 Share Posted July 30, 2009 Is it the controlID you want? Use GUICtrlRead() if your items was creted with GUICtrlCreateListViewItem(). .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Myrddin Posted July 30, 2009 Author Share Posted July 30, 2009 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 selectedThank 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 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