LVM_SCROLL
List View Control Reference

LVM_SCROLL


LVM_SCROLL 
    wParam = (int) dx;
    lParam = (int) dy;

Scrolls the content of a list view control. You can send this message explicitly or by using the ListView_Scroll macro.

dx
Integer value that specifies the amount of horizontal scrolling in pixels. If the list view control is in list view, this value specifies the number of columns to scroll.
dy
Integer value that specifies the amount of vertical scrolling in pixels.

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).

LVM_SETBKCOLOR

LVM_SETBKCOLOR 
    wParam = 0; 
    lParam = (LPARAM) (COLORREF) clrBk; 

Sets the background color of a list view control. You can send this message explicitly or by using the ListView_SetBkColor macro.

clrBk
Background color to set or the CLR_NONE value for no background color. List view controls with background colors redraw themselves significantly faster than those without background colors.

LVM_SETBKIMAGE

LVM_SETBKIMAGE
    wParam = 0;
    lParam = (LPARAM)(LPLVBKIMAGE) plvbki;

Sets the background image in a list view control. You can send this message explicitly or by using the ListView_SetBkImage macro.

plvbki
Address of a LVBKIMAGE structure that contains the new background image information.

Because the list view control uses OLE COM to manipulate the background images, the calling application must call CoInitialize or OleInitialize before sending this message. 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 LVM_GETBKIMAGE

LVM_SETCALLBACKMASK

LVM_SETCALLBACKMASK 
    wParam = (WPARAM) (UINT) mask; 
    lParam = 0; 

Changes the callback mask for a list view control. You can send this message explicitly or by using the ListView_SetCallbackMask macro.

mask
Specifies the value of the callback mask. The bits of the mask indicate the item states or images for which the application stores the current state data. This value can be any combination of the following constants:
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 send the 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

LVM_SETCOLUMN

LVM_SETCOLUMN 
    wParam = (WPARAM) (int) iCol; 
    lParam = (LPARAM) (const LPLVCOLUMN) pcol; 

Sets the attributes of a list view column. You can send this message explicitly or by using the ListView_SetColumn macro.

iCol
Index of the column.
pcol
Address of an LVCOLUMN structure that contains the new column attributes. The mask member specifies which column attributes to set.
If the mask member specifies the LVCF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.

LVM_SETCOLUMNORDERARRAY

LVM_SETCOLUMNORDERARRAY
    wParam = (WPARAM) (int) iCount;
    lParam = (LPARAM) (LPINT) lpiArray;

Sets the left-to-right order of columns in a list view control. You can send this message explicitly or use the ListView_SetColumnOrderArray macro.

iCount
Size, in elements, of the buffer at lpiArray.
lpiArray
Address of an array that specifies the order in which columns should be displayed, from left to right. For example, if the contents of the array are {2,0,1}, the control displays column 2, column 0, and column 1 in that order.

Version 4.70

LVM_SETCOLUMNWIDTH

LVM_SETCOLUMNWIDTH 
    wParam = (WPARAM) (int) iCol; 
    lParam = MAKELPARAM((int) cx, 0); 

Changes the width of a column in report or list view. You can send this message explicitly or by using the ListView_SetColumnWidth macro.

iCol
Index of the column. In list view, the iCol parameter must be -1.
cx
New width of the column, in list view coordinates, or one of the following values:
LVSCW_AUTOSIZE Automatically sizes the column.
LVSCW_AUTOSIZE_USEHEADER Automatically sizes the column to fit the header text.

LVM_SETEXTENDEDLISTVIEWSTYLE

LVM_SETEXTENDEDLISTVIEWSTYLE
    wParam = (WPARAM)dwExMask;
    lParam = (LPARAM)dwExStyle;

Sets extended styles in list view controls. You can send this message explicitly or use the ListView_SetExtendedListViewStyle or ListView_SetExtendedListViewStyleEx macros.

dwExMask
A DWORD value that indicates which styles in dwExStyle are to be affected. This parameter can be a combination of extended styles. Only the extended styles in dwExMask will be changed. All other styles will be maintained as they are. If this parameter is zero, then all of the styles in dwExStyle will be affected.
dwExStyle
Value specifying the extended list view control style. This parameter can be a combination of extended styles.

