How do you figure out where in the memory your program is storing the string for the listbox item?
I'm not sure I fully understand this question.
But anyway, unfortunately, there is no such animal as LB_SETTEXT. So, you may want to try the following LB edit implementation:
Code:
int iCurSel = SendMessage((HWND)lParam, LB_GETCURSEL, (WPARAM)0, 0L);
SendMessage((HWND)lParam, LB_INSERTSTRING, (WPARAM)(index), (LPARAM)"NewItem");
SendMessage((HWND)lParam, LB_DELETESTRING, (WPARAM)(index+1), 0L);
SendMessage((HWND)lParam, LB_SETCURSEL, (WPARAM)iCurSel, 0L);