Doc Lobster wrote:
Calling SetItemState(-1, ...) takes about the same time as any other SetItemState(...) call, even if it alters all items.
I think this is a good hint. (Un)fortunately 'debugging' is your only friend. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.