I have discovered some interactions between windows and thought I'd put down some of my observations and fixes here for others.
I make extensive usage of the %lv (List View) to present data in the report view (tabular, a lot like Excel). I don't allow any editing of the data (that's done elsewhere), but I do use the callback to allow sorting of individual columns, selection of items for processing , etc.
I also use the Text Array (%tx) for a number of human interactions. It is this combination (%lv and %tx) that caused me no end of 'trouble'. But, there is an easy fix.
What I discovered was an interaction between independently created windows. The %tx window appeared to interfere with the %lv callbacks. Specifically, the following behaviors were observed:
Moving the cursor from the %tx window into the %lv window would cause the %lv data to flash as if being refreshed.
Moving the cursor could SOMETIMES cause the number of displayed items to show only up through the last selected item, making the remaining data appear to have disappeared. Moving the cursor back and forth from the underlying window into the %lv window would cause this condition to occur or restore itself.
The %lv callback function would get double 'SET_SELECTION' messages on occasion, as well as the '?', meaning the callback was performed but not with a valid CLEARWIN_INFO@ message.
There are other windows in my program that do not exhibit this behavior, so I looked at the similarities/differences in how the windows were created.
It turns out that if the window is created as if it is a dialog (modal), then the problem did not manifest itself.
So, what to do when I really need to have a window (not a dialog) created? I can 'disable' the %tx main window. There are three ways of doing this.
First, if one minimises the %tx window, then there is no interaction since the window is not displayed and cannot gain focus (nor see the cursor move across it.
The second way is to disable (%de) the %tx window so that it does not process cursor movements (or anything else).
The third (and probably only applicable in my case) is to close the %tx window, recreating it only AFTER the %lv window has been processed and the %tx window is needed.
This may or may not help others, but if you are seeing odd behaviors and/or lots of sporadic and odd callbacks, this might help.