NM_RDBLCLK (list view)
List View Control Reference

NM_RDBLCLK (list view)


NM_RDBLCLK
    lpnmlv = (LPNMLISTVIEW) lParam;

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.

lpnmlv
Version 4.71. Address of an NMLISTVIEW structure that contains additional information about this notification message. The iItem, iSubItem, and ptAction members of this structure contain information about the item.

This notification is identical to the standard NM_RDBLCLK notification except that, in version 4.71 and later, the list view supplies an NMLISTVIEW structure instead of an NMHDR structure for the lParam.

NM_RELEASEDCAPTURE (list view)

NM_RELEASEDCAPTURE
    lpnmh = (LPNMHDR) lParam; 

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.

lpnmh
Address of an NMHDR structure that contains additional information about this notification message.

Version 4.71.

NM_RETURN (list view)

NM_RETURN 
    lpnmh = (LPNMHDR) lParam; 

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.

lpnmh
Address of an NMHDR structure that contains additional information about this notification message.

NM_SETFOCUS (list view)

NM_SETFOCUS 
    lpnmh = (LPNMHDR) lParam; 

Notifies a list view control's parent window that the control has received the input focus. NM_SETFOCUS is sent in the form of a WM_NOTIFY message.

lpnmh
Address of an NMHDR structure that contains additional information about this notification message.

List View Control Structures

This section contains information about the structures used with list view controls.

LVBKIMAGE

typedef struct tagLVBKIMAGE
{
    ULONG ulFlags;
    HBITMAP hbm;
    LPTSTR pszImage;
    UINT cchImageMax;
    int xOffsetPercent;
    int yOffsetPercent;
} LVBKIMAGE, FAR *LPLVBKIMAGE;

Contains information about the background image of a list view control. This structure is used for both setting and retrieving background image information.

ulFlags
One or more of the following flags. The LVBKIF_SOURCE_MASK value can be used to mask off all but the source flags. The LVBKIF_STYLE_MASK value can be used to mask off all but the style flags.
LVBKIF_SOURCE_NONE The list view control has no background image.
LVBKIF_SOURCE_HBITMAP Not currently implemented.
LVBKIF_SOURCE_URL The pszImage member contains the URL of the background image.
LVBKIF_STYLE_NORMAL The background image is displayed normally.
LVBKIF_STYLE_TILE The background image will be tiled to fill the entire background of the control.
hbm
Not currently used.
pszImage
Address of a NULL-terminated string that contains the URL of the background image. This member is only valid if the LVBKIF_SOURCE_URL flag is set in ulFlags. This member must be initialized to point to the buffer that contains or receives the text before sending the message.
cchImageMax
Size of the buffer at the address in pszImage. If information is being sent to the control, this member is ignored.
xOffsetPercent
Percentage of the control's client area that the image should be offset horizontally. For example, at 0 percent, the image will be displayed against the left edge of the control's client area. At 50 percent, the image will be displayed horizontally centered in the control's client area. At 100 percent, the image will be displayed against the right edge of the control's client area. This member is only valid when LVBKIF_STYLE_NORMAL is specified in ulFlags.
yOffsetPercent
Percentage of the control's client area that the image should be offset vertically. For example, at 0 percent, the image will be displayed against the top edge of the control's client area. At 50 percent, the image will be displayed vertically centered in the control's client area. At 100 percent, the image will be displayed against the bottom edge of the control's client area. This member is only valid when LVBKIF_STYLE_NORMAL is specified in ulFlags.

This structure is used with the LVM_GETBKIMAGE and LVM_SETBKIMAGE messages.

Version 4.71

LVCOLUMN

typedef struct _LVCOLUMN { 
    UINT mask; 
    int fmt; 
    int cx; 
    LPTSTR pszText; 
    int cchTextMax; 
    int iSubItem; 
#if (_WIN32_IE >= 0x0300)
    int iImage;
    int iOrder;
#endif
} LVCOLUMN, FAR *LPLVCOLUMN; 

Contains information about a column in report view. This structure is used both for creating and manipulating columns. This structure supersedes the LV_COLUMN structure.

