
DWORD ListView_GetExtendedListViewStyle(
HWND hwndLV
);
Retrieves 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.
Version 4.70
HWND ListView_GetHeader(
HWND hwndLV
);
Retrieves the handle to the header control used by a list view control. You can use this macro or send the LVM_GETHEADER message explicitly.
Version 4.70
HCURSOR ListView_GetHotCursor(
HWND hwndLV
);
Retrieves 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.
A list view control uses hot tracking and hover selection when the LVS_EX_TRACKSELECT style is set.
Version 4.70
INT ListView_GetHotItem(
HWND hwndLV
);
Retrieves the index of the hot item. You can use this macro or send the LVM_GETHOTITEM message explicitly.
Version 4.70
DWORD ListView_GetHoverTime( HWND hwndLV );
Retrieves 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.
The hover time only affects list view controls that have the LVS_EX_TRACKSELECT, LVS_EX_ONECLICKACTIVATE, or LVS_EX_TWOCLICKACTIVATE extended list view style.
Version 4.71
HIMAGELIST ListView_GetImageList(
HWND hwnd,
int iImageList
);
Retrieves the handle to an image list used for drawing list view items. You can use this macro or send the LVM_GETIMAGELIST message explicitly.
| LVSIL_NORMAL | Image list with large icons. |
| LVSIL_SMALL | Image list with small icons. |
| LVSIL_STATE | Image list with state images. |
BOOL ListView_GetISearchString(
HWND hwnd,
LPSTR lpsz
);
Retrieves the incremental search string of a list view control. You can use this macro or send the LVM_GETISEARCHSTRING message explicitly.
The incremental search string is the character sequence that the user types while the list view has the input focus. Each time the user types a character, the system appends the character to the search string and then searches for a matching item. If the system finds a match, it selects the item and, if necessary, scrolls it into view.
A time-out period is associated with each character that the user types. If the time-out period elapses before the user types another character, the incremental search string is reset.
BOOL ListView_GetItem(
HWND hwnd,
LPLVITEM pitem
);
Retrieves some or all of a list view item's attributes. You can use this macro or send the LVM_GETITEM message explicitly.
When the LVM_GETITEM message is sent, the iItem and iSubItem members identify the item or subitem to retrieve information about and the mask member specifies which attributes to retrieve. For a list of possible values, see the description of the LVITEM structure.
If the mask member specifies the LVIF_TEXT value, the pszText member must contain the address of the buffer that receives the item text, and the cchTextMax member must specify the size of the buffer.
If the mask member specifies the LVIF_STATE value, the stateMask member must specify the item state bits to retrieve. On output, the state member contains the values of the specified state bits.
int ListView_GetItemCount(
HWND hwnd
);
Retrieves the number of items in a list view control. You can use this macro or send the LVM_GETITEMCOUNT message explicitly.
BOOL ListView_GetItemPosition(
HWND hwnd,
int i,
POINT FAR *ppt
);
Retrieves the position of a list view item. You can use this macro or explicitly send the LVM_GETITEMPOSITION message.
BOOL ListView_GetItemRect(
HWND hwnd,
int i,
RECT FAR *prc,
int code
);
Retrieves 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.
| LVIR_BOUNDS | Returns the bounding rectangle of the entire item, including the icon and label. |
| LVIR_ICON | Returns the bounding rectangle of the icon or small icon. |
| LVIR_LABEL | Returns the bounding rectangle of the item text. |
| LVIR_SELECTBOUNDS | Returns the union of the LVIR_ICON and LVIR_LABEL rectangles, but excludes columns in details view. |
DWORD ListView_GetItemSpacing(
HWND hwnd,
BOOL fSmall
);
Determines the spacing between items in a list view control. You can use this macro or send the LVM_GETITEMSPACING message explicitly.
UINT WINAPI ListView_GetItemState(
HWND hwnd,
int i,
UINT mask
);
Retrieves the state of a list view item. You can use this macro or send the LVM_GETITEMSTATE message explicitly.
| LVIS_CUT | The item is marked for a cut-and-paste operation. |
| LVIS_DROPHILITED | The item is highlighted as a drag-and-drop target. |
| LVIS_FOCUSED | The item has the focus, so it is surrounded by a standard focus rectangle. Although more than one item may be selected, only one item can have the focus. |
| LVIS_SELECTED | The item is selected. The appearance of a selected item depends on whether it has the focus and also on the system colors used for selection. |
| LVIS_OVERLAYMASK | Use this mask to retrieve the item's overlay image index. |
| LVIS_STATEIMAGEMASK | Use this mask to retrieve the item's state image index. |
An item's state information includes a set of bit flags as well as image list indexes that indicate the item's state image and overlay image.
See also ListView_SetItemState
void WINAPI ListView_GetItemText(
HWND hwnd,
int iItem,
int iSubItem,
LPSTR pszText,
int cchTextMax
);
Retrieves the text of a list view item or subitem. You can use this macro or send the LVM_GETITEMTEXT message explicitly.
See also LVITEM
int ListView_GetNextItem(
HWND hwnd,
int iStart,
UINT flags
);
Searches 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.
BOOL ListView_GetNumberOfWorkAreas(
HWND hwndLV,
LPUINT lpuWorkAreas
);
Retrieves the number of working areas in a list view control. You can use this macro or send the LVM_GETNUMBEROFWORKAREAS message explicitly.
Version 4.71
BOOL ListView_GetOrigin(
HWND hwnd,
LPPOINT lpptOrg
);
Retrieves the current view origin for a list view control. You can use this macro or send the LVM_GETORIGIN message explicitly.
UINT ListView_GetSelectedCount(
HWND hwnd
);
Determines the number of selected items in a list view control. You can use this macro or send the LVM_GETSELECTEDCOUNT message explicitly.
INT ListView_GetSelectionMark(
HWND hwndLV
);
Retrieves the selection mark from a list view control. You can use this macro or explicitly send the LVM_GETSELECTIONMARK message.
The selection mark is the item index from which a multiple selection starts.
Version 4.71
See also ListView_SetSelectionMark
int ListView_GetStringWidth(
HWND hwnd,
LPCSTR psz
);
Determines 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.
The ListView_GetStringWidth macro returns the exact width, in pixels, of the specified string. If you use the returned string width as the column width in a call to the ListView_SetColumnWidth macro, the string will be truncated. To get the column width that can contain the string without truncating it, you must add padding to the returned string width.
BOOL ListView_GetSubItemRect(
HWND hwndLV,
int iItem,
int iSubItem,
int code,
LPRECT lpRect
);
Retrieves 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.
| LVIR_BOUNDS | Returns the bounding rectangle of the entire item, including the icon and label. |
| LVIR_ICON | Returns the bounding rectangle of the icon or small icon. |
| LVIR_LABEL | Returns the bounding rectangle of the entire item, including the icon and label. This is identical to LVIR_BOUNDS. |
Version 4.70
COLORREF ListView_GetTextBkColor(
HWND hwnd
);
Retrieves the text background color of a list view control. You can use this macro or send the LVM_GETTEXTBKCOLOR message explicitly.
COLORREF ListView_GetTextColor(
HWND hwnd
);
Retrieves the text color of a list view control. You can use this macro or send the LVM_GETTEXTCOLOR message explicitly.
HWND ListView_GetToolTips(
HWND hwnd
);
Retrieves the tooltip control that the list view control uses to display tooltips. You can use this macro or send the LVM_GETTOOLTIPS message explicitly.
See also ListView_SetToolTips
int ListView_GetTopIndex(
HWND hwnd
);
Retrieves 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.
BOOL ListView_GetUnicodeFormat(
HWND hwnd
);
Retrieves the UNICODE character format flag for the control. You can use this macro or send the LVM_GETUNICODEFORMAT message explicitly.
See also ListView_SetUnicodeFormat
BOOL ListView_GetViewRect(
HWND hwnd,
RECT FAR *prc
);
Retrieves 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.
void ListView_GetWorkAreas(
HWND hwndLV,
INT nWorkAreas,
LPRECT lprc
);
Retrieves the working areas from a list view control. You can use this macro, or send the LVM_GETWORKAREAS message explicitly.
Version 4.71
int ListView_HitTest(
HWND hwnd,
LPLVHITTESTINFO pinfo
);
Determines which list view item, if any, is at a specified position. You can use this macro or send the LVM_HITTEST message explicitly.
int ListView_InsertColumn(
HWND hwnd,
int iCol,
const LPLVCOLUMN pcol
);
Inserts a new column in a list view control. You can use this macro or send the LVM_INSERTCOLUMN message explicitly.
int ListView_InsertItem(
HWND hwnd,
const LPLVITEM pitem
);
Inserts a new item in a list view control. You can use this macro or send the LVM_INSERTITEM message explicitly.
If a list view control has either the LVS_SORTASCENDING or LVS_SORTDESCENDING window style, an LVM_INSERTITEM message will fail if you try to insert an item that has LPSTR_TEXTCALLBACK as the pszText member of its LVITEM structure.
BOOL ListView_RedrawItems(
HWND hwnd,
int iFirst,
int iLast
);
Forces a list view control to redraw a range of items. You can use this macro or send the LVM_REDRAWITEMS message explicitly.
The specified items are not actually redrawn until the list view window receives a WM_PAINT message to repaint. To repaint immediately, call the UpdateWindow function after using this macro.
BOOL ListView_Scroll(
HWND hwnd,
int dx,
int dy
);
Scrolls the content of a list view control. You can use this macro or send the LVM_SCROLL message explicitly.
When the list view control is in report view, the control can only be scrolled vertically in whole line increments. Therefore, the dy parameter will be rounded to the nearest number of pixels that form a whole line increment. For example, if the height of a line is 16 pixels and 8 is passed for dy, the list will be scrolled by 16 pixels (1 line). If 7 is passed for dy, the list will be scrolled 0 pixels (0 lines).
BOOL ListView_SetBkColor(
HWND hwnd,
COLORREF clrBk
);
Sets the background color of a list view control. You can use this macro or send the LVM_SETBKCOLOR message explicitly.
BOOL ListView_SetBkImage(
HWND hwndLV,
LPLVBKIMAGE plvbki;
);
Sets the background image in a list view control. You can use this macro or send the LVM_SETBKIMAGE message explicitly.
Because the list view control uses OLE COM to manipulate the background images, the calling application must call CoInitialize or OleInitialize before using this macro. It is best to call one of these functions when the application is initialized, and call either CoUnitialize or OleUnitialize when the application is terminating.
Version 4.71
See also ListView_GetBkImage
BOOL ListView_SetCallbackMask(
WND hwnd,
UINT mask
);
Changes the callback mask for a list view control. You can use this macro or send the LVM_SETCALLBACKMASK message explicitly.
| LVIS_CUT | The item is marked for a cut-and-paste operation. |
| LVIS_DROPHILITED | The item is highlighted as a drag-and-drop target. |
| LVIS_FOCUSED | The item has the focus. |
| LVIS_SELECTED | The item is selected. |
| LVIS_OVERLAYMASK | The application stores the image list index of the current overlay image for each item. |
| LVIS_STATEIMAGEMASK | The application stores the image list index of the current state image for each item. |
The callback mask of a list view control is a set of bit flags that specify the item states for which the application, rather than the control, stores the current data. The callback mask applies to all of the control's items, unlike the callback item designation, which applies to a specific item. The callback mask is zero by default, meaning that the list view control stores all item state information. After creating a list view control and initializing its items, you can use the ListView_SetCallbackMask macro or LVM_SETCALLBACKMASK message to change the callback mask. To get the current callback mask, send the LVM_GETCALLBACKMASK message.
For more information about overlay images and state images, see List View Image Lists.
For more information on list view callbacks, see Callback Items and the Callback Mask
See also LVN_GETDISPINFO
BOOL ListView_SetColumn(
HWND hwnd,
int iCol,
LPLVCOLUMN pcol
);
Sets the attributes of a list view column. You can use this macro or send the LVM_SETCOLUMN message explicitly.
BOOL ListView_SetColumnOrderArray(
HWND hwndLV,
int iCount,
int *lpiArray
);
Sets the left-to-right order of columns in a list view control. You can use this macro or send the LVM_SETCOLUMNORDERARRAY message explicitly.
Version 4.70
BOOL ListView_SetColumnWidth(
HWND hwnd,
int iCol,
int cx
);
Changes the width of a column in report or list view. You can use this macro or send the LVM_SETCOLUMNWIDTH message explicitly.
| LVSCW_AUTOSIZE | Automatically sizes the column. |
| LVSCW_AUTOSIZE_USEHEADER | Automatically sizes the column to fit the header text. |
Note that ListView_SetColumnWidth converts the cx parameter to a 16-bit value.
void ListView_SetExtendedListViewStyle(
HWND hwndLV,
DWORD dwExStyle
);
Sets extended styles for list view controls. You can use this macro or send the LVM_SETEXTENDEDLISTVIEWSTYLE message explicitly.
For backward compatibility reasons, the ListView_SetExtendedListViewStyle macro has not been updated to use dwExMask. To use the dwExMask value, use the ListView_SetExtendedListViewStyleEx macro.
Version 4.70
void ListView_SetExtendedListViewStyleEx(
HWND hwndLV,
DWORD dwExMask,
DWORD dwExStyle
);
Sets extended styles for list view controls using the style mask. You can use this macro or send the LVM_SETEXTENDEDLISTVIEWSTYLE message explicitly.
Version 4.71
HCURSOR ListView_SetHotCursor(
HWND hwndLV,
HCURSOR hCursor
);
Sets 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.
A list view control uses hot tracking and hover selection when the LVS_EX_TRACKSELECT style is set.
Version 4.70
INT ListView_SetHotItem(
HWND hwndLV,
INT iIndex
);
Sets the hot item in a list view control. You can use this macro or send the LVM_SETHOTITEM message explicitly.
Version 4.70
ListView_SetHoverTime(
HWND hwndLV,
DWORD dwHoverTime
);
Sets 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.
The hover time only affects list view controls that have the LVS_EX_TRACKSELECT, LVS_EX_ONECLICKACTIVATE, or LVS_EX_TWOCLICKACTIVATE extended list view style.
Version 4.71
DWORD ListView_SetIconSpacing(
HWND hwndLV,
int cx,
int cy
);
Sets 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.
The cx and cy parameters are relative to the upper-left corner of an icon bitmap. Therefore, to set spacing between icons that do not overlap, the cx or cy values must include the size of the icon, plus the amount of empty space desired between icons. Values that do not include the width of the icon will result in overlaps.
Version 4.70
HIMAGELIST ListView_SetImageList(
HWND hwnd,
HIMAGELIST himl,
int iImageList
);
Assigns an image list to a list view control. You can use this macro or send the LVM_SETIMAGELIST message explicitly.
| LVSIL_NORMAL | Image list with large icons. |
| LVSIL_SMALL | Image list with small icons. |
| LVSIL_STATE | Image list with state images. |
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.