zhaicheng Posted January 26, 2011 Posted January 26, 2011 I use the Gui to create a listview and I want to update the content dynamically without affecting other operation,like clicking the button. So I come out the idea of using "CoProc.au3" as a simulation of muti-thread operation. However it does not seem to work. Can anyone give me some advices on how to achive this goal? Many thanks! _CoProc("UpdateList", $hListView) Func UpdateList($hListView) While 1 Local $aItem, $hwin, $status For $i = 0 To _GUICtrlListView_GetItemCount($hListView) - 1 $aItem = _GUICtrlListView_GetItem($hListView, $i, 6) $hwin = HWnd($aItem[3]) $status = ControlGetText($hwin, "", "[NAME:btnDown]") _GUICtrlListView_SetItem($hListView, $status, $i, 5) Next Sleep(1000) WEnd EndFunc ;==>UpdateList ]
PsaltyDS Posted January 26, 2011 Posted January 26, 2011 There is no GUI and no buttons in your demo, so that won't help demonstrate your issue. Perhaps you mean to run your update function via AdLibRegister()? See help file. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
wakillon Posted January 27, 2011 Posted January 27, 2011 It 's the function for update my ListView in my it can send you on the right way ! Func _GUICtrlCreateListViewItems ( $_ListArray ) If $_ListView=0 Then $_ListView = GUICtrlCreateListView ( "Radio|Name", 15, 20, 346, 259, BitOr ( $LVS_SINGLESEL, $LVS_SHOWSELALWAYS ), BitOr ( $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES ) ) _GUICtrlListView_SetColumnWidth ( $_ListView, 1, $LVSCW_AUTOSIZE_USEHEADER ) Else _GUICtrlListView_DeleteAllItems ( GUICtrlGetHandle ( $_ListView ) ) ReDim $_ListViewItem[UBound ( $_ListArray )] EndIf For $_G = 1 To UBound ( $_ListArray ) - 1 $_ListViewItem[$_G] = GUICtrlCreateListViewItem ( StringFormat ( "%02i", $_G ) & "|" & $_ListArray[$_G], $_ListView ) Next GUICtrlSetTip ( $_ListView, "Double click for get infos about this Station" ) $_ListViewItemMax = UBound ( $_ListArray )-1 EndFunc ;==> _GUICtrlCreateListViewItem ( ) AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
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