mask
Variable specifying which members contain valid information. This member can be zero, or one or more of the following values:
LVCF_FMT The fmt member is valid.
LVCF_IMAGE Version 4.70. The iImage member is valid.
LVCF_ORDER Version 4.70. The iOrder member is valid.
LVCF_SUBITEM The iSubItem member is valid.
LVCF_TEXT The pszText member is valid.
LVCF_WIDTH The cx member is valid.
fmt
Alignment of the column heading and the subitem text in the column. This member can be one of the following values:
LVCFMT_BITMAP_ON_RIGHT Version 4.70. The bitmap appears to the right of text. This does not affect an image from an image list assigned to the header item.
LVCFMT_CENTER Text is centered.
LVCFMT_COL_HAS_IMAGES Version 4.70. The header item contains an image in the image list.
LVCFMT_IMAGE Version 4.70. The item displays an image from an image list.
LVCFMT_LEFT Text is left-aligned.
LVCFMT_RIGHT Text is right-aligned.

The leftmost column in a list view control must be left-aligned.

cx
Width of the column, in pixels.
pszText
If column information is being set, this member is the address of a null-terminated string that contains the column heading text. If the structure is receiving information about a column, this member specifies the address of the buffer that receives the column heading text.
cchTextMax
Size of the buffer pointed to by the pszText member. If the structure is not receiving information about a column, this member is ignored.
iSubItem
Index of subitem associated with the column.
iImage
Version 4.70. Zero-based index of an image within the image list. The specified image will appear within the column.
iOrder
Version 4.70. Zero-based column offset. Column offset is in left-to-right order. For example, zero indicates the leftmost column.

This structure is used with the LVM_GETCOLUMN, LVM_SETCOLUMN, LVM_INSERTCOLUMN, and LVM_DELETECOLUMN messages.

LVFINDINFO

typedef struct tagLVFINDINFO
{
    UINT flags;
    LPCTSTR psz;
    LPARAM lParam;
    POINT pt;
    UINT vkDirection;
} LVFINDINFO, FAR* LPFINDINFO;

Contains information used to search for a list view item. This structure is the same as the LV_FINDINFO structure but has been renamed to fit standard naming conventions.

flags
Specifies the type of search to perform. This can be one or more of the following values:
LVFI_PARAM Searches based on the lParam member. The lParam member of the matching item's LVITEM structure must match the lParam member of this structure. If this value is specified, all other values are ignored.
LVFI_PARTIAL Checks to see if the item text begins with the string pointed to by the psz member. This value implies use of LVFI_STRING.
LVFI_STRING Searches based on the item text. Unless additional values are specified, the item text of the matching item must exactly match the string pointed to by the psz member.
LVFI_WRAP Continues the search at the beginning if no match is found.
LVFI_NEARESTXY Finds the item nearest to the position specified in the pt member, in the direction specified by the vkDirection member.
psz
Address of a null-terminated string to compare with the item text if flags specifies LVFI_STRING or LVFI_PARTIAL.
lParam
Value to compare with the lParam member of a list view item's LVITEM structure if the flags member specifies LVFI_PARAM.
pt
POINT structure that specifies the starting position to search from. This member is used only if LVFI_NEARESTXY is specified in the flags member.
vkDirection
Specifies the direction to search. This member contains the virtual key code of an arrow key that corresponds to the direction to search. This member is used only if LVFI_NEARESTXY is specified in the flags member.

LVHITTESTINFO

typedef struct _LVHITTESTINFO { 
    POINT pt; 
    UINT flags; 
    int iItem; 
    int iSubItem;
 } LVHITTESTINFO, FAR *LPLVHITTESTINFO;

Has 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 LV_HITTESTINFO structure.

pt
Position to hit test, in client coordinates.
flags
Variable that receives information about the results of a hit test. This member can be one or more of the following values:
LVHT_ABOVE The position is above the control's client area.
LVHT_BELOW The position is below the control's client area.
LVHT_NOWHERE The position is inside the list view control's client window, but it is not over a list item.
LVHT_ONITEMICON The position is over a list view item's icon.
LVHT_ONITEMLABELThe position is over a list view item's text.
LVHT_ONITEMSTATEICONThe position is over the state image of a list view item.
LVHT_TOLEFT The position is to the left of the list view control's client area.
LVHT_TORIGHT The position is to the right of the list view control's client area.

You can use LVHT_ABOVE, LVHT_BELOW, LVHT_TOLEFT, and LVHT_TORIGHT to determine whether to scroll the contents of a list view control. Two of these values may be combined. For example, if the position is above and to the left of the client area, you could use both LVHT_ABOVE and LVHT_TOLEFT.

