IListView

IListView

IID_IListView {2FFE2979-5928-4386-9CDB-8E1F15B72FB4} original
{E5B16AF2-3990-4681-A609-1F060CD14269} version 6.10 from Windows 7

The original IListView methods are (as ordered in the virtual function table after the IOleWindow methods):

Offset Method
0x14 GetImageList
0x18 SetImageList
0x1C GetBackgroundColor
0x20 SetBackgroundColor
0x24 GetTextColor
0x28 SetTextColor
0x2C GetTextBackgroundColor
0x30 SetTextBackgroundColor
0x34 GetHotLightColor
0x38 SetHotLightColor
0x3C GetItemCount
0x40 SetItemCount
0x44 GetItem
0x48 SetItem
0x4C GetItemState
0x50 SetItemState
0x54 GetItemText
0x58 SetItemText
0x5C GetBackgroundImage
0x60 SetBackgroundImage
0x64 GetFocusedColumn
0x68 SetSelectionFlags
0x6C GetSelectedColumn
0x70 SetSelectedColumn
0x74 GetView
0x78 SetView
0x7C InsertItem
0x80 DeleteItem
0x84 DeleteAllItems
0x88 UpdateItem
0x8C GetItemRect
0x90 GetSubItemRect
0x94 HitTestSubItem
0x98 GetIncrSearchString
0x9C GetItemSpacing
0xA0 SetIconSpacing
0xA4 GetNextItem
0xA8 FindItem
0xAC GetSelectionMark
0xB0 SetSelectionMark
0xB4 GetItemPosition
0xB8 SetItemPosition
0xBC ScrollView
0xC0 EnsureItemVisible
0xC4 EnsureSubItemVisible
0xC8 EditSubItem
0xCC RedrawItems
0xD0 ArrangeItems
0xD4 RecomputeItems
0xD8 GetEditControl
0xDC EditLabel
0xE0 EditGroupLabel
0xE4 CancelEditLabel
0xE8 GetEditItem
0xEC HitTest
0xF0 GetStringWidth
0xF4 GetColumn
0xF8 SetColumn
0xFC GetColumnOrderArray
0x0100 SetColumnOrderArray
0x0104 GetHeaderControl
0x0108 InsertColumn
0x010C DeleteColumn
0x0110 CreateDragImage
0x0114 GetViewRect
0x0118 GetClientRect
0x011C GetColumnWidth
0x0120 SetColumnWidth
0x0124 GetCallbackMask
0x0128 SetCallbackMask
0x012C GetTopIndex
0x0130 GetCountPerPage
0x0134 GetOrigin
0x0138 GetSelectedCount
0x013C SortItems
0x0140 GetExtendedStyle
0x0144 SetExtendedStyle
0x0148 GetHoverTime
0x014C SetHoverTime
0x0150 GetToolTip
0x0154 SetToolTip
0x0158 GetHotItem
0x015C SetHotItem
0x0160 GetHotCursor
0x0164 SetHotCursor
0x0168 ApproximateViewRect
0x016C SetRangeObject
0x0170 GetWorkAreas
0x0174 SetWorkAreas
0x0178 GetWorkAreaCount
0x017C ResetEmptyText
0x0180 EnableGroupView
0x0184 IsGroupViewEnabled
0x0188 SortGroups
0x018C GetGroupInfo
0x0190 SetGroupInfo
0x0194 GetGroupRect
0x0198 GetGroupState
0x019C HasGroup
0x01A0 InsertGroup
0x01A4 RemoveGroup
0x01A8 InsertGroupSorted
0x01AC GetGroupMetrics
0x01B0 SetGroupMetrics
0x01B4 RemoveAllGroups
0x01B8 GetFocusedGroup
0x01BC GetGroupCount
0x01C0 SetOwnerDataCallback
0x01C4 GetTileViewInfo
0x01C8 SetTileViewInfo
0x01CC GetTileInfo
0x01D0 SetTileInfo
0x01D4 GetInsertMark
0x01D8 SetInsertMark
0x01DC GetInsertMarkRect
0x01E0 GetInsertMarkColor
0x01E4 SetInsertMarkColor
0x01E8 HitTestInsertMark
0x01EC SetInfoTip
0x01F0 GetOutlineColor
0x01F4 SetOutlineColor
0x01F8 GetFrozenItem
0x01FC SetFrozenItem
0x0200 GetFrozenSlot
0x0204 SetFrozenSlot
0x0208 GetViewMargin
0x020C SetViewMargin
0x0210 SetKeyboardSelected
0x0214 MapIndexToId
0x0218 MapIdToIndex
0x021C IsItemVisible
0x0220 GetGroupSubsetCount
0x0224 SetGroupSubsetCount
0x0228 GetVisibleSlotCount
0x022C GetColumnMargin
0x0230 SetSubItemCallback
0x0234 GetVisibleItemRange
0x0238 SetTypeAheadFlags

with prototypes:

