{
	"id": "ca68b47a-df21-4713-9a84-f81e6c1e665f",
	"created_at": "2026-04-06T01:31:40.621046Z",
	"updated_at": "2026-04-10T03:31:19.034732Z",
	"deleted_at": null,
	"sha1_hash": "2046b12e2e50299761f7bc142b1fb9f7e1d743e5",
	"title": "About List-View Controls - Win32 apps",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 982901,
	"plain_text": "About List-View Controls - Win32 apps\r\nBy jwmsft\r\nArchived: 2026-04-06 00:57:25 UTC\r\nSee the Virtual listview control sample.\r\nA list-view control is a window that displays a collection of items. List-view controls provide several ways to\r\narrange and display items and are much more flexible than simple List Boxes. For example, additional\r\ninformation about each item can be displayed in columns to the right of the icon and label.\r\nList-View Styles and Views\r\nExtended List-View Styles\r\nVirtual List-View Style\r\nCreating a Virtual List-View Control\r\nCompatibility Issues\r\nHandling Virtual List-View Control Notification Codes\r\nCache Management\r\nList-View Working Areas\r\nList-View Image Lists\r\nList-View Items and Subitems\r\nList-View Item States\r\nCallback Items and the Callback Mask\r\nList-View Item Position\r\nArranging, Sorting, and Finding Items\r\nList-View Columns\r\nList-View Scroll Position\r\nList-View Label Editing\r\nList-View Colors\r\nArranging List Items by Group\r\nInsertion Marks\r\nList-view controls can display items in five different views. The control's window style specifies the default view.\r\nAdditional window styles specify the alignment of items and control-specific features. The following table\r\ndescribes the views.\r\nView Name Description\r\nIcon view\r\nSpecified by the LVS_ICON window style or by passing LV_VIEW_ICON with the\r\nLVM_SETVIEW message. Each item appears as a full-sized icon with a label below it.\r\nThe user can drag the items to any location in the list-view window.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 1 of 15\n\nView Name Description\r\nSmall icon view\r\nSpecified by the LVS_SMALLICON window style or by passing\r\nLV_VIEW_SMALLICON with LVM_SETVIEW. Each item appears as a small icon\r\nwith the label to the right of it. The user can drag the items to any location.\r\nList view\r\nSpecified by the LVS_LIST window style or by passing LV_VIEW_LIST with\r\nLVM_SETVIEW. Each item appears as a small icon with a label to the right of it. Items\r\nare arranged in columns and the user cannot drag them to an arbitrary location.\r\nReport (details)\r\nview\r\nSpecified by the LVS_REPORT window style or by passing LV_VIEW_DETAILS\r\nwith LVM_SETVIEW. Each item appears on its own line, with information arranged in\r\ncolumns. The leftmost column is always left justified and contains the small icon and\r\nlabel. Subsequent columns contain subitems as specified by the application. Each column\r\nhas a header, unless you also specify the LVS_NOCOLUMNHEADER window style.\r\nTile View\r\nVersion 6 and later. Specified by passing LV_VIEW_TILE with LVM_SETVIEW.\r\nEach item appears as a full-sized icon with a label of one or more lines beside it.\r\nThe following screen shots use views to show different amounts of information about each of seven pets. The\r\nviews demonstrate how the information might appear on Windows Vista. The visual styles for the control have\r\nbeen set to the \"Explorer\" theme by using SetWindowTheme.\r\nThe following screen shot shows the details view.\r\nThe following screen shot shows the icon view.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 2 of 15\n\nThe following screen shot shows the list view.\r\nThe following screen shot shows the tile view.\r\nYou can change the view type after you create a list-view control. To retrieve and change the window style, use\r\nthe GetWindowLong and SetWindowLong functions. To determine the window styles of the current view, use\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 3 of 15\n\nthe LVS_TYPEMASK value.\r\nYou can control the way items are arranged in icon or small icon view by specifying either the LVS_ALIGNTOP\r\n(default) or LVS_ALIGNLEFT window style.\r\nYou can change the alignment after you create a list-view control. To determine the current alignment, use the\r\nLVS_ALIGNMASK value.\r\nAdditional window styles provide other options, such as whether a user can edit labels or select more than one\r\nitem at a time. For a complete list, see List-View Window Styles.\r\nThe extended list-view control styles provide options such as check boxes, flat scroll bars, grid lines, and hot-tracking. For a complete list, see Extended List-View Styles. You do not access extended list-view styles in the\r\nsame manner as standard window styles. You do not use the GetWindowLong and SetWindowLong functions to\r\nmake extended style changes.\r\nThere are two messages that set and retrieve extended style information,\r\nLVM_SETEXTENDEDLISTVIEWSTYLE and LVM_GETEXTENDEDLISTVIEWSTYLE. Instead of\r\nsending the messages explicitly, you can use the following corresponding macros:\r\nListView_SetExtendedListViewStyle, ListView_SetExtendedListViewStyleEx, and\r\nListView_GetExtendedListViewStyle.\r\nA virtual list view is a list-view control that has the LVS_OWNERDATA style. This style enables the control to\r\nhandle millions of items because the owner receives the burden of managing item data. This allows you to use the\r\nvirtual list-view control with large databases of information, where specific methods of data access are already in\r\nplace.\r\nA virtual list-view control maintains very little item information itself. Except for the item selection and focus\r\ninformation, the owner of the control must manage all item information. Other processes request item information\r\nfrom the owner by using LVN_GETDISPINFO notification codes.\r\nBecause this type of list control is intended for large data sets, it is recommended that you cache requested item\r\ndata to improve retrieval performance. The list view provides a cache-hinting mechanism to assist in optimizing\r\nthe cache. The hint is implemented in the form of an LVN_ODCACHEHINT notification code.\r\nYou create virtual list-view controls using the CreateWindow or CreateWindowEx function, specifying the\r\nLVS_OWNERDATA window style as part of the dwStyle function parameter. Dynamically switching to and from\r\nthe LVS_OWNERDATA style is not supported.\r\nYou can use the LVS_OWNERDATA style in combination with most other window styles, except the\r\nLVS_SORTASCENDING or LVS_SORTDESCENDING style. All virtual list-view controls default to the\r\nLVS_AUTOARRANGE style.\r\nTo enable items to be displayed in the list, you must first send the LVM_SETITEMCOUNT message, either\r\nexplicitly or by using the ListView_SetItemCountEx macro.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 4 of 15\n\nThe following messages are not supported under the LVS_OWNERDATA style:\r\nLVM_ENABLEGROUPVIEW, LVM_GETITEMTEXT, LVM_SETTILEINFO, and\r\nLVM_MAPIDTOINDEX.\r\nAll four of the list-view styles—icon, small icon, list, and report view—support the LVS_OWNERDATA style.\r\nList-view controls that have the LVS_OWNERDATA style do not store any item-specific information. Therefore,\r\nthe only valid item state flags that you can apply to an item are LVIS_SELECTED and LVIS_FOCUSED. No\r\nother state information is stored. In particular, the list-view control does not maintain state or overlay images for\r\neach item. However, you can have the list-view control query your application for these images by sending it an\r\nLVM_SETCALLBACKMASK message.\r\nMost list-view control messages and the associated macros are fully supported. However, some messages have\r\nlimitations or are unsupported when you use the LVS_OWNERDATA style. The following table summarizes the\r\naffected messages.\r\nMessage Limitation\r\nLVM_ARRANGE Does not support the LVA_SNAPTOGRID style.\r\nLVM_DELETEALLITEMS\r\nSets the item count to zero and clears all internal selection variables, but it\r\ndoes not actually delete any items. It makes a notification callback.\r\nLVM_DELETEITEM Is supported for selection integrity only and does not actually delete an item.\r\nLVM_GETITEMSTATE\r\nReturns only focus and selection states (that is, those states stored by the\r\nlist-view control).\r\nLVM_GETNEXTITEM\r\nDoes not support the list-view search criteria LVNI_CUT,\r\nLVNI_HIDDEN, or LVNI_DROPHILITED. All other criteria are\r\nsupported.\r\nLVM_GETWORKAREAS Is not supported.\r\nLVM_INSERTITEM Is supported for selection integrity only.\r\nLVM_SETITEM\r\nIs not supported. To set the item state, use the ListView_SetItemState\r\nmessage.\r\nLVM_SETITEMCOUNT\r\nSets the number of items currently in the list. If the list-view control sends a\r\nnotification that requests data for any item up to the maximum set, the\r\nowner must be prepared to supply that data. The message parameters\r\nsupport virtual list-view controls.\r\nLVM_SETITEMPOSITION Is not supported.\r\nLVM_SETITEMSTATE Allows only the selection and focus states to be changed for the item.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 5 of 15\n\nMessage Limitation\r\nLVM_SETITEMTEXT\r\nIs not supported. It is the application's responsibility to maintain the item\r\ntexts.\r\nLVM_SETWORKAREAS Is not supported.\r\nLVM_SORTITEMS\r\nIs not supported. It is the application's responsibility to present the items in\r\nthe desired order.\r\nList-view controls with the LVS_OWNERDATA style send the same notification codes as other list-view\r\ncontrols and two additional ones: LVN_ODCACHEHINT and LVN_ODFINDITEM. The following are the most\r\ncommon notifications that the list-view control with the LVS_OWNERDATA style sends.\r\nNotification Description\r\nLVN_GETDISPINFO\r\nA virtual list-view control maintains very little item information on its own. As a\r\nresult, it often sends the LVN_GETDISPINFO notification code to request item\r\ninformation. This message is handled in much the same way as callback items in a\r\nstandard list control. Because the number of items supported by the control can be\r\nvery large, caching item data improves performance. When handling\r\nLVN_GETDISPINFO, the owner of the control first attempts to supply requested\r\nitem information from the cache (for more information, see Cache Management).\r\nIf the requested item is not cached, the owner must be prepared to supply the\r\ninformation by other means.\r\nLVN_ODCACHEHINT\r\nA virtual list view sends the LVN_ODCACHEHINT notification code to assist in\r\noptimizing the cache. The notification code provides inclusive index values for a\r\nrange of items that it recommends be cached. Upon receiving the notification\r\ncode, the owner must be prepared to load the cache with item information for the\r\nrequested range so that the information will be readily available when an\r\nLVN_GETDISPINFO message is sent.\r\nLVN_ODFINDITEM\r\nThe LVN_ODFINDITEM notification code is sent by a virtual list-view control\r\nwhen the control needs the owner to find a particular callback item. The\r\nnotification code is sent when the list-view control receives quick key access or\r\nwhen it receives an LVM_FINDITEM message. Search information is sent in the\r\nform of an LVFINDINFO structure, which is a member of the\r\nNMLVFINDITEM structure. The owner must be prepared to search for an item\r\nthat matches the information given by the list-view control. The owner returns the\r\nindex of the item if successful, or -1 if no matching item is found.\r\nA list-view control with the LVS_OWNERDATA style produces a large number of LVN_GETDISPINFO\r\nnotification codes and, to assist in optimizing the cache, an LVN_ODCACHEHINT message.\r\nLVN_ODCACHEHINT messages provide information about the recommended items to include within the cache.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 6 of 15\n\nThese messages are sent as WM_NOTIFY messages, with the lParam value acting as the address of an\r\nNMLVCACHEHINT structure.\r\nThe NMLVCACHEHINT structure includes two integer members, iFrom and iTo, that represent the inclusive\r\nendpoints of a range of items that most likely will be needed. The owner must be prepared to load the cache with\r\nthe item information for each of the items within the recommended range.\r\nThe list control often needs item information for the first item (offset 0). The LVN_ODCACHEHINT notification\r\ncode might not always include item 0, but it must always be included in the cache.\r\nThe last items in the list are accessed often. Therefore, the owner might want to keep a second cache that includes\r\nthe items at the end of the list. The requested range from LVN_ODCACHEHINT can be checked against the end\r\ncache to make it available automatically instead of reloading the same end range each time.\r\nList-view controls support working areas, which are rectangular virtual areas that the list-view control uses to\r\narrange its items. A working area is not a window and cannot have a visible border. By default, the list-view\r\ncontrol has no working areas. By creating a working area, you can create an empty border on the left, top, or right\r\nof the items or cause a horizontal scroll bar to be displayed when there normally would not be one.\r\nWhen a working area is created, items that lie within the working area become members of the working area.\r\nSimilarly, if an item is moved into a working area, the item becomes a member of that working area. If an item\r\ndoes not lie within any working area, it automatically becomes a member of the first (index 0) working area. To\r\nplace new item within a specific working area, you must first create the item and then use either the\r\nLVM_SETITEMPOSITION or the LVM_SETITEMPOSITION32 message to move it into the desired\r\nworking area.\r\nThe following illustration is an example of a list-view control that contains four working areas, each in a different\r\nquadrant of the client area.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 7 of 15\n\nMultiple working areas can be used for creating different areas within one view. You can create areas in a single\r\nview that have different meanings. For example, a view of a file system might have an area for read/write files and\r\nanother area for read-only files. The user can categorize items by placing them in different working areas. If a file\r\nis moved into the read-only area, it will automatically become read-only.\r\nMultiple working areas can intersect, but any items that lie within the intersection become members of the area\r\nwith the lower index; therefore, it is best to avoid this situation. When sorting multiple work areas, the items are\r\nsorted compared to the other items in the same working area.\r\nThe number of working areas can be retrieved with the LVM_GETNUMBEROFWORKAREAS message. The\r\nworking areas are changed with the LVM_SETWORKAREAS message and can be retrieved with the\r\nLVM_GETWORKAREAS message. Both of these messages take the address of an array of RECT structures as\r\nthe lParam and the number of RECT structures as the wParam. The left and top members of these structures\r\nspecify the coordinates of the upper-left corner (the origin) of the working area, and the right and bottom\r\nmembers specify the lower-right corner of the working area. All the coordinates are in client coordinates of the list\r\nview. The maximum number of working areas allowed is defined by the LV_MAX_WORKAREAS value.\r\nChanging the working area has no effect on list-view controls that have the LVS_LIST or LVS_REPORT view,\r\nbut the working areas will be maintained when the view type is changed. With the LVS_ICON and\r\nLVS_SMALLICON views, the working area can be modified to change the way the items are displayed. Making\r\nthe width of the working area (right - left) greater than the client width of the control causes the items to be\r\nwrapped at that width and the horizontal scroll bar to be displayed. Making the width of the working area\r\nnarrower than the width of the control's client area causes the items to be wrapped within the working area and not\r\nthe client area. Setting the left or top member to a positive value causes the items to be displayed starting at the\r\nworking area, creating an empty space between the edge of the control and the items. An empty space can also be\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 8 of 15\n\ncreated between the right edge of the control and the items by making the width of the working area less than the\r\nclient width of the control.\r\nBy default, a list-view control does not display item images. To display item images, you must create image lists\r\nand associate them with the control. A list-view control can have three image lists:\r\nAn image list that contains full-sized icons displayed when the control is in icon view.\r\nAn image list that contains small icons displayed when the control is in small icon view, list view, or report\r\nview.\r\nAn image list that contains state images, which are displayed to the left of the full-sized or small icon. You\r\ncan use state images, such as checked and cleared check boxes, to indicate application-defined item states.\r\nState images are displayed in icon view, small icon view, list view, and report view.\r\nThe full-sized and small icon image lists can also contain overlay images, which are designed to be drawn\r\ntransparently over the item icons.\r\nTo use overlay images in a list-view control:\r\n1. Call the ImageList_SetOverlayImage function to assign an overlay image index to an image in the full-sized and small icon image lists. An overlay image is identified by a one-based index.\r\n2. You can associate an overlay image index with an item when you call the ListView_InsertItem or\r\nListView_SetItem macro. Use the INDEXTOOVERLAYMASK macro to specify an overlay image\r\nindex in the state member of the item's LVITEM structure. You must also set the\r\nLVIS_OVERLAYMASK bits in the stateMask member.\r\nIf a state image list is specified, a list-view control reserves space to the left of each item's icon for a state image.\r\nTo associate a state image with an item, use the INDEXTOSTATEIMAGEMASK macro to specify a state image\r\nindex in the state member of the LVITEM structure. The index identifies an image in the control's state image\r\nlist. Although image list indexes are zero-based, the control uses one-based indexes to identify state images. A\r\nstate image index of zero indicates that an item has no state image.\r\nBy default, when a list-view control is destroyed, it destroys the image lists assigned to it. However, if a list-view\r\ncontrol has the LVS_SHAREIMAGELISTS window style, the application is responsible for destroying the\r\nimage lists when they are no longer in use. You should specify this style if you assign the same image lists to\r\nmultiple list-view controls; otherwise, more than one control might try to destroy the same image list.\r\nEach item in a list-view control has an icon, a label, a current state, and an application-defined value. By using\r\nlist-view messages, you can add, modify, and delete items as well as retrieve information about items.\r\nEach item can have one or more subitems. A subitem is a string that, in report view, is displayed in a column\r\nseparate from the item's icon and label. To specify the text of a subitem, use the LVM_SETITEMTEXT or\r\nLVM_SETITEM message. All items in a list-view control have the same number of subitems. The number of\r\nsubitems is determined by the number of columns in the list-view control. When you add a column to a list-view\r\ncontrol, you specify its associated subitem index.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 9 of 15\n\nThe LVITEM structure defines a list-view item or subitem. The iItem member is the zero-based index of the\r\nitem. The iSubItem member is the one-based index of a subitem or zero if the structure contains information\r\nabout an item. Additional members specify the item's text, icon, state, and item data. Item data is an application-defined value associated with a list-view item.\r\nTo add an item to a list-view control, use the LVM_INSERTITEM message, specifying the address of an\r\nLVITEM structure. Before adding multiple items, you can send the control an LVM_SETITEMCOUNT\r\nmessage, specifying the number of items the control will ultimately contain. This message enables the list-view\r\ncontrol to reallocate its internal data structures only once rather than every time you add an item. You can\r\ndetermine the number of items in a list-view control by using the LVM_GETITEMCOUNT message. If you are\r\nadding a large number of items to a list-view control, you can speed up the process by disabling redrawing before\r\nadding the items, then enable redrawing after the items are added. Use the WM_SETREDRAW message to\r\nenable and disable redrawing.\r\nTo change the attributes of a list-view item, use the LVM_SETITEM message, specifying the address of an\r\nLVITEM structure. The mask member of this structure specifies the item attributes you want to change. For\r\nexample, to change only the text of an item or subitem, use the LVM_SETITEMTEXT message.\r\nTo retrieve information about a list-view item, use the LVM_GETITEM message, specifying the address of the\r\nLVITEM structure to fill in. The mask member of this structure specifies the item attributes to be retrieved. To\r\nretrieve only an item or subitem's text, use the LVM_GETITEMTEXT message.\r\nTo delete a list-view item, use the LVM_DELETEITEM message. You can delete all items in a list-view control\r\nby using the LVM_DELETEALLITEMS message.\r\nAn item's state is a value that specifies the item's availability, indicates user actions, or otherwise reflects the\r\nitem's status. A list-view control changes some state bits, such as when the user selects an item. An application\r\nmight change other state bits to disable or hide the item or to specify an overlay image or state image. For more\r\ninformation about overlay images and state images, see List-View Image Lists.\r\nAn item's state is specified by the state member of the LVITEM structure. When you specify or change an item's\r\nstate, the stateMask member specifies which state bits you need to change. You can change an item's state by\r\nusing the LVM_SETITEMSTATE message. You can specify an item's state when you create it or when you\r\nchange its attributes by using the LVM_SETITEM message. To determine an item's current state, use the\r\nLVM_GETITEMSTATE or LVM_GETITEM message.\r\nTo set an item's overlay image, the stateMask member of the LVITEM structure must include the\r\nLVIS_OVERLAYMASK value, and the state member must include the one-based index of the overlay image\r\nshifted left 8 bits by using the INDEXTOOVERLAYMASK macro. The index can be zero to specify no overlay\r\nimage.\r\nTo set an item's state image, the stateMask member of the LVITEM structure must include the\r\nLVIS_STATEIMAGEMASK value, and the state member must include the one-based index of the state image\r\nshifted left 12 bits by using the INDEXTOSTATEIMAGEMASK macro. The index can be zero to specify no\r\nstate image.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 10 of 15\n\nFor each of its items, a list-view control typically stores the label text, the image list index of the item's icons, and\r\na set of bit flags for the item's state. You can define callback items or change the control's callback mask to\r\nindicate that the application, rather than the control, stores some or all of this information. You might want to use\r\ncallbacks if your application stores some of this information.\r\nA callback item in a list-view control is an item for which the application stores the text or icon index, or both.\r\nYou can define callback items when you send the LVM_INSERTITEM message to add an item to the list-view\r\ncontrol. If the application stores the text for the item or subitem, set the pszText member of the item's LVITEM\r\nstructure to LPSTR_TEXTCALLBACK. If the application stores the icon index for an item, set the iImage\r\nmember of the item's LVITEM structure to I_IMAGECALLBACK.\r\nThe callback mask of a list-view control is a set of bit flags that specify the item states for which the application,\r\nrather than the control, stores the current data. The callback mask applies to all of the control's items, unlike the\r\ncallback item designation, which applies to a specific item. The callback mask is zero by default, meaning that the\r\nlist-view control stores all item state information. After creating a list-view control and initializing its items, you\r\ncan send the LVM_SETCALLBACKMASK message to change the callback mask. To retrieve the current\r\ncallback mask, send the LVM_GETCALLBACKMASK message.\r\nWhen a list-view control must display or sort a list-view item for which the application stores callback\r\ninformation, the control sends the LVN_GETDISPINFO notification code to the control's parent window. This\r\nmessage specifies an NMLVDISPINFO structure that contains the type of information required and identifies the\r\nitem or subitem to retrieve. The parent window must process LVN_GETDISPINFO to provide the requested data.\r\nIf the list-view control detects a change in an item's callback information, such as a change in the text, icon, or\r\nstate information, the control sends an LVN_SETDISPINFO notification code to notify you of the change.\r\nIf you change a callback item's attributes or state bits, you use the LVM_UPDATE message to force the control to\r\nrepaint the item. This message also causes the control to arrange its items if it has the LVS_AUTOARRANGE\r\nstyle. You can use the LVM_REDRAWITEMS message to redraw a range of items by invalidating the\r\ncorresponding portions of the list-view control's client area.\r\nBy effectively using callback items and the callback mask, you can ensure that each item attribute is maintained in\r\nonly one place. Doing this can simplify your application, but the only space saved is the memory that would\r\notherwise be required to store item labels and subitem text.\r\nEvery list-view item has a position and size, which you can retrieve and set using messages. You can also\r\ndetermine which item, if any, is at a specified position. The position of list-view items is specified in view\r\ncoordinates, which are client coordinates offset by the scroll position.\r\nTo retrieve and set an item's position, use the LVM_GETITEMPOSITION and LVM_SETITEMPOSITION\r\nmessages. LVM_GETITEMPOSITION works for all views, but LVM_SETITEMPOSITION works only for\r\nicon and small icon views.\r\nYou can determine which item, if any, is at a particular location by using the LVM_HITTEST message.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 11 of 15\n\nTo retrieve the bounding rectangle for a list item or only for its icon or label, use the LVM_GETITEMRECT\r\nmessage.\r\nYou can use list-view messages to arrange and sort items and to find items based on their attributes or positions.\r\nArranging repositions items to align on a grid, but the indexes of the items do not change. Sorting changes the\r\nsequence of items (and their corresponding indexes) and then repositions them accordingly. You can arrange items\r\nonly in icon and small icon views, but you can sort items in any view. To find items, you send list-view messages\r\nthat specify an item location or property.\r\nTo arrange items, use the LVM_ARRANGE message. You can ensure that items are arranged at all times by\r\nspecifying the LVS_AUTOARRANGE window style.\r\nTo sort items, use the LVM_SORTITEMS message. When you sort using this message, you specify an\r\napplication-defined callback function that the list-view control calls to compare the relative order of any two\r\nitems. The control passes to the comparison function the item data associated with each of the two items. The item\r\ndata is the value that was specified in the lParam member of the item's LVITEM structure when it was inserted\r\ninto the list. By specifying the appropriate item data and supplying an appropriate comparison function, you can\r\nsort items by their label, by any subitem, or by any other property. Note that sorting items does not reorder the\r\ncorresponding subitems. When items are reordered, their corresponding subitems are carried with them; that is,\r\nwhole rows are kept together. To order the columns separately from one another, detaching the subitems from their\r\nitems, you must regenerate the columns after sorting using LVM_SETITEM.\r\nYou can ensure that a list-view control is always sorted by specifying the LVS_SORTASCENDING or\r\nLVS_SORTDESCENDING window style. Controls with these styles use the label text of the items to sort them\r\nin ascending or descending order. You cannot supply a comparison function when using these window styles. If a\r\nlist-view control has either of these styles, an LVM_INSERTITEM message will fail if you try to insert an item\r\nthat has LPSTR_TEXTCALLBACK as the pszText member of its LVITEM structure.\r\nYou can find a list-view item with specific properties by using the LVM_FINDITEM message. You can find a\r\nlist-view item that is in a specified state and has a specified relationship to a given item by using the\r\nLVM_GETNEXTITEM message. For example, you can retrieve the next selected item to the right of a specified\r\nitem.\r\nColumns control the way items and their subitems are displayed in report view. Each column has a title and width\r\nand is associated with a specific subitem; subitem zero is the item's icon and label. The attributes of a column are\r\ndefined by an LVCOLUMN structure.\r\nTo add a column to a list-view control, use the LVM_INSERTCOLUMN message. To delete a column, use the\r\nLVM_DELETECOLUMN message.\r\nNote\r\nDeleting column zero of a list-view control is supported only in ComCtl32.dll version 6 and later. Version 5 also\r\nsupports deleting column zero, but only after you use CCM_SETVERSION to set the version to 5 or later.\r\nVersions prior to version 5 do not support deleting column zero.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 12 of 15\n\nYou can retrieve and change the properties of an existing column by using the LVM_GETCOLUMN and\r\nLVM_SETCOLUMN messages. To retrieve or change a column's width, use the LVM_GETCOLUMNWIDTH\r\nand LVM_SETCOLUMNWIDTH messages.\r\nUnless the LVS_NOCOLUMNHEADER window style is specified, column headers appear in report view. The\r\nuser can click a column header, causing an LVN_COLUMNCLICK notification code to be sent to the parent\r\nwindow. Typically, the parent window sorts the list-view control by the specified column when this clicking\r\noccurs. The user can also drag the column guides between the headers to size the columns.\r\nList-view controls can display images next to column titles. To implement this feature, specify the\r\nLVCF_IMAGE value and assign the index of the image to the iImage member in the LVCOLUMN structure.\r\nList-view controls can set the order in which columns are displayed. To implement this feature, specify the\r\nLVCF_ORDER value and assign the column order to the iOrder member in the LVCOLUMN structure. The\r\ncolumn order is zero-based and is in left-to-right order. For example, zero indicates the leftmost column.\r\nUnless the LVS_NOSCROLL window style is specified, a list-view control can be scrolled to show more items\r\nthan can fit in the client area of the control. You can retrieve a list-view control's scroll position and related\r\ninformation, scroll a list-view control by a specified amount, or scroll a list-view control so that a specified list\r\nitem is visible.\r\nIn icon view or small icon view, the current scroll position is defined by the view origin. The view origin is the set\r\nof coordinates, relative to the visible area of the list-view control, that correspond to the view coordinates (0, 0).\r\nTo retrieve the current view origin, use the LVM_GETORIGIN message. This message should be used only in\r\nicon or small icon view; it returns an error in list or report view.\r\nIn list or report view, the current scroll position is defined by the top index. The top index is the index of the first\r\nvisible item in the list-view control. To retrieve the current top index, use the LVM_GETTOPINDEX message.\r\nThis message returns a valid result only in list or report view; it returns zero in icon or small icon view.\r\nYou can use the LVM_GETVIEWRECT message to retrieve the bounding rectangle of all items in a list-view\r\ncontrol, relative to the visible area of the control.\r\nThe LVM_GETCOUNTPERPAGE message returns the number of items that fit in one page of the list-view\r\ncontrol. This message returns a valid result only in list and report views; in icon and small icon views, it returns\r\nthe total number of items.\r\nTo scroll a list-view control by a specific amount, use the LVM_SCROLL message. Using the\r\nLVM_ENSUREVISIBLE message, you can scroll the list-view control, if necessary, to ensure that a specified\r\nitem is visible.\r\nA list-view control that has the LVS_EDITLABELS window style enables a user to edit item labels in place. The\r\nuser begins editing by clicking the label of an item that has the focus. Alternatively, an application can begin\r\nediting automatically by using the LVM_EDITLABEL message. The list-view control notifies the parent window\r\nwhen editing begins and when it is canceled or completed. When editing is completed, the parent window is\r\nresponsible for updating the item's label, if appropriate.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 13 of 15\n\nWhen label editing begins, an edit control is created, positioned, and initialized. Before it is displayed, the list-view control sends its parent window an LVN_BEGINLABELEDIT notification code. If you need to modify the\r\nlabel editing process, you can implement a handler for this notification.\r\nOne use for an LVN_BEGINLABELEDIT notification handler is to control which labels the user can edit. To\r\nprevent label editing, return a nonzero value. To customize label editing, have the notification handler retrieve a\r\nhandle to the edit control by sending an LVM_GETEDITCONTROL message to the list-view control. Once you\r\nhave that handle, you can customize the edit control by sending the usual EM_XXX messages. For instance, to\r\nlimit the amount of text a user can enter, send the edit control an EM_LIMITTEXT message. You can change the\r\nedit control's default text with SetWindowText. You can even subclass the edit control to intercept and discard\r\ninvalid characters.\r\nWhen label editing is canceled or completed, a list-view control sends its parent window an\r\nLVN_ENDLABELEDIT notification code. The lParam parameter is the address of an NMLVDISPINFO\r\nstructure. The item member of this structure is an LVITEM structure whose iItem member identifies the item. If\r\nediting is canceled, the pszText member of the LVITEM structure is NULL; otherwise, pszText is the address of\r\nthe edited text. The parent window is responsible for updating the item's label if it wants to keep the new label.\r\nAn application can retrieve and set three colors for a list-view control.\r\nColor Messages used to retrieve and set colors\r\nText color LVM_GETTEXTCOLOR, LVM_SETTEXTCOLOR\r\nText background color LVM_GETTEXTBKCOLOR, LVM_SETTEXTBKCOLOR\r\nWindow background color LVM_GETBKCOLOR, LVM_SETBKCOLOR\r\nTo customize the appearance of a list-view control more significantly, use NM_CUSTOMDRAW (list view) or\r\nuse visual styles (see Visual Styles and Enabling Visual Styles).\r\nThe grouping features of the list-view control enable you to visually group logically related sets of items. Groups\r\ncan be created based on item properties, attributes, or other characteristics. These groups are typically separated\r\non the screen by a horizontal header that contains the name of the group. The following screen shot shows\r\ngrouped items.\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 14 of 15\n\nYou use the LVGROUP structure to store information about a group, such as the header and footer text, the\r\ncurrent state of the group, and so on. The grouping API includes messages that enable you to manage groups and\r\ngroup elements by adding items to groups, adding groups to views, sorting group items, and querying groups for\r\nitem size and other information. For example, you can set and retrieve display parameters for each group by using\r\nthe ListView_SetGroupMetrics and ListView_GetGroupMetrics macros.\r\nGrouping is available in all views except list view. It is not available on controls that have the\r\nLVS_OWNERDATA style.\r\nFor more information, see Using List-View Controls.\r\nInsertion marks show users where dragged items will be placed. Insertion marks currently display when the user\r\ndrags an item into the Start menu or Quick Launch bar. The insertion mark also works for lists that are set to\r\nautoarrange. When a user drags an item to a point between two other items, the insertion mark shows the item's\r\nexpected new location. The following screen shot shows an insertion mark.\r\nThe insertion mark API elements enable placement of insertion marks by providing messages and flags that\r\nperform hit detection, that specify the location and appearance of the insertion mark by item, and that query for\r\ninformation about the current size and appearance of the insertion mark.\r\nVirtual listview control sample\r\nSource: https://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nhttps://docs.microsoft.com/windows/win32/controls/list-view-controls-overview\r\nPage 15 of 15",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"references": [
		"https://docs.microsoft.com/windows/win32/controls/list-view-controls-overview"
	],
	"report_names": [
		"list-view-controls-overview"
	],
	"threat_actors": [
		{
			"id": "67bf0462-41a3-4da5-b876-187e9ef7c375",
			"created_at": "2022-10-25T16:07:23.44832Z",
			"updated_at": "2026-04-10T02:00:04.607111Z",
			"deleted_at": null,
			"main_name": "Careto",
			"aliases": [
				"Careto",
				"The Mask",
				"Ugly Face"
			],
			"source_name": "ETDA:Careto",
			"tools": [
				"Careto"
			],
			"source_id": "ETDA",
			"reports": null
		},
		{
			"id": "f5bf6853-3f6e-452c-a7b7-8f81c9a27476",
			"created_at": "2023-01-06T13:46:38.677391Z",
			"updated_at": "2026-04-10T02:00:03.064818Z",
			"deleted_at": null,
			"main_name": "Careto",
			"aliases": [
				"The Mask",
				"Ugly Face"
			],
			"source_name": "MISPGALAXY:Careto",
			"tools": [],
			"source_id": "MISPGALAXY",
			"reports": null
		}
	],
	"ts_created_at": 1775439100,
	"ts_updated_at": 1775791879,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/2046b12e2e50299761f7bc142b1fb9f7e1d743e5.pdf",
		"text": "https://archive.orkl.eu/2046b12e2e50299761f7bc142b1fb9f7e1d743e5.txt",
		"img": "https://archive.orkl.eu/2046b12e2e50299761f7bc142b1fb9f7e1d743e5.jpg"
	}
}