internal unsafe void UpdateListView() { Debug.Assert(listView.IsHandleCreated, "ApplySavedState Precondition: List-view handle must be created"); var lvInsertMark = new LVINSERTMARK { cbSize = (uint)sizeof(LVINSERTMARK), dwFlags = appearsAfterItem ? LVIM.AFTER : LVIM.BEFORE, iItem = index }; User32.SendMessageW(listView, (User32.WM)LVM.SETINSERTMARK, IntPtr.Zero, ref lvInsertMark); if (!color.IsEmpty) { User32.SendMessageW(listView, (User32.WM)LVM.SETINSERTMARKCOLOR, IntPtr.Zero, PARAM.FromColor(color)); } }