Jump to content

Recommended Posts

Posted

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

]
Posted

It 's the function for update my ListView in my it can send you on the right way ! Posted Image

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.0WIN 11 24H2 X64 - Other Examples Scripts

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...