Just adding some bells and whistles to the constants program and I can't understand why this is happening....
When the program loads, it gets the position of the listview from when you closed the program before e.g. position 6.
The program loads with a variable "DoFromLoad" set to 1.
In the window's handler I have this section....
if DoFromLoad = 1 ' do on loading the program one time only
DoFromLoad = 0
LVpos = FirstPos
pos = 0
Info = ""
cValue = ""
LVpos = pos
So the very first time on load, the listview is set to position 6, highlighted, and scroll bar in the correct position BUT when I press the down arrow key to move the selection on by one it jumps to position zero.
Any ideas please?
Maybe the listview uses the focused item after a keyboard event. Try defining one
ListView_SetItemState(hwnd_listview, focus_index, LVNI_SELECTED | LVNI_FOCUSED, LVNI_SELECTED | LVNI_FOCUSED)