dwExMask allows you to modify one or more extended styles without having to retrieve the existing styles first. For example, if you pass LVS_EX_FULLROWSELECT for dwExMask and 0 for dwExStyle, the LVS_EX_FULLROWSELECT style will be cleared, but all other styles will remain the same.

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

LVM_SETHOTCURSOR

LVM_SETHOTCURSOR
    wParam = 0;
    lParam = (LPARAM)(HCURSOR) hCursor;

Sets 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.

hCursor
Handle to the cursor to be set.

A list view control uses hot tracking and hover selection when the LVS_EX_TRACKSELECT style is set.

Version 4.70

LVM_SETHOTITEM

LVM_SETHOTITEM
    wParam = (WPARAM)(INT) iIndex;
    lParam = 0;

Sets the hot item for a list view control. You can send this message explicitly or use the ListView_SetHotItem macro.

iIndex
Zero-based index of the item to be set as the hot item.

Version 4.70

LVM_SETHOVERTIME

LVM_SETHOVERTIME
    wParam = 0;
    lParam = (LPARAM)(DWORD)dwHoverTime;

Sets 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.

dwHoverTime
The new amount of time, in milliseconds, that the mouse cursor must hover over an item before it is selected. If this value is (DWORD)-1, then the hover time is set to the default hover time.

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

LVM_SETICONSPACING

LVM_SETICONSPACING
    wParam = 0;
    lParam = (LPARAM) MAKELONG(cx, cy);

Sets 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.

cx
Distance, in pixels, to set between icons on the x-axis. Setting this value to -1 resets the cx parameter to default spacing.
cy
Distance, in pixels, to set between icons on the y-axis. Setting this value to -1 resets the cy parameter to default spacing.

Values for cx and cy 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

LVM_SETIMAGELIST

LVM_SETIMAGELIST 
    wParam = (WPARAM) (int) iImageList; 
    lParam = (LPARAM) (HIMAGELIST) himl; 

Assigns an image list to a list view control. You can send this message explicitly or by using the ListView_SetImageList macro.

iImageList
Type of image list. This parameter can be one of the following values:
LVSIL_NORMAL Image list with large icons.
LVSIL_SMALL Image list with small icons.
LVSIL_STATE Image list with state images.
himl
Handle to the image list to assign.

LVM_SETITEM

LVM_SETITEM 
    wParam = 0; 
    lParam = (LPARAM) (const LPLVITEM) pitem; 

Sets 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.

pitem
Address of an LVITEM structure that contains the new item attributes. The iItem and iSubItem members identify the item or subitem, and the mask member specifies which attributes to set.
If the mask member specifies the LVIF_TEXT value, the pszText member is the address of a null-terminated string and the cchTextMax member is ignored.
If the mask member specifies the LVIF_STATE value, the stateMask member specifies which item states to change and the state member contains the values for those states.

To set the attributes of a list view item, set the iItem member of the LVITEM structure to the index of the item, and set the iSubItem member to zero. For an item, you can set the state, pszText, iImage, and lParam members of the LVITEM structure.

To set the text of a subitem, set the iItem and iSubItem members to indicate the specific subitem, and use the pszText member to specify the text. Alternatively, you can use the ListView_SetItemText macro to set the text of a subitem. You cannot set the state, iImage, or lParam members for subitems because subitems do not have these attributes.

LVM_SETITEMCOUNT

LVM_SETITEMCOUNT 
    wParam = (WPARAM) (int) cItems; 
    lParam = (LPARAM) dwFlags;

Causes 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.

cItems
Number of items that the list view control will ultimately contain.
dwFlags
Version 4.70. Values that specify the behavior of the list view control after resetting the item count. This value can be a combination of the following:
LVSICF_NOINVALIDATEALL The list view control will not repaint unless affected items are currently in view.
LVSICF_NOSCROLL The list view control will not change the scroll position when the item count changes.

If the list view control was created without the LVS_OWNERDATA style, sending this message causes the control to allocate its internal data structures for the specified number of items. This prevents the control from having to allocate the data structures every time an item is added.

If the list view control was created with the LVS_OWNERDATA style (a virtual list view), sending this message sets the virtual number of items that the control contains.

The dwFlags parameter is intended only for list view controls that use the LVS_OWNERDATA and LVS_REPORT or LVS_LIST styles.

LVM_SETITEMPOSITION

LVM_SETITEMPOSITION 
    wParam = (LPARAM) (int) i; 
    lParam = MAKELPARAM((int) x, (int) y); 