You can test for LVHT_ONITEM to determine whether a specified position is over a list view item. This value is a bitwise-OR operation on LVHT_ONITEMICON, LVHT_ONITEMLABEL, and LVHT_ONITEMSTATEICON.

iItem
Receives the index of the matching item. Or if hit-testing a subitem, this value represents the subitem's parent item.
iSubItem
Version 4.70. Receives the index of the matching subitem. When hit-testing an item, this member will be zero.

LVITEM

typedef struct _LVITEM { 
    UINT   mask; 
    int    iItem; 
    int    iSubItem; 
    UINT   state; 
    UINT   stateMask; 
    LPTSTR  pszText; 
    int    cchTextMax; 
    int    iImage; 
    LPARAM lParam;
#if (_WIN32_IE >= 0x0300)
    int iIndent;
#endif
} LVITEM, FAR *LPLVITEM; 

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

mask
Set of flags that specify which members of this structure contain data to be set or which members are being requested. This can be one or more of the following flags:
LVIF_TEXT The pszText member is valid or must be filled in.
LVIF_IMAGE The iImage member is valid or must be filled in.
LVIF_INDENT The iIndent member is valid or must be filled in.
LVIF_NORECOMPUTE The control will not generate LVN_GETDISPINFO to retrieve text information if it receives a LVM_GETITEM message. Instead, the pszText member will contain LPSTR_TEXTCALLBACK.
LVIF_PARAM The lParam member is valid or must be filled in.
LVIF_STATE The state member is valid or must be filled in.
LVIF_DI_SETITEM The operating system should store the requested list item information and not ask for it again. This flag is used only with the LVN_GETDISPINFO notification message.
iItem
Zero-based index of the item to which this structure refers.
iSubItem
One-based index of the subitem to which this structure refers, or zero if this structure refers to an item rather than a subitem.
state
Indicates the item's state, state image, and overlay image. The stateMask member indicates the valid bits of this member.

Bits 0 through 7 of this member contain the item state flags. This can be one or more of the item state values.

Bits 8 through 11 of this member specify the one-based overlay image index. Both the full-sized icon image list and the small icon image list can have overlay images. The overlay image is superimposed over the item's icon image. If these bits are zero, the item has no overlay image. To isolate these bits, use the LVIS_OVERLAYMASK mask. To set the overlay image index in this member, you should use the INDEXTOOVERLAYMASK macro. The image list's overlay images are set with the ImageList_SetOverlayImage function.

Bits 12 through 15 of this member specify the state image index. The state image is displayed next to an item's icon to indicate an application-defined state. If these bits are zero, the item has no state image. To isolate these bits, use the LVIS_STATEIMAGEMASK mask. To set the state image index, you should use the INDEXTOSTATEIMAGEMASK macro. The state image index specifies the index of the image in the state image list that should be drawn. The state image list is specified with the LVM_SETIMAGELIST message.

stateMask
Value specifying which bits of the state member will be retrieved or modified. For example, setting this member to LVIS_SELECTED will cause only the item's selection state to be retrieved.

This member allows you to modify one or more item states without having to retrieve all of the item states first. For example, setting this member to LVIS_SELECTED and state to zero will cause the item's selection state to be cleared, but none of the other states will be affected.

To retrieve or modify all of the states, set this member to (UINT)-1.

pszText
Address of a null-terminated string containing the item text if the structure specifies item attributes. If this member is the LPSTR_TEXTCALLBACK value, the item is a callback item. Do not set the pszText member to LPSTR_TEXTCALLBACK if the list view control has LVS_SORTASCENDING or LVS_SORTDESCENDING style.

If the structure is receiving item attributes, this member is the address of the buffer that receives the item text.

cchTextMax
Size of the buffer pointed to by the pszText member if the structure is receiving item attributes. This member is ignored if the structure specifies item attributes.
iImage
Index of the item's icon in the control's image list. This applies to both the large and small image list.

If this member is the I_IMAGECALLBACK value, the parent window is responsible for storing the index. In this case, the list view control sends the parent an LVN_GETDISPINFO notification message to get the index when it needs to display the image.