HRESULT GetImageList (INT, HIMAGELIST *);
HRESULT SetImageList (INT, HIMAGELIST, HIMAGELIST *);
HRESULT GetBackgroundColor (COLORREF *);
HRESULT SetBackgroundColor (COLORREF);
HRESULT GetTextColor (COLORREF *);
HRESULT SetTextColor (COLORREF);
HRESULT GetTextBackgroundColor (COLORREF *);
HRESULT SetTextBackgroundColor (COLORREF);
HRESULT GetHotLightColor (COLORREF *);
HRESULT SetHotLightColor (COLORREF);
HRESULT GetItemCount (int *);
HRESULT SetItemCount (int, DWORD);
HRESULT GetItem (LVITEMW *);
HRESULT SetItem (LVITEMW * const);
HRESULT GetItemState (int, int, ULONG, ULONG *);
HRESULT SetItemState (int, int, ULONG, ULONG);
HRESULT GetItemText (INT, INT, PWSTR, INT);
HRESULT SetItemText (int, int, PCWSTR);
HRESULT GetBackgroundImage (LVBKIMAGEW *);
HRESULT SetBackgroundImage (LVBKIMAGEW * const);
HRESULT GetFocusedColumn (INT *);
HRESULT SetSelectionFlags (ULONG, ULONG);
HRESULT GetSelectedColumn (INT *);
HRESULT SetSelectedColumn (int);
HRESULT GetView (DWORD *);
HRESULT SetView (DWORD);
HRESULT InsertItem (LVITEMW * const, int *);
HRESULT DeleteItem (int);
HRESULT DeleteAllItems (VOID);
HRESULT UpdateItem (int);
HRESULT GetItemRect (LVITEMINDEX, int, RECT *);
HRESULT GetSubItemRect (LVITEMINDEX, INT, INT, RECT *);
HRESULT HitTestSubItem (LVHITTESTINFO *);
HRESULT GetIncrSearchString (PWSTR, INT, INT *);
HRESULT GetItemSpacing (BOOL, INT *, INT *);
HRESULT SetIconSpacing (INT, INT, INT *, INT *);
HRESULT GetNextItem (LVITEMINDEX, ULONG, LVITEMINDEX *);
HRESULT FindItem (LVITEMINDEX, LVFINDINFOW const *, LVITEMINDEX *);
HRESULT GetSelectionMark (LVITEMINDEX *);
HRESULT SetSelectionMark (LVITEMINDEX, LVITEMINDEX *);
HRESULT GetItemPosition (LVITEMINDEX, POINT *);
HRESULT SetItemPosition (int, POINT const *);
HRESULT ScrollView (int, int);
HRESULT EnsureItemVisible (LVITEMINDEX, BOOL);
HRESULT EnsureSubItemVisible (LVITEMINDEX, INT);
HRESULT EditSubItem (LVITEMINDEX, INT);
HRESULT RedrawItems (int, int);
HRESULT ArrangeItems (int);
HRESULT RecomputeItems (INT);
HRESULT GetEditControl (HWND *);
HRESULT EditLabel (LVITEMINDEX, PCWSTR, HWND *);
HRESULT EditGroupLabel (INT);
HRESULT CancelEditLabel (VOID);
HRESULT GetEditItem (LVITEMINDEX *, INT *);
HRESULT HitTest (LVHITTESTINFO *);
HRESULT GetStringWidth (PCWSTR, int *);
HRESULT GetColumn (int, LVCOLUMNW *);
HRESULT SetColumn (int, LVCOLUMNW * const);
HRESULT GetColumnOrderArray (int, int *);
HRESULT SetColumnOrderArray (int, int const *);
HRESULT GetHeaderControl (HWND *);
HRESULT InsertColumn (int, LVCOLUMNW * const, int *);
HRESULT DeleteColumn (int);
HRESULT CreateDragImage (int, POINT const *, HIMAGELIST *);
HRESULT GetViewRect (RECT *);
HRESULT GetClientRect (BOOL, RECT *);
HRESULT GetColumnWidth (INT, INT *);
HRESULT SetColumnWidth (int, int);
HRESULT GetCallbackMask (ULONG *);
HRESULT SetCallbackMask (ULONG);
HRESULT GetTopIndex (int *);
HRESULT GetCountPerPage (int *);
HRESULT GetOrigin (POINT *);
HRESULT GetSelectedCount (INT *);
HRESULT SortItems (BOOL, LPARAM, PFNLVCOMPARE);
HRESULT GetExtendedStyle (DWORD *);
HRESULT SetExtendedStyle (DWORD, DWORD, DWORD *);
HRESULT GetHoverTime (UINT *);
HRESULT SetHoverTime (UINT, UINT *);
HRESULT GetToolTip (HWND *);
HRESULT SetToolTip (HWND, HWND *);
HRESULT GetHotItem (LVITEMINDEX *);
HRESULT SetHotItem (LVITEMINDEX, LVITEMINDEX *);
HRESULT GetHotCursor (HCURSOR *);
HRESULT SetHotCursor (HCURSOR, HCURSOR *);
HRESULT ApproximateViewRect (int, INT *, INT *);
HRESULT SetRangeObject (INT, ILVRange *);
HRESULT GetWorkAreas (int, RECT *);
HRESULT SetWorkAreas (int, RECT const *);
HRESULT GetWorkAreaCount (INT *);
HRESULT ResetEmptyText (VOID);
HRESULT EnableGroupView (INT);
HRESULT IsGroupViewEnabled (BOOL *);
HRESULT SortGroups (PFNLVGROUPCOMPARE, PVOID);
HRESULT GetGroupInfo (INT, INT, LVGROUP *);
HRESULT SetGroupInfo (INT, INT, LVGROUP * const);
HRESULT GetGroupRect (BOOL, int, INT, RECT *);
HRESULT GetGroupState (INT, ULONG, ULONG *);
HRESULT HasGroup (int, BOOL *);
HRESULT InsertGroup (int, LVGROUP * const, int *);
HRESULT RemoveGroup (INT);
HRESULT InsertGroupSorted (LVINSERTGROUPSORTED const *, int *);
HRESULT GetGroupMetrics (LVGROUPMETRICS *);
HRESULT SetGroupMetrics (LVGROUPMETRICS * const);
HRESULT RemoveAllGroups (VOID);
HRESULT GetFocusedGroup (INT *);
HRESULT GetGroupCount (INT *);
HRESULT SetOwnerDataCallback (IOwnerDataCallback *);
HRESULT GetTileViewInfo (LVTILEVIEWINFO *);
HRESULT SetTileViewInfo (LVTILEVIEWINFO * const);
HRESULT GetTileInfo (LVTILEINFO *);
HRESULT SetTileInfo (LVTILEINFO * const);
HRESULT GetInsertMark (LVINSERTMARK *);
HRESULT SetInsertMark (LVINSERTMARK const *);
HRESULT GetInsertMarkRect (RECT *);
HRESULT GetInsertMarkColor (COLORREF *);
HRESULT SetInsertMarkColor (COLORREF, COLORREF *);
HRESULT HitTestInsertMark (POINT const *, LVINSERTMARK *);
HRESULT SetInfoTip (LVSETINFOTIP * const);
HRESULT GetOutlineColor (COLORREF *);
HRESULT SetOutlineColor (COLORREF, COLORREF *);
HRESULT GetFrozenItem (INT *);
HRESULT SetFrozenItem (INT, INT);
HRESULT GetFrozenSlot (RECT *);
HRESULT SetFrozenSlot (INT, POINT const *);
HRESULT GetViewMargin (RECT *);
HRESULT SetViewMargin (RECT const *);
HRESULT SetKeyboardSelected (LVITEMINDEX);
HRESULT MapIndexToId (INT, INT *);
HRESULT MapIdToIndex (INT, INT *);
HRESULT IsItemVisible (LVITEMINDEX, BOOL *);
HRESULT GetGroupSubsetCount (INT *);
HRESULT SetGroupSubsetCount (INT);
HRESULT GetVisibleSlotCount (INT *);
HRESULT GetColumnMargin (RECT *);
HRESULT SetSubItemCallback (ISubItemCallback *);
HRESULT GetVisibleItemRange (LVITEMINDEX *, LVITEMINDEX *);
HRESULT SetTypeAheadFlags (UINT, UINT);

in which ILVRange, IOwnerDataCallback and ISubItemCallback are apparently undocumented interfaces.

The revision for Windows 7 inserts a method (near to the end of the virtual function table):

Offset Method
0x0220 EnableAlphaShadow
0x0224 GetGroupSubsetCount
0x0228 SetGroupSubsetCount
0x022C GetVisibleSlotCount
0x0230 GetColumnMargin
0x0234 SetSubItemCallback
0x0238 GetVisibleItemRange
0x023C SetTypeAheadFlags

The new method has the prototype:

HRESULT EnableAlphaShadow (BOOL);

Two other methods have slight changes to their prototypes:

HRESULT SetSelectionFlags (SELECTION_FLAGS, SELECTION_FLAGS);
HRESULT SetTypeAheadFlags (TYPEAHEAD_FLAGS, TYPEAHEAD_FLAGS);

in which SELECTION_FLAGS and TYPEAHEAD_FLAGS are formal enumerations to replace what had been mere integers.

Implementation

The one known implementation of the IListView interface is by COMCTL32 for a class that Microsoft’s symbol files name as CListView. An instance of this class is created for each List-View control. To get a pointer to a List-View control’s IListView interface, send message 0x10BD to the control, with wParam addressing IID_IListView and with lParam addressing a variable that will receive the interface pointer.

Availability

The IListView interface is implemented in COMCTL32 versions 6.10 and higher.

Though new for Windows Vista, this interface is not documented by Microsoft in the January 2007 edition of the Software Development Kit (SDK) for Windows Vista.

Neither does the SDK document the window message (perhaps named something like LVM_QUERYINTERFACE) through which a List-View control exposes its interfaces. This is all rather curious. Where the methods correspond closely with the messages, the natural expectation is that calling the methods will be vastly more efficient than sending messages. Add that some of the methods do things for which there is no corresponding message, and that some messages are anyway undocumented, and it is hard to escape the notion that Microsoft has given List-View controls some significant new machinery for the benefit of some favoured users. Will these games ever stop?