Myrddin Posted July 29, 2009 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
wraithdu Posted July 29, 2009 Posted July 29, 2009 _GUICtrlListView_GetSelectedIndices() or _GUICtrlListView_HitTest()
Myrddin Posted July 30, 2009 Author Posted July 30, 2009 On 7/29/2009 at 11:03 PM, 'wraithdu said: _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
AdmiralAlkex Posted July 30, 2009 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
Myrddin Posted July 30, 2009 Author Posted July 30, 2009 On 7/30/2009 at 3:09 PM, 'AdmiralAlkex said: Is it the controlID you want? Use GUICtrlRead() if your items was creted with GUICtrlCreateListViewItem(). Quote 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
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