lee321987 Posted October 16, 2022 Share Posted October 16, 2022 Hello. Both of these don't work: _GUICtrlListView_MapIDToIndex() _GUICtrlListView_MapIndexToID() #include <GuiListView.au3> $Form1 = GUICreate('Form1', 220, 140, 180, 200) $ListView1 = GUICtrlCreateListView('col1|col2', 10, 10, 200, 120) GUISetState(@SW_SHOW) $item_0 = GUICtrlCreateListViewItem('a|b', $ListView1) $item_1 = GUICtrlCreateListViewItem('foo|bar', $ListView1) ConsoleWrite('0 acutal ID: ' & $item_0 & @CRLF) ConsoleWrite('1 actual ID: ' & $item_1 & @CRLF) $iID = _GUICtrlListView_MapIndexToID($ListView1, 0) ConsoleWrite('MapIndexToID: ' & $iID & @CRLF) ConsoleWrite('MapIDToIndex: ' & _GUICtrlListView_MapIDToIndex($ListView1, $iID) & @CRLF) ; Using variable returned from control creation: ConsoleWrite('MapIDToIndex using creation var: ' & _GUICtrlListView_MapIDToIndex($ListView1, $item_0) & @CRLF) Exit While 1 Sleep(300) WEnd outputs: 0 acutal ID: 4 1 actual ID: 5 MapIndexToID: 0 MapIDToIndex: 0 MapIDToIndex using creation var: -1 Link to comment Share on other sites More sharing options...
Nine Posted October 16, 2022 Share Posted October 16, 2022 If you read carefully help file, you should understand that the LV ID is not the same as the AutoIt GUI ID. The listview ID is an internal ID to track uniqueness of an item (changes can happened after deletion/creation). But you can get the actual AutoIt GUI ID, with _GUICtrlListView_GetItemParam when you create your LV items with GUICtrlCreateListViewItem (as AutoIt assigns its own ID to the data param of the listview) lee321987 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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