Fabien Posted February 2, 2024 Posted February 2, 2024 Hello community! Can someone tell me why #include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <Array.au3> GUICreate("123") $List = GUICtrlCreateListView("", 10, 10) _GUICtrlListView_AddColumn($List, "", 1000) _GUICtrlListView_Scroll($List, 1000, 1000) GUISetState(@SW_SHOW) GUICtrlCreateListViewItem ( "AAA" , $List) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd works well, but #include <AutoItConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <Array.au3> GUICreate("123") GUICtrlCreateListView("", 10, 10) $List = ControlGetHandle ("123" , "", "SysListView321" ) _GUICtrlListView_AddColumn($List, "", 1000) _GUICtrlListView_Scroll($List, 1000, 1000) GUISetState(@SW_SHOW) GUICtrlCreateListViewItem ( "AAA" , $List) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Doesn't? (the item AAA is not added to the listview) I tried to pass ControlGetHandle the 2 control ID formats: [CLASS:SysListView32; INSTANCE:1] SysListView321 Also, @error remains set to 0 Thank you!
Andreik Posted February 2, 2024 Posted February 2, 2024 (edited) Because GUICtrlCreateListViewItem() second parameter requires a control ID not a handle as you try to pass. You can use _GUICtrlListView_AddItem($List, 'AAA') if $List is a listview handle. Edited February 2, 2024 by Andreik
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