Moves 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.

i
Index of the list view item.
x and y
New position of the item's upper-left corner, in view coordinates.

If the list view control has the LVS_AUTOARRANGE style, the items in the list view control are arranged after the position of the item is set.

LVM_SETITEMPOSITION32

LVM_SETITEMPOSITION32 
    wParam = (WPARAM) (int) iItem; 
    lParam = (LPARAM) (LPPOINT) lpptNewPos; 

Moves 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.

iItem
Index of the list view item for which to set the position.
lpptNewPos
Address of a POINT structure that contains the new position of the item, in list view coordinates.

LVM_SETITEMSTATE

LVM_SETITEMSTATE 
    wParam = (WPARAM) (int) i; 
    lParam = (LPARAM) (LPLVITEM) pitem; 

Changes the state of an item in a list view control. You can send this message explicitly or by using the ListView_SetItemState macro.

i
Index of the list view item.
pitem
Address of an LVITEM structure. The stateMask member specifies which state bits to change, and the state member contains the new values for those bits. The other members are ignored.

An item's state value includes a set of bit flags that indicate the item's state. The state value can also include image list indexes that indicate the item's state image and overlay image.

LVM_SETITEMTEXT

LVM_SETITEMTEXT 
    wParam = (WPARAM) (int) i; 
    lParam = (LPARAM) (LPLVITEM) pitem; 

Changes the text of a list view item or subitem. You can send this message explicitly or by using the ListView_SetItemText macro.

i
Index of the list view item.
pitem
Address of an LVITEM structure. The iSubItem member is the index of the subitem, or it can be zero to set the item label. The pszText member is the address of a null-terminated string containing the new text; it can also be NULL.

The pszText member can also be LPSTR_TEXTCALLBACK to indicate a callback item for which the parent window stores the text. In this case, the list view control sends the parent an LVN_GETDISPINFO notification message when it needs the text.

LVM_SETSELECTIONMARK

LVM_SETSELECTIONMARK
    wParam = 0;
    lParam = (LPARAM)(INT) iIndex;

Sets the selection mark in a list view control. You can send this message explicitly or use the ListView_SetSelectionMark macro.

iIndex
Zero-based index of the new selection mark.

The selection mark is the item index from which a multiple selection starts. This message does not affect the selection state of the item.

Version 4.71

See also LVM_GETSELECTIONMARK

LVM_SETTEXTBKCOLOR

LVM_SETTEXTBKCOLOR 
    wParam = 0; 
    lParam = (LPARAM) (COLORREF) clrText; 

Sets the background color of text in a list view control. You can send this message explicitly or by using the ListView_SetTextBkColor macro.

clrText
New text color.

LVM_SETTEXTCOLOR

LVM_SETTEXTCOLOR 
    wParam = 0; 
    lParam = (LPARAM) (COLORREF) clrText; 

Sets the text color of a list view control. You can send this message explicitly or by use the ListView_SetTextColor macro.

clrText
New text color.

LVM_SETTOOLTIPS

LVM_SETTOOLTIPS
    wParam = 0;
    lParam = (LPARAM)(HWND)hwndToolTip;

Sets 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.

hwndToolTip
Handle to the tooltip control to be set.

See also LVM_GETTOOLTIPS

LVM_SETUNICODEFORMAT

LVM_SETUNICODEFORMAT
    wParam = (WPARAM)(BOOL)fUnicode;
    lParam = 0;

Sets 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.

fUnicode
Determines the character set that is used by the control. If this value is nonzero, the control will use UNICODE characters. If this value is zero, the control will use ANSI characters.

See also LVM_GETUNICODEFORMAT

LVM_SETWORKAREAS

LVM_SETWORKAREAS
    wParam = (WPARAM)(INT) nWorkAreas;
    lParam = (LPARAM)(LPRECT) lprc;

Sets the working areas within a list view control. You can send this message explicitly or use the ListView_SetWorkAreas macro.

nWorkAreas
The number of structures in the array at lprc. The maximum number of working areas allowed is defined by the LV_MAX_WORKAREAS value.
lprc
Address of an array of RECT structures that contain the new working areas of the list view control. Values in these structures are in client coordinates. If this parameter is NULL, the working area will be set to the client area of the control. nWorkAreas specifies the number of structures in this array.

Version 4.71

LVM_SORTITEMS

