I'm not sure I fully understand this question.
How do you figure out where in the memory your program is storing the string for the listbox item?
But anyway, unfortunately, there is no such animal as LB_SETTEXT. So, you may want to try the following LB edit implementation:
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);