lParam
32-bit value specific to the item. If you use the LVM_SORTITEMS message, the list view control passes this value to the application-defined comparison function. You can also use the LVM_FINDITEM message to search a list view control for an item with a specified lParam value.
iIndent
Version 4.70. Number of image widths to indent the item. A single indentation equals the width of an item image. Therefore, the value 1 indents the item by the width of one image, the value 2 indents by two images, and so on. Note that this field is supported only for items. Attempting to set subitem indentation will cause the calling function to fail.

The LVITEM structure is used with a number of messages, including LVM_GETITEM, LVM_SETITEM, LVM_INSERTITEM, and LVM_DELETEITEM.

NMITEMACTIVATE

typedef struct tagNMITEMACTIVATE{
    NMHDR   hdr;
    int     iItem;
    int     iSubItem;
    UINT    uNewState;
    UINT    uOldState;
    UINT    uChanged;
    POINT   ptAction;
    LPARAM  lParam;
    UINT    uKeyFlags;
} NMITEMACTIVATE, FAR *LPNMITEMACTIVATE;

Contains information about an LVN_ITEMACTIVATE notification message.

hdr
NMHDR structure that contains information about this notification message.
iItem
Index of the list view item. If the item index is not used for the notification, this member will contain -1.
iSubItem
One-based index of the subitem. If the subitem index is not used for the notification or the notification does not apply to a subitem, this member will contain zero.
uNewState
Specifies the new item state. This member is zero for notification messages that do not use it.
uOldState
Specifies the old item state. This member is zero for notification messages that do not use it.
uChanged
Set of flags that indicate the item attributes that have changed. This member is zero for notifications that do not use it. Otherwise, it can have the same values as the mask member of the LVITEM structure.
ptAction
Specifies a POINT structure that indicates the location at which the event occurred. This member is undefined for notification messages that do not use it.
lParam
Specifies the item's application-defined 32-bit value. This member is undefined for notification messages that do not use it.
uKeyFlags
Specifies the modifier keys that were pressed at the time of the activation. This member contains zero or a combination of the following flags:
LVKF_ALT The ALT key is pressed.
LVKF_CONTROL The CTRL key is pressed.
LVKF_SHIFT The SHIFT key is pressed.

Version 4.71

NMLISTVIEW

typedef struct tagNMLISTVIEW{
    NMHDR   hdr;
    int     iItem;
    int     iSubItem;
    UINT    uNewState;
    UINT    uOldState;
    UINT    uChanged;
    POINT   ptAction;
    LPARAM  lParam;
} NMLISTVIEW, FAR *LPNMLISTVIEW;

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

hdr
NMHDR structure that contains information about this notification message.
iItem
Identifies the list view item, or -1 if not used.
iSubItem
Identifies the subitem, or zero if none.
uNewState
Specifies the new item state. This member is zero for notification messages that do not use it.
uOldState
Specifies the old item state. This member is zero for notification messages that do not use it.
uChanged
Set of flags that indicate the item attributes that have changed. This member is zero for notifications that do not use it. Otherwise, it can have the same values as the mask member of the LVITEM structure.
ptAction
Specifies a POINT structure that indicates the location at which the event occurred. This member is undefined for notification messages that do not use it.
lParam
Specifies the item's application-defined 32-bit value. This member is undefined for notification messages that do not use it.

Version 4.70

NMLVCACHEHINT

typedef struct tagNMLVCACHEHINT {
    NMHDR   hdr;
    int     iFrom;
    int     iTo;
} NMLVCACHEHINT, *PNMLVCACHEHINT;

Contains information used to update the cached item information for use with a virtual list view.

hdr
NMHDR structure that contains information about this notification message.
iFrom
Starting index of the requested range of items. This value is inclusive.
iTo
Ending index of the requested range of items. This value is inclusive.

Version 4.70

NMLVCUSTOMDRAW

typedef struct tagNMLVCUSTOMDRAW {
    NMCUSTOMDRAW nmcd;
    COLORREF clrText;
    COLORREF clrTextBk;
#if (_WIN32_IE >= 0x0400)
    int iSubItem;
#endif
} NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW;

Contains information specific to an NM_CUSTOMDRAW notification message sent by a list view control.

nmcd
NMCUSTOMDRAW structure that contains general custom draw information.
clrText
COLORREF value representing the color that will be used to display text foreground in the list view control.
clrTextBk
COLORREF value representing the color that will be used to display text background in the list view control.
iSubItem
Version 4.71. Index of the subitem that is being drawn. If the main item is being drawn, this member will be zero.