LVM_SORTITEMS 
    wParam = (WPARAM) (LPARAM) lParamSort; 
    lParam = (LPARAM) (PFNLVCOMPARE) pfnCompare; 

Uses 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.

lParamSort
Application-defined value that is passed to the comparison function.
pfnCompare
Address of the application-defined comparison function. The comparison function is called during the sort operation each time the relative order of two list items needs to be compared.

The comparison function has the following form:

int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, 
	LPARAM lParamSort);  

The lParam1 parameter is the 32-bit value associated with the first item being compared, and the lParam2 parameter is the value associated with the second item. These are the values that were specified in the lParam member of the items' LVITEM structure when they were inserted into the list. The lParamSort parameter is the same value passed to the LVM_SORTITEMS message.

The comparison function must return a negative value if the first item should precede the second, a positive value if the first item should follow the second, or zero if the two items are equivalent.

LVM_SUBITEMHITTEST

LVM_SUBITEMHITTEST
    wParam = 0;
    lParam = (LPARAM)(LVHITTESTINFO FAR *)pInfo;

Determines which list view item or subitem is at a given position. You can send this message explicitly or by using the ListView_SubItemHitTest macro.

pInfo
Address of an LVHITTESTINFO structure. The POINT structure within LVHITTESTINFO should be set to the client coordinates to be hit-tested.

Version 4.70

LVM_UPDATE

LVM_UPDATE 
    wParam = (WPARAM) iItem; 
    lParam = 0; 

Updates 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.

iItem
Index of the item to update.

List View Control Macros

This section contains information about the macros used with list view control messages.

ListView_ApproximateViewRect

DWORD ListView_ApproximateViewRect(
    hwndLV,
    cx,
    cy,
    iCount
);

Calculates 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.

hwndLV
Handle to the list view control.
cx and cy
The proposed dimensions of the control, in pixels. Either parameter can be -1 to allow the message to use the current width or height value.
iCount
Number of items to be displayed in the control. If this parameter is -1, the message uses the total number of items in the control.

Version 4.70

ListView_Arrange

BOOL ListView_Arrange(
    HWND hwnd, 		
    UINT code		
);		

Arranges items in icon view. You can use this macro or send the LVM_ARRANGE message explicitly.

hwnd
Handle to the list view control.
code
Specifies the alignment, which can be one of the following values:
LVA_ALIGNLEFT Aligns items along the left edge of the window.
LVA_ALIGNTOP Aligns items along the top edge of the window.
LVA_DEFAULT Aligns items according to the list view control's current alignment styles (the default value).
LVA_SNAPTOGRID Snaps all icons to the nearest grid position.

ListView_CreateDragImage

HIMAGELIST ListView_CreateDragImage(
    HWND hwnd, 		
    int iItem, 		
    LPPOINT lpptUpLeft		
);		

Creates a drag image list for the specified item. You can use this macro or send the LVM_CREATEDRAGIMAGE message explicitly.

hwnd
Handle to the list view control.
iItem
Index of the item.
lpptUpLeft
Address of a POINT structure that receives the initial location of the upper-left corner of the image, in view coordinates.

ListView_DeleteAllItems

BOOL ListView_DeleteAllItems(
    HWND hwnd		
);		

Removes all items from a list view control. You can use this macro or send the LVM_DELETEALLITEMS message explicitly.

hwnd
Handle to the list view control.

When a list view control receives the LVM_DELETEALLITEMS message, it sends the LVN_DELETEALLITEMS notification message to its parent window.

ListView_DeleteColumn

BOOL ListView_DeleteColumn(
    HWND hwnd, 		
    int iCol		
);		

Removes a column from a list view control. You can use this macro or send the LVM_DELETECOLUMN message explicitly.

hwnd
Handle to the list view control.
iCol
Index of the column to delete.

ListView_DeleteItem

BOOL ListView_DeleteItem(
    HWND hwnd, 		
    int iItem		
);		

Removes an item from a list view control. You can use this macro or send the LVM_DELETEITEM message explicitly.

hwnd
Handle to the list view control.
iItem
Index of the list view item to delete.

ListView_EditLabel

HWND ListView_EditLabel(
    HWND hwnd, 		
    int iItem		
);		

Begins 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.

hwnd
Handle to the list view control.
iItem
Index of the list view item. To cancel editing, set iItem to -1.

