Code: Select all
Gui, Add, ListView, Checked -LV0x10, a|b
Gui, Add, Button, Section gClear, Clear Checked
Gui, Add, Button, ys gClearDebug, Clear [ debug ]
Gui, Add, Button, ys gPopulate, Re-Populate
Gui, Show
Populate:
LV_Delete()
Loop 10
LV_Add("check", "", "some val " a_index )
return
Clear:
ClearItems()
Return
ClearDebug:
ClearItems( 1 )
Return
GuiClose:
ExitApp
ClearItems( deb = "" )
{
Loop % LV_GetCount()
{
if ( LV_GetNext( a_index-1, "Checked" ) = a_index )
{
if ( !deb )
LV_Delete( a_index )
else
msgbox % "Remove Item" a_index
}
}
msgbox % ( !deb ? LV_GetCount() " items remain." : "complete!" )
}
but for some reason, it does not remove them all
I've tried native AHk + Win_32 API Calls and many other configs,
all end up with the same incorrect results.
I also added a debugger button so you can see what `should` happen.
Any tests/results would be greatly appreciated,
Thanks