Version 4.70

NMLVDISPINFO

typedef struct tagLVDISPINFO {
    NMHDR hdr;
    LVITEM item;
} NMLVDISPINFO, FAR *LPNMLVDISPINFO;

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

hdr
NMHDR structure that contains information about this notification message.
item
Specifies an LVITEM structure that identifies the item or subitem. The structure either contains or receives information about the item. The mask member contains a set of bit flags that specify which item attributes are relevant. You can set one or more of the following bit flags:
LVIF_IMAGE The iImage member specifies, or is to receive, the index of the item's icon in the image list.
LVIF_STATE The state member specifies, or is to receive, the state of the item.
LVIF_TEXT The pszText member specifies the new item text or the address of a buffer that is to receive the item text.
If the structure is receiving item text, the pszText and cchTextMax members specify the address and size of a buffer. You can either copy text to the buffer or assign the address of a string to the pszText member. In the latter case, you must not change or delete the string until the corresponding item text is deleted or two additional LVN_GETDISPINFO messages have been sent.
If you are handling the LVN_GETDISPINFO message, you can set the LVIF_DI_SETITEM flag in the mask member. This tells the operating system to store the requested list item information and not ask for it again. For list view controls with the LVS_REPORT style, this flag only applies to the first (subitem 0) column's information. The control will not store information for subitems.

NMLVFINDITEM

typedef struct _NMLVFINDITEM {
    NMHDR hdr;
    int iStart;
    LVFINDINFO lvfi;
} NMLVFINDITEM, *PNMLVFINDITEM;

Contains information the owner needs to find items requested by a virtual list view control. This structure is used with the LVN_ODFINDITEM notification message.

hdr
NMHDR structure that contains information on this notification message.
iStart
Index of the item at which the search will start.
lvfi
LVFINDINFO structure that contains information necessary to perform a search.

Version 4.70

NMLVGETINFOTIP

typedef struct tagNMLVGETINFOTIP{
    NMHDR hdr;
    DWORD dwFlags;
    LPTSTR pszText;
    int cchTextMax;
    int iItem;
    int iSubItem;
    LPARAM lParam;
} NMLVGETINFOTIP, *LPNMLVGETINFOTIP;

Contains and receives list view item information needed to display a tooltip for an item. This structure is used with the LVN_GETINFOTIP notification message.

hdr
NMHDR structure that contains information on this notification message.
dwFlags
Either zero or LVGIT_UNFOLDED.
pszText
Address of a string buffer that receives any additional text information. If dwFlags is zero, this member will contain the existing item text. In this case, you should append any additional text onto the end of this string. The size of this buffer is specified by the ccTextMax structure.
cchTextMax
Size, in characters, of the buffer pointed to by pszText. Although you should never assume that this buffer will be of any particular size, the INFOTIPSIZE value can be used for design purposes.
iItem
Zero-based index of the item to which this structure refers.
iSubItem
One-based index of the subitem to which this structure refers. If this member is zero, the structure is referring to the item and not a subitem. This member is not currently used and will always be zero.
lParam
Application-defined value associated with the item. This member is not currently used and will always be zero.

Version 4.71

NMLVKEYDOWN

typedef struct tagLVKEYDOWN {
    NMHDR hdr;
    WORD  wVKey;
    UINT  flags;
} NMLVKEYDOWN, FAR *LPNMLVKEYDOWN;

Contains information used in processing the LVN_KEYDOWN notification message. This structure is the same as the LV_KEYDOWN structure but has been renamed to fit standard naming conventions.

hdr
NMHDR structure that contains additional information about the notification message.
wVKey
Virtual key code.
flags
This member must always be zero.

NMLVODSTATECHANGE

typedef struct tagNMLVODSTATECHANGE {
    NMHDR hdr;
    int   iFrom;
    int   iTo;
    UINT  uNewState;
    UINT  uOldState;
} NMLVODSTATECHANGE, FAR *LPNMLVODSTATECHANGE;

Structure that contains information for use in processing the LVN_ODSTATECHANGED notification message.

hdr
NMHDR structure that contains additional information about the notification message.
iFrom
Zero-based index of the first item in the range of items.
iTo
Zero-based index of the last item in the range of items.
uNewState and uOldState
Values indicating the new and old states for the item or items. These members can be any valid combination of the list view item states.

Version 4.70

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