When the user completes or cancels editing, the edit control is destroyed and the handle is no longer valid. You can safely subclass the edit control, but you should not destroy it.

The control must have the focus before you send this message to the control. Focus can be set using the SetFocus function.

See also WM_CANCELMODE

ListView_EnsureVisible

BOOL ListView_EnsureVisible(
    HWND hwnd, 		
    int i, 		
    BOOL fPartialOK		
);		

Ensures 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.

hwnd
Handle to the list view control.
i
Index of the list view item.
fPartialOK
Value specifying whether the item must be entirely visible. If this parameter is TRUE, no scrolling occurs if the item is at least partially visible.

ListView_FindItem

int ListView_FindItem(
    HWND hwnd, 		
    int iStart, 		
    const LPLVFINDINFO plvfi		
);		

Searches for a list view item with the specified characteristics. You can use this macro or send the LVM_FINDITEM message explicitly.

hwnd
Handle to the list view control.
iStart
Index of the item after which to begin the search, or -1 to start from the beginning.
plvfi
Address of an LVFINDINFO structure that contains information about what to search for.

ListView_GetBkColor

COLORREF ListView_GetBkColor(
    HWND hwnd		
);		

Retrieves the background color of a list view control. You can use this macro or send the LVM_GETBKCOLOR message explicitly.

hwnd
Handle to the list view control.

ListView_GetBkImage

BOOL ListView_GetBkImage(
    HWND hwndLV,
    LPLVBKIMAGE plvbki
);

Retrieves the background image in a list view control. You can use this macro or send the LVM_GETBKIMAGE message explicitly.

hwndLV
Handle to the list view control.
plvbki
Address of a LVBKIMAGE structure that will receive the background image information.

Version 4.71

See also ListView_SetBkImage

ListView_GetCallbackMask

UINT ListView_GetCallbackMask(
    HWND hwnd		
);		

Retrieves the callback mask for a list view control. You can use this macro or send the LVM_GETCALLBACKMASK message explicitly.

hwnd
Handle to the list view control.

See also LVM_SETCALLBACKMASK

ListView_GetCheckState

BOOL ListView_GetCheckState(
    HWND hwndLV,
    UINT iIndex
);

Determines 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.

hwndLV
Handle to a list view control.
iIndex
Index of the item for which to retrieve the check state.

Version 4.70

ListView_GetColumn

BOOL ListView_GetColumn(
    HWND hwnd, 		
    int iCol, 		
    LPLVCOLUMN pcol		
);		

Retrieves the attributes of a list view control's column. You can use this macro or send the LVM_GETCOLUMN message explicitly.

hwnd
Handle to the list view control.
iCol
Index of the column.
pcol
Address of an LVCOLUMN structure that specifies the information to retrieve and receives information about the column. The mask member specifies which column attributes to retrieve.
If the mask member specifies the LVCF_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.

ListView_GetColumnOrderArray

BOOL ListView_GetColumnOrderArray(
    HWND hwndLV,
    int iCount,
    int *lpiArray
);

Retrieves 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.

hwndLV
Handle to a list view control.
iCount
Number of columns in the list view control.
lpiArray
Address of an array of integers that will receive the index values of the columns in the list view control. The array must be large enough to hold iCount elements.

Version 4.70

ListView_GetColumnWidth

int ListView_GetColumnWidth(
    HWND hwnd, 		
    int iCol		
);		

Retrieves the width of a column in report or list view. You can use this macro or send the LVM_GETCOLUMNWIDTH message explicitly.

hwnd
Handle to the list view control.
iCol
Index of the column. This parameter is ignored in list view.

ListView_GetCountPerPage

int ListView_GetCountPerPage(
    HWND hwnd		
);		

Calculates 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.

hwnd
Handle to the list view control.

ListView_GetEditControl

HWND ListView_GetEditControl(
    HWND hwnd		
);		

Retrieves 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.

hwnd
Handle to the list view control.

If no label is being edited, the return value is NULL. The edit control is not created until after the LVN_BEGINLABELEDIT notification message is sent.

When the user completes or cancels editing, the edit control is destroyed and the handle is no longer valid. You can safely subclass the edit control, but you should not destroy it. To cancel editing, you can send the list view control a WM_CANCELMODE message.

The list view item being edited is the currently focused item—that is, the item in the focused state. To find an item based on its state, use the LVM_GETNEXTITEM message.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.