This section contains information about the programming elements used with list-view controls.
Overviews
List-View ControlsA list-view control is a window that displays a collection of items; each item consists of an icon and a label.
Macros
ListView_ApproximateViewRectCalculates the approximate width and height required to display a given number of items. You can use this macro or send the LVM_APPROXIMATEVIEWRECT message explicitly.
ListView_ArrangeArranges items in icon view. You can use this macro or send the LVM_ARRANGE message explicitly.
ListView_CancelEditLabelCancels an item text editing operation. You can use this macro or send the LVM_CANCELEDITLABEL message explicitly.
ListView_CreateDragImageCreates a drag image list for the specified item. You can use this macro or send the LVM_CREATEDRAGIMAGE message explicitly.
ListView_DeleteAllItemsRemoves all items from a list-view control. You can use this macro or send the LVM_DELETEALLITEMS message explicitly.
ListView_DeleteColumnRemoves a column from a list-view control. You can use this macro or send the LVM_DELETECOLUMN message explicitly.
ListView_DeleteItemRemoves an item from a list-view control. You can use this macro or send the LVM_DELETEITEM message explicitly.
ListView_EditLabelBegins in-place editing of the specified list-view item's text. The message implicitly selects and focuses the specified item. You can use this macro or send the LVM_EDITLABEL message explicitly.
ListView_EnableGroupViewEnables or disables whether the items in a list-view control display as a group. You can use this macro or send the LVM_ENABLEGROUPVIEW message explicitly.
ListView_EnsureVisibleEnsures that a list-view item is either entirely or partially visible, scrolling the list-view control if necessary. You can use this macro or send the LVM_ENSUREVISIBLE message explicitly.
ListView_FindItemSearches for a list-view item with the specified characteristics. You can use this macro or send the LVM_FINDITEM message explicitly.
ListView_GetBkColorRetrieves the background color of a list-view control. You can use this macro or send the LVM_GETBKCOLOR message explicitly.
ListView_GetBkImageRetrieves the background image in a list-view control. You can use this macro or send the LVM_GETBKIMAGE message explicitly.
ListView_GetCallbackMaskRetrieves the callback mask for a list-view control. You can use this macro or send the LVM_GETCALLBACKMASK message explicitly.
ListView_GetCheckStateDetermines if an item in a list-view control is selected. This should be used only for list-view controls that have the LVS_EX_CHECKBOXES style.
ListView_GetColumnRetrieves the attributes of a list-view control's column. You can use this macro or send the LVM_GETCOLUMN message explicitly.
ListView_GetColumnOrderArrayRetrieves the current left-to-right order of columns in a list-view control. You can use this macro or send the LVM_GETCOLUMNORDERARRAY message explicitly.
ListView_GetColumnWidthRetrieves the width of a column in report or list view. You can use this macro or send the LVM_GETCOLUMNWIDTH message explicitly.
ListView_GetCountPerPageCalculates the number of items that can fit vertically in the visible area of a list-view control when in list or report view. Only fully visible items are counted. You can use this macro or send the LVM_GETCOUNTPERPAGE message explicitly.
ListView_GetEditControlRetrieves the handle to the edit control being used to edit a list-view item's text. You can use this macro or send the LVM_GETEDITCONTROL message explicitly.
ListView_GetExtendedListViewStyleRetrieves the extended styles that are currently in use for a given list-view control. You can use this macro or send the LVM_GETEXTENDEDLISTVIEWSTYLE message explicitly.
ListView_GetGroupInfoRetrieves group information. You can use this macro or send the LVM_GETGROUPINFO message explicitly.
ListView_GetGroupMetricsRetrieves the metrics of a group. You can use this macro or send the LVM_GETGROUPMETRICS message explicitly.
ListView_GetHeaderRetrieves the handle to the header control used by a list-view control. You can use this macro or send the LVM_GETHEADER message explicitly.
ListView_GetHotCursorRetrieves the HCURSOR used when the pointer is over an item while hot tracking is enabled. You can use this macro or send the LVM_GETHOTCURSOR message explicitly.
ListView_GetHotItemRetrieves the index of the hot item. You can use this macro or send the LVM_GETHOTITEM message explicitly.
ListView_GetHoverTimeRetrieves the amount of time that the mouse cursor must hover over an item before it is selected. You can use this macro or send the LVM_GETHOVERTIME message explicitly.
ListView_GetImageListRetrieves the handle to an image list used for drawing list-view items. You can use this macro or send the LVM_GETIMAGELIST message explicitly.
ListView_GetInsertMarkRetrieves the position of the insertion point. You can use this macro or send the LVM_GETINSERTMARK message explicitly.
ListView_GetInsertMarkColorRetrieves the color of the insertion point. You can use this macro or send the LVM_GETINSERTMARKCOLOR message explicitly.
ListView_GetInsertMarkRectRetrieves the rectangle that bounds the insertion point. You can use this macro or send the LVM_GETINSERTMARKRECT message explicitly.
ListView_GetISearchStringRetrieves the incremental search string of a list-view control. You can use this macro or send the LVM_GETISEARCHSTRING message explicitly.
ListView_GetItemRetrieves some or all of a list-view item's attributes. You can use this macro or send the LVM_GETITEM message explicitly.
ListView_GetItemCountRetrieves the number of items in a list-view control. You can use this macro or send the LVM_GETITEMCOUNT message explicitly.
ListView_GetItemPositionRetrieves the position of a list-view item. You can use this macro or explicitly send the LVM_GETITEMPOSITION message.
ListView_GetItemRectRetrieves the bounding rectangle for all or part of an item in the current view. You can use this macro or send the LVM_GETITEMRECT message explicitly.
ListView_GetItemSpacingDetermines the spacing between items in a list-view control. You can use this macro or send the LVM_GETITEMSPACING message explicitly.
ListView_GetItemStateRetrieves the state of a list-view item. You can use this macro or send the LVM_GETITEMSTATE message explicitly.
ListView_GetItemTextRetrieves the text of a list-view item or subitem. You can use this macro or send the LVM_GETITEMTEXT message explicitly.
ListView_GetNextItemSearches for a list-view item that has the specified properties and bears the specified relationship to a specified item. You can use this macro or send the LVM_GETNEXTITEM message explicitly.
ListView_GetNumberOfWorkAreasRetrieves the number of working areas in a list-view control. You can use this macro or send the LVM_GETNUMBEROFWORKAREAS message explicitly.
ListView_GetOriginRetrieves the current view origin for a list-view control. You can use this macro or send the LVM_GETORIGIN message explicitly.
ListView_GetOutlineColorRetrieves the color of the border of a list-view control if the LVS_EX_BORDERSELECT extended window style is set. You can use this macro or send the LVM_GETOUTLINECOLOR message explicitly.
ListView_GetSelectedColumnRetrieves an integer that specifies the selected column. You can use this macro or send the LVM_GETSELECTEDCOLUMN message explicitly.
ListView_GetSelectedCountDetermines the number of selected items in a list-view control. You can use this macro or send the LVM_GETSELECTEDCOUNT message explicitly.
ListView_GetSelectionMarkRetrieves the selection mark from a list-view control. You can use this macro or explicitly send the LVM_GETSELECTIONMARK message.
ListView_GetStringWidthDetermines the width of a specified string using the specified list-view control's current font. You can use this macro or send the LVM_GETSTRINGWIDTH message explicitly.
ListView_GetSubItemRectRetrieves information about the rectangle that surrounds a subitem in a list-view control. You can use this macro (recommended) or send the LVM_GETSUBITEMRECT message explicitly. This macro is intended to be used only on list-view controls that use the LVS_REPORT style.
ListView_GetTextBkColorRetrieves the text background color of a list-view control. You can use this macro or send the LVM_GETTEXTBKCOLOR message explicitly.
ListView_GetTextColorRetrieves the text color of a list-view control. You can use this macro or send the LVM_GETTEXTCOLOR message explicitly.
ListView_GetTileInfoRetrieves information about a tile in a list-view control. You can use this macro or send the LVM_GETTILEINFO message explicitly.
ListView_GetTileViewInfoRetrieves information about a list-view control in tile view. You can use this macro or send the LVM_GETTILEVIEWINFO message explicitly.
ListView_GetToolTipsRetrieves the ToolTip control that the list-view control uses to display ToolTips. You can use this macro or send the LVM_GETTOOLTIPS message explicitly.
ListView_GetTopIndexRetrieves the index of the topmost visible item when in list or report view. You can use this macro or send the LVM_GETTOPINDEX message explicitly.
ListView_GetUnicodeFormatRetrieves the Unicode character format flag for the control. You can use this macro or send the LVM_GETUNICODEFORMAT message explicitly.
ListView_GetViewRetrieves the current view of a list-view control. You can use this macro or send the LVM_GETVIEW message explicitly.
ListView_GetViewRectRetrieves the bounding rectangle of all items in the list-view control. The list view must be in icon or small icon view. You can use this macro or send the LVM_GETVIEWRECT message explicitly.
ListView_GetWorkAreasRetrieves the working areas from a list-view control. You can use this macro, or send the LVM_GETWORKAREAS message explicitly.
ListView_HasGroupDetermines whether the list-view control has a specified group. You can use this macro or send the LVM_HASGROUP message explicitly.
ListView_HitTestDetermines which list-view item, if any, is at a specified position. You can use this macro or send the LVM_HITTEST message explicitly.
ListView_InsertColumnInserts a new column in a list-view control. You can use this macro or send the LVM_INSERTCOLUMN message explicitly.
ListView_InsertGroupInserts a group into a list-view control. You can use this macro or send the LVM_INSERTGROUP message explicitly.
ListView_InsertGroupSortedInserts a group into an ordered list of groups. You can use this macro or send the LVM_INSERTGROUPSORTED message explicitly.
ListView_InsertItemInserts a new item in a list-view control. You can use this macro or send the LVM_INSERTITEM message explicitly.
ListView_InsertMarkHitTestRetrieves the insertion point closest to a specified point. You can use this macro or send the LVM_INSERTMARKHITTEST message explicitly.
ListView_IsGroupViewEnabledChecks whether the list-view control has group view enabled. You can use this macro or send the LVM_ISGROUPVIEWENABLED message explicitly.
ListView_MapIDToIndexMaps the identifier (ID) of an item to an index. You can use this macro or send the LVM_MAPIDTOINDEX message explicitly.
ListView_MapIndexToIDMaps the index of an item to a unique ID. You can use this macro or send the LVM_MAPINDEXTOID message explicitly.
ListView_MoveGroupMoves the group to the specified zero based index. You can use this macro or send the LVM_MOVEGROUP message explicitly.
ListView_MoveItemToGroupMoves an item specified by an index into a group. You can use this macro or send the LVM_MOVEITEMTOGROUP message explicitly.
ListView_RedrawItemsForces a list-view control to redraw a range of items. You can use this macro or send the LVM_REDRAWITEMS message explicitly.
ListView_RemoveAllGroupsRemoves all groups from a list-view control. You can use this macro or send the LVM_REMOVEALLGROUPS message explicitly.
ListView_RemoveGroupRemoves a group from a list-view control. You can use this macro or send the LVM_REMOVEGROUP message explicitly.
ListView_ScrollScrolls the content of a list-view control. You can use this macro or send the LVM_SCROLL message explicitly.
ListView_SetBkColorSets the background color of a list-view control. You can use this macro or send the LVM_SETBKCOLOR message explicitly.
ListView_SetBkImageSets the background image in a list-view control. You can use this macro or send the LVM_SETBKIMAGE message explicitly.
ListView_SetCallbackMaskChanges the callback mask for a list-view control. You can use this macro or send the LVM_SETCALLBACKMASK message explicitly.
ListView_SetCheckStateUsed to select or deselect an item in a list-view control. You can use this macro or send the LVM_SETITEMSTATE message explicitly.
ListView_SetColumnSets the attributes of a list-view column. You can use this macro or send the LVM_SETCOLUMN message explicitly.
ListView_SetColumnOrderArraySets the left-to-right order of columns in a list-view control. You can use this macro or send the LVM_SETCOLUMNORDERARRAY message explicitly.
ListView_SetColumnWidthUsed to change the width of a column in report view or the width of all columns in list-view mode. You can use this macro or send the LVM_SETCOLUMNWIDTH message explicitly.
ListView_SetExtendedListViewStyleSets extended styles for list-view controls. You can use this macro or send the LVM_SETEXTENDEDLISTVIEWSTYLE message explicitly.
ListView_SetExtendedListViewStyleExSets extended styles for list-view controls using the style mask. You can use this macro or send the LVM_SETEXTENDEDLISTVIEWSTYLE message explicitly.
ListView_SetGroupInfoSets group information. You can use this macro or send the LVM_SETGROUPINFO message explicitly.
ListView_SetGroupMetricsSets the metrics of a group. You can use this macro or send the LVM_SETGROUPMETRICS message explicitly.
ListView_SetHotCursorSets the HCURSOR that the list-view control uses when the pointer is over an item while hot tracking is enabled. You can use this macro or send the LVM_SETHOTCURSOR message explicitly. To check whether or not hot tracking is enabled, call SystemParametersInfo.
ListView_SetHotItemSets the hot item in a list-view control. You can use this macro or send the LVM_SETHOTITEM message explicitly.
ListView_SetHoverTimeSets the amount of time that the mouse cursor must hover over an item before it is selected. You can use this macro or send the LVM_SETHOVERTIME message explicitly.
ListView_SetIconSpacingSets the spacing between icons in list-view controls set to the LVS_ICON style. You can use this macro or send the LVM_SETICONSPACING message explicitly.
ListView_SetImageListAssigns an image list to a list-view control. You can use this macro or send the LVM_SETIMAGELIST message explicitly.
ListView_SetInfoTipSets tooltip text. You can use this macro or send the LVM_SETINFOTIP message explicitly.
ListView_SetInsertMarkSets the insertion point to the defined position. You can use this macro or send the LVM_SETINSERTMARK message explicitly.
ListView_SetInsertMarkColorSets the color of the insertion point. You can use this macro or send the LVM_SETINSERTMARKCOLOR message explicitly.
ListView_SetItemSets some or all of a list-view item's attributes. You can also use ListView_SetItem to set the text of a subitem. You can use this macro or send the LVM_SETITEM message explicitly.
ListView_SetItemCountCauses the list-view control to allocate memory for the specified number of items. You can use this macro or send the LVM_SETITEMCOUNT message explicitly.
ListView_SetItemCountExSets the virtual number of items in a virtual list view. You can use this macro or send the LVM_SETITEMCOUNT message explicitly.
ListView_SetItemPositionMoves an item to a specified position in a list-view control (in icon or small icon view). You can use this macro or send the LVM_SETITEMPOSITION message explicitly.
ListView_SetItemPosition32Moves an item to a specified position in a list-view control (in icon or small icon view). This macro differs from the ListView_SetItemPosition macro in that it uses 32-bit coordinates. You can use the ListView_SetItemPosition32 macro or send the LVM_SETITEMPOSITION32 message explicitly.
ListView_SetItemStateChanges the state of an item in a list-view control. You can use this macro or send the LVM_SETITEMSTATE message explicitly.
ListView_SetItemTextChanges the text of a list-view item or subitem. You can use this macro or send the LVM_SETITEMTEXT message explicitly.
ListView_SetOutlineColorSets the color of the border of a list-view control if the LVS_EX_BORDERSELECT extended window style is set. You can use this macro or send the LVM_SETOUTLINECOLOR message explicitly.
ListView_SetSelectedColumnSets the index of the selected column. You can use this macro or send the LVM_SETSELECTEDCOLUMN message explicitly.
ListView_SetSelectionMarkSets the selection mark in a list-view control. You can use this macro or send the LVM_SETSELECTIONMARK message explicitly.
ListView_SetTextBkColorSets the background color of text in a list-view control. You can use this macro or send the LVM_SETTEXTBKCOLOR message explicitly.
ListView_SetTextColorSets the text color of a list-view control. You can use this macro or send the LVM_SETTEXTCOLOR message explicitly.
ListView_SetTileInfoSets information for a tile of a list-view control. You can use this macro or send the LVM_SETTILEINFO message explicitly.
ListView_SetTileViewInfoSets information that a list-view control uses in tile view. You can use this macro or send the LVM_SETTILEVIEWINFO message explicitly.
ListView_SetTileWidthNot currently supported.
ListView_SetToolTipsSets the ToolTip control that the list-view control will use to display ToolTips. You can use this macro or send the LVM_SETTOOLTIPS message explicitly.
ListView_SetUnicodeFormatSets the Unicode character format flag for the control. This message allows you to change the character set used by the control at run time rather than having to re-create the control. You can use this macro or send the LVM_SETUNICODEFORMAT message explicitly.
ListView_SetViewSets the view of a list-view control. You can use this macro or send the LVM_SETVIEW message explicitly.
ListView_SetWorkAreasSets the working area within a list-view control. You can use this macro or send the LVM_SETWORKAREAS message explicitly.
ListView_SortGroupsUses an application-defined comparison function to sort groups by ID within a list-view control. You can use this macro or send the LVM_SORTGROUPS message explicitly.
ListView_SortItemsUses an application-defined comparison function to sort the items of a list-view control. The index of each item changes to reflect the new sequence. You can use this macro or send the LVM_SORTITEMS message explicitly.
ListView_SortItemsExUses an application-defined comparison function to sort the items of a list-view control. The index of each item changes to reflect the new sequence. You can use this macro or send the LVM_SORTITEMSEX message explicitly.
ListView_SubItemHitTestDetermines which list-view item or subitem is located at a given position. You can use this macro or send the LVM_SUBITEMHITTEST message explicitly.
ListView_UpdateUpdates a list-view item. If the list-view control has the LVS_AUTOARRANGE style, this macro causes the list-view control to be arranged. You can use this macro or send the LVM_UPDATE message explicitly.
Messages
LVM_APPROXIMATEVIEWRECTCalculates the approximate width and height required to display a given number of items. You can send this message explicitly or use the ListView_ApproximateViewRect macro.
LVM_ARRANGEArranges items in icon view. You can send this message explicitly or by using the ListView_Arrange macro.
LVM_CANCELEDITLABELCancels an item text editing operation.
LVM_CREATEDRAGIMAGECreates a drag image list for the specified item. You can send this message explicitly or by using the ListView_CreateDragImage macro.
LVM_DELETEALLITEMSRemoves all items from a list-view control. You can send this message explicitly or by using the ListView_DeleteAllItems macro.
LVM_DELETECOLUMNRemoves a column from a list-view control. You can send this message explicitly or by using the ListView_DeleteColumn macro.
LVM_DELETEITEMRemoves an item from a list-view control. You can send this message explicitly or by using the ListView_DeleteItem macro.
LVM_EDITLABELBegins in-place editing of the specified list-view item's text. The message implicitly selects and focuses the specified item. You can send this message explicitly or by using the ListView_EditLabel macro.
LVM_ENABLEGROUPVIEWEnables or disables whether the items in a list-view control display as a group.
LVM_ENSUREVISIBLEEnsures that a list-view item is either entirely or partially visible, scrolling the list-view control if necessary. You can send this message explicitly or by using the ListView_EnsureVisible macro.
LVM_FINDITEMSearches for a list-view item with the specified characteristics. You can send this message explicitly or by using the ListView_FindItem macro.
LVM_GETBKCOLORRetrieves the background color of a list-view control. You can send this message explicitly or by using the ListView_GetBkColor macro.
LVM_GETBKIMAGERetrieves the background image in a list-view control. You can send this message explicitly or by using the ListView_GetBkImage macro.
LVM_GETCALLBACKMASKRetrieves the callback mask for a list-view control. You can send this message explicitly or by using the ListView_GetCallbackMask macro.
LVM_GETCOLUMNRetrieves the attributes of a list-view control's column. You can send this message explicitly or by using the ListView_GetColumn macro.
LVM_GETCOLUMNORDERARRAYRetrieves the current left-to-right order of columns in a list-view control. You can send this message explicitly or use the ListView_GetColumnOrderArray macro.
LVM_GETCOLUMNWIDTHRetrieves the width of a column in report or list view. You can send this message explicitly or by using the ListView_GetColumnWidth macro.
LVM_GETCOUNTPERPAGECalculates the number of items that can fit vertically in the visible area of a list-view control when in list or report view. Only fully visible items are counted. You can send this message explicitly or by using the ListView_GetCountPerPage macro.
LVM_GETEDITCONTROLRetrieves the handle to the edit control being used to edit a list-view item's text. You can send this message explicitly or by using the ListView_GetEditControl macro.
LVM_GETEXTENDEDLISTVIEWSTYLERetrieves the extended styles that are currently in use for a given list-view control. You can send this message explicitly or use the ListView_GetExtendedListViewStyle macro.
LVM_GETGROUPINFORetrieves group information.
LVM_GETGROUPMETRICSRetrieves the metrics of a group.
LVM_GETHEADERRetrieves the handle to the header control used by the list-view control. You can send this message explicitly or use the ListView_GetHeader macro.
LVM_GETHOTCURSORRetrieves the HCURSOR value used when the pointer is over an item while hot tracking is enabled. You can send this message explicitly or use the ListView_GetHotCursor macro.
LVM_GETHOTITEMRetrieves the index of the hot item. You can send this message explicitly or use the ListView_GetHotItem macro.
LVM_GETHOVERTIMERetrieves the amount of time that the mouse cursor must hover over an item before it is selected. You can send this message explicitly or use the ListView_GetHoverTime macro.
LVM_GETIMAGELISTRetrieves the handle to an image list used for drawing list-view items. You can send this message explicitly or by using the ListView_GetImageList macro.
LVM_GETINSERTMARKRetrieves the position of the insertion point.
LVM_GETINSERTMARKCOLORRetrieves the color of the insertion point.
LVM_GETINSERTMARKRECTRetrieves the rectangle that bounds the insertion point.
LVM_GETISEARCHSTRINGRetrieves the incremental search string of a list-view control. You can send this message explicitly or by using the ListView_GetISearchString macro.
LVM_GETITEMRetrieves some or all of a list-view item's attributes. You can send this message explicitly or by using the ListView_GetItem macro.
LVM_GETITEMCOUNTRetrieves the number of items in a list-view control. You can send this message explicitly or by using the ListView_GetItemCount macro.
LVM_GETITEMPOSITIONRetrieves the position of a list-view item. You can send this message explicitly or by using the ListView_GetItemPosition macro.
LVM_GETITEMRECTRetrieves the bounding rectangle for all or part of an item in the current view. You can send this message explicitly or by using the ListView_GetItemRect macro.
LVM_GETITEMSPACINGDetermines the spacing between items in a list-view control. You can send this message explicitly or by using the ListView_GetItemSpacing macro.
LVM_GETITEMSTATERetrieves the state of a list-view item. You can send this message explicitly or by using the ListView_GetItemState macro.
LVM_GETITEMTEXTRetrieves the text of a list-view item or subitem. You can send this message explicitly or by using the ListView_GetItemText macro.
LVM_GETNEXTITEMSearches for a list-view item that has the specified properties and bears the specified relationship to a specified item. You can send this message explicitly or by using the ListView_GetNextItem macro.
LVM_GETNUMBEROFWORKAREASRetrieves the number of List-View Working Areas in a list-view control. You can send this message explicitly or use the ListView_GetNumberOfWorkAreas macro.
LVM_GETORIGINRetrieves the current view origin for a list-view control. You can send this message explicitly or by using the ListView_GetOrigin macro.
LVM_GETOUTLINECOLORRetrieves the color of the border of a list-view control if the LVS_EX_BORDERSELECT extended window style is set.
LVM_GETSELECTEDCOLUMNRetrieves an integer that specifies the selected column.
LVM_GETSELECTEDCOUNTDetermines the number of selected items in a list-view control. You can send this message explicitly or by using the ListView_GetSelectedCount macro.
LVM_GETSELECTIONMARKRetrieves the selection mark from a list-view control. You can send this message explicitly or use the ListView_GetSelectionMark macro.
LVM_GETSTRINGWIDTHDetermines the width of a specified string using the specified list-view control's current font. You can send this message explicitly or by using the ListView_GetStringWidth macro.
LVM_GETSUBITEMRECTRetrieves information about the bounding rectangle for a subitem in a list-view control. You can send this message explicitly or by using the ListView_GetSubItemRect macro (recommended). This message is intended to be used only with list-view controls that use the LVS_REPORT style.
LVM_GETTEXTBKCOLORRetrieves the text background color of a list-view control. You can send this message explicitly or by using the ListView_GetTextBkColor macro.
LVM_GETTEXTCOLORRetrieves the text color of a list-view control. You can send this message explicitly or by using the ListView_GetTextColor macro.
LVM_GETTILEINFORetrieves information about a tile in a list-view control.
LVM_GETTILEVIEWINFORetrieves information about a list-view control in tile view.
LVM_GETTOOLTIPSRetrieves the ToolTip control that the list-view control uses to display ToolTips. You can send this message explicitly or use the ListView_GetToolTips macro.
LVM_GETTOPINDEXRetrieves the index of the topmost visible item when in list or report view. You can send this message explicitly or by using the ListView_GetTopIndex macro.
LVM_GETUNICODEFORMATRetrieves the UNICODE character format flag for the control. You can send this message explicitly or use the ListView_GetUnicodeFormat macro.
LVM_GETVIEWRetrieves the current view of a list-view control.
LVM_GETVIEWRECTRetrieves the bounding rectangle of all items in the list-view control. The list view must be in icon or small icon view. You can send this message explicitly or by using the ListView_GetViewRect macro.
LVM_GETWORKAREASRetrieves the working areas from a list-view control. You can send this message explicitly or use the ListView_GetWorkAreas macro.
LVM_HASGROUPDetermines whether the list-view control has a specified group.
LVM_HITTESTDetermines which list-view item, if any, is at a specified position. You can send this message explicitly or by using the ListView_HitTest macro.
LVM_INSERTCOLUMNInserts a new column in a list-view control. You can send this message explicitly or by using the ListView_InsertColumn macro.
LVM_INSERTGROUPInserts a group into a list-view control.
LVM_INSERTGROUPSORTEDInserts a group into an ordered list of groups.
LVM_INSERTITEMInserts a new item in a list-view control. You can send this message explicitly or by using the ListView_InsertItem macro.
LVM_INSERTMARKHITTESTRetrieves the insertion point closest to a specified point.
LVM_ISGROUPVIEWENABLEDChecks whether the list-view control has group view enabled.
LVM_MAPIDTOINDEXMaps the ID of an item to an index.
LVM_MAPINDEXTOIDMaps the index of an item to a unique ID.
LVM_MOVEGROUPMoves the group to the specified zero based index.
LVM_MOVEITEMTOGROUPMoves an item specified by an index into a group.
LVM_REDRAWITEMSForces a list-view control to redraw a range of items. You can send this message explicitly or by using the ListView_RedrawItems macro.
LVM_REMOVEALLGROUPSRemoves all groups from a list-view control.
LVM_REMOVEGROUPRemoves a group from a list-view control.
LVM_SCROLLScrolls the content of a list-view control. You can send this message explicitly or by using the ListView_Scroll macro.
LVM_SETBKCOLORSets the background color of a list-view control. You can send this message explicitly or by using the ListView_SetBkColor macro.
LVM_SETBKIMAGESets the background image in a list-view control. You can send this message explicitly or by using the ListView_SetBkImage macro.
LVM_SETCALLBACKMASKChanges the callback mask for a list-view control. You can send this message explicitly or by using the ListView_SetCallbackMask macro.
LVM_SETCOLUMNSets the attributes of a list-view column. You can send this message explicitly or by using the ListView_SetColumn macro.
LVM_SETCOLUMNORDERARRAYSets the left-to-right order of columns in a list-view control. You can send this message explicitly or use the ListView_SetColumnOrderArray macro.
LVM_SETCOLUMNWIDTHChanges the width of a column in report-view mode or the width of all columns in list-view mode. You can send this message explicitly or use the ListView_SetColumnWidth macro.
LVM_SETEXTENDEDLISTVIEWSTYLESets extended styles in list-view controls. You can send this message explicitly or use the ListView_SetExtendedListViewStyle or ListView_SetExtendedListViewStyleEx macro.
LVM_SETGROUPINFOSets group information.
LVM_SETGROUPMETRICSSets the metrics of a group.
LVM_SETHOTCURSORSets the HCURSOR value that the list-view control uses when the pointer is over an item while hot tracking is enabled. You can send this message explicitly or use the ListView_SetHotCursor macro. To check whether or not hot tracking is enabled, call SystemParametersInfo.
LVM_SETHOTITEMSets the hot item for a list-view control. You can send this message explicitly or use the ListView_SetHotItem macro.
LVM_SETHOVERTIMESets the amount of time which the mouse cursor must hover over an item before it is selected. You can send this message explicitly or use the ListView_SetHoverTime macro.
LVM_SETICONSPACINGSets the spacing between icons in list-view controls that have the LVS_ICON style. You can send this message explicitly or by using the ListView_SetIconSpacing macro.
LVM_SETIMAGELISTAssigns an image list to a list-view control. You can send this message explicitly or by using the ListView_SetImageList macro.
LVM_SETINFOTIPSets ToolTip text.
LVM_SETINSERTMARKSets the insertion point to the defined position.
LVM_SETINSERTMARKCOLORSets the color of the insertion point.
LVM_SETITEMSets some or all of a list-view item's attributes. You can also send LVM_SETITEM to set the text of a subitem. You can send this message explicitly or by using the ListView_SetItem macro.
LVM_SETITEMCOUNTCauses the list-view control to allocate memory for the specified number of items or sets the virtual number of items in a virtual list-view control. This depends on how the list-view control was created. You can send this message explicitly or use the ListView_SetItemCount or ListView_SetItemCountEx macros.
LVM_SETITEMPOSITIONMoves an item to a specified position in a list-view control (must be in icon or small icon view). You can send this message explicitly or by using the ListView_SetItemPosition macro.
LVM_SETITEMPOSITION32Moves an item to a specified position in a list-view control (must be in icon or small icon view). This message differs from the LVM_SETITEMPOSITION message in that it uses 32-bit coordinates. You can send this message explicitly or by using the ListView_SetItemPosition32 macro.
LVM_SETITEMSTATEChanges the state of an item in a list-view control. You can send this message explicitly or by using the ListView_SetItemState macro.
LVM_SETITEMTEXTChanges the text of a list-view item or subitem. You can send this message explicitly or by using the ListView_SetItemText macro.
LVM_SETOUTLINECOLORSets the color of the border of a list-view control if the LVS_EX_BORDERSELECT extended window style is set.
LVM_SETSELECTEDCOLUMNSets the index of the selected column.
LVM_SETSELECTIONMARKSets the selection mark in a list-view control. You can send this message explicitly or use the ListView_SetSelectionMark macro.
LVM_SETTEXTBKCOLORSets the background color of text in a list-view control. You can send this message explicitly or by using the ListView_SetTextBkColor macro.
LVM_SETTEXTCOLORSets the text color of a list-view control. You can send this message explicitly or by using the ListView_SetTextColor macro.
LVM_SETTILEINFOSets information for a tile of a list-view control.
LVM_SETTILEVIEWINFOSets information that a list-view control uses in tile view.
LVM_SETTILEWIDTHNot currently supported.
LVM_SETTOOLTIPSSets the ToolTip control that the list-view control will use to display ToolTips. You can send this message explicitly or use the ListView_SetToolTips macro.
LVM_SETUNICODEFORMATSets the UNICODE character format flag for the control. This message allows you to change the character set used by the control at run time rather than having to re-create the control. You can send this message explicitly or use the ListView_SetUnicodeFormat macro.
LVM_SETVIEWSets the view of a list-view control.
LVM_SETWORKAREASSets the working areas within a list-view control. You can send this message explicitly or use the ListView_SetWorkAreas macro.
LVM_SORTGROUPSUses an application-defined comparison function to sort groups by ID within a list-view control.
LVM_SORTITEMSUses an application-defined comparison function to sort the items of a list-view control. The index of each item changes to reflect the new sequence. You can send this message explicitly or by using the ListView_SortItems macro.
LVM_SORTITEMSEXUses an application-defined comparison function to sort the items of a list-view control. The index of each item changes to reflect the new sequence. You can send this message explicitly or by using the ListView_SortItemsEx macro.
LVM_SUBITEMHITTESTDetermines which list-view item or subitem is at a given position. You can send this message explicitly or by using the ListView_SubItemHitTest macro.
LVM_UPDATEUpdates a list-view item. If the list-view control has the LVS_AUTOARRANGE style, this macro causes the list-view control to be arranged. You can send this message explicitly or by using the ListView_Update macro.
Notifications
LVN_BEGINDRAGNotifies a list-view control's parent window that a drag-and-drop operation involving the left mouse button is being initiated. This notification message is sent in the form of a WM_NOTIFY message.
LVN_BEGINLABELEDITNotifies a list-view control's parent window about the start of label editing for an item. This notification message is sent in the form of a WM_NOTIFY message.
LVN_BEGINRDRAGNotifies a list-view control's parent window that a drag-and-drop operation involving the right mouse button is being initiated. This notification message is sent in the form of a WM_NOTIFY message.
LVN_BEGINSCROLLNotifies a list-view control's parent window when a scrolling operation starts.
LVN_COLUMNCLICKNotifies a list-view control's parent window that a column was clicked. This notification message is sent in the form of a WM_NOTIFY message.
LVN_DELETEALLITEMSNotifies a list-view control's parent window that all items in the control are about to be deleted. This notification message is sent in the form of a WM_NOTIFY message.
LVN_DELETEITEMNotifies a list-view control's parent window that an item is about to be deleted. This notification message is sent in the form of a WM_NOTIFY message.
LVN_ENDLABELEDITNotifies a list-view control's parent window about the end of label editing for an item. This notification message is sent in the form of a WM_NOTIFY message.
LVN_ENDSCROLLNotifies a list-view control's parent window when a scrolling operation ends.
LVN_GETDISPINFOSent by a list-view control to its parent window. It is a request for the parent window to provide information needed to display or sort a list-view item. This notification message is sent in the form of a WM_NOTIFY message.
LVN_GETINFOTIPSent by a large icon view list-view control that has the LVS_EX_INFOTIP extended style. This notification is sent when the list-view control is requesting additional text information to be displayed in a ToolTip. It is sent in the form of a WM_NOTIFY message.
LVN_HOTTRACKSent by a list-view control when the user moves the mouse over an item. This notification is only sent by list-view controls that have the LVS_EX_TRACKSELECT extended list-view style. It is sent in the form of a WM_NOTIFY message.
LVN_INSERTITEMNotifies a list-view control's parent window that a new item was inserted. This notification message is sent in the form of a WM_NOTIFY message.
LVN_ITEMACTIVATESent by a list-view control when the user activates an item. This notification is sent in the form of a WM_NOTIFY message.
LVN_ITEMCHANGEDNotifies a list-view control's parent window that an item has changed. This notification message is sent in the form of a WM_NOTIFY message.
LVN_ITEMCHANGINGNotifies a list-view control's parent window that an item is changing. This notification message is sent in the form of a WM_NOTIFY message.
LVN_KEYDOWNNotifies a list-view control's parent window that a key has been pressed. This notification message is sent in the form of a WM_NOTIFY message.
LVN_MARQUEEBEGINNotifies a list-view control's parent window that a bounding box (marquee) selection has begun. This notification message is sent in the form of a WM_NOTIFY message.
LVN_ODCACHEHINTSent by a virtual list-view control when the contents of its display area have changed. For example, a list-view control sends this notification when the user scrolls the control's display. The LVN_ODCACHEHINT notification message is sent in the form of a WM_NOTIFY message.
LVN_ODFINDITEMSent by a virtual list-view control when it needs the owner to find a particular callback item. For example, the control will send this notification when it receives shortcut keyboard input or when it receives an LVM_FINDITEM message.
LVN_ODSTATECHANGEDSent by a list-view control when the state of an item or range of items has changed. This notification is sent in the form of a WM_NOTIFY message.
LVN_SETDISPINFONotifies a list-view control's parent window that it must update the information it maintains for an item. This notification message is sent in the form of a WM_NOTIFY message.
NM_CLICK (list view)Sent by a list-view control when the user clicks an item with the left mouse button. This notification message is sent in the form of a WM_NOTIFY message.
NM_CUSTOMDRAW (list view)Sent by a list-view control to notify its parent windows about drawing operations. This notification is sent in the form of a WM_NOTIFY message.
NM_DBLCLK (list view)Sent by a list-view control when the user double-clicks an item with the left mouse button. This notification message is sent in the form of a WM_NOTIFY message.
NM_HOVER (list view)Sent by a list-view control when the mouse hovers over an item. This notification message is sent in the form of a WM_NOTIFY message.
NM_KILLFOCUS (list view)Notifies a list-view control's parent window that the control has lost the input focus. NM_KILLFOCUS (list view) is sent in the form of a WM_NOTIFY message.
NM_RCLICK (list view)Sent by a list-view control when the user clicks an item with the right mouse button. This notification message is sent in the form of a WM_NOTIFY message.
NM_RDBLCLK (list view)Sent by a list-view control when the user double-clicks an item with the right mouse button. This notification message is sent in the form of a WM_NOTIFY message.
NM_RELEASEDCAPTURE (list view)Notifies a list-view control's parent window that the control is releasing mouse capture. This notification is sent in the form of a WM_NOTIFY message.
NM_RETURN (list view)Notifies a list-view control's parent window that the control has the input focus and that the user has pressed the ENTER key. NM_RETURN is sent in the form of a WM_NOTIFY message.
NM_SETFOCUS (list view)Notifies a list-view control's parent window that the control has received the input focus. NM_SETFOCUS (list view) is sent in the form of a WM_NOTIFY message.
Structures
LVBKIMAGEContains information about the background image of a list-view control. This structure is used for both setting and retrieving background image information.
LVCOLUMNContains information about a column in report view. This structure is used both for creating and manipulating columns. This structure supersedes the LVCOLUMN structure.
LVFINDINFOContains information used when searching for a list-view item. This structure is identical to LVFINDINFO but has been renamed to fit standard naming conventions.
LVGROUPUsed to set and retrieve groups.
LVGROUPMETRICSUsed to retrieve or set group metrics.
LVHITTESTINFOHas been extended to accommodate subitem hit-testing. The LVHITTESTINFO structure contains information about a hit test. It is used in association with the LVM_HITTEST and LVM_SUBITEMHITTEST messages and their related macros. This structure supersedes the LVHITTESTINFO structure.
LVINSERTGROUPSORTEDUsed to sort groups. It is used with LVM_INSERTGROUPSORTED.
LVINSERTMARKUsed to describe insertion points.
LVITEMSpecifies or receives the attributes of a list-view item. This structure has been updated to support a new mask value (LVIF_INDENT) that enables item indenting. This structure supersedes the LV_ITEM structure.
LVSETINFOTIPProvides information about tooltip text that is to be set.
LVTILEINFOProvides information about an item in a list-view control when it is displayed in tile view.
LVTILEVIEWINFOProvides information about a list-view control when it is displayed in tile view.
NMITEMACTIVATEContains information about an LVN_ITEMACTIVATE notification message.
NMLISTVIEWContains information about a list-view notification message. This structure is the same as the NM_LISTVIEW structure but has been renamed to fit standard naming conventions.
NMLVCACHEHINTContains information used to update the cached item information for use with a virtual list view.
NMLVCUSTOMDRAWContains information specific to an NM_CUSTOMDRAW (list view) notification message sent by a list-view control.
NMLVDISPINFOContains information about an LVN_GETDISPINFO or LVN_SETDISPINFO notification message. This structure is the same as the LV_DISPINFO structure, but has been renamed to fit standard naming conventions.
NMLVFINDITEMContains information the owner needs to find items requested by a virtual list view control. This structure is used with the LVN_ODFINDITEM notification message.
NMLVGETINFOTIPContains and receives list-view item information needed to display a ToolTip for an item. This structure is used with the LVN_GETINFOTIP notification message.
NMLVKEYDOWNContains information used in processing the LVN_KEYDOWN notification message. This structure is the same as the NMLVKEYDOWN structure but has been renamed to fit standard naming conventions.
NMLVODSTATECHANGEStructure that contains information for use in processing the LVN_ODSTATECHANGED notification message.
NMLVSCROLLProvides information about a scrolling operation.
Constants
Extended List-View StylesList-view control styles have been extended. To employ these new styles, use the LVM_SETEXTENDEDLISTVIEWSTYLE message or one of the ListView_SetExtendedListViewStyle or ListView_SetExtendedListViewStyleEx macros.
List-View Item StatesAn item's state value consists of the item's state, an optional overlay mask index, and an optional state image mask index.
An item's state determines its appearance and functionality. The state can be zero or one or more of the following values:
List-View Window Styles
The following window styles are specific to list-view controls