Messages of ListView control
[ListView control]

Defines


Define Documentation

#define LVM_ADDCOLUMN   0xF112

Adds a new column to listview, identified by column.

  LVM_ADDCOLUMN
  PLVCOLUMN p;

  wParam = 0;
  lParam =(LPARAM)p;
Parameters:
p Pointes to a LVCOLUMN structure that contains the information about the new column to be added.

Definition at line 414 of file listview.h.

#define LVM_ADDITEM   0xF110

Adds a item to listview, this item is also called a row.

  LVM_ADDITEM
  PLVITEM p
  HLVITEM parent;

  wParam = (WPARAM)parent;
  p =(LPARAM)lParam;
Parameters:
p Pointes to a LVITEM structure that contains the information of the new item to be added. nItem member of the LVITEM struct speficied the item position in its parent item, beginning with zero.
parent Handle of the parent item into which the new item is about to insert. If parent equals zero, the parent item will be the root of listview.
Returns:
Returns the handle of the new item if successful, or 0 otherwise.

Definition at line 373 of file listview.h.

#define LVM_CHOOSEITEM   0xF139

Selects and shows an item.

 LVM_CHOOSEITEM
 int nRow;
 HLVITEM pi;

 wParam = (WPARAM)nRow;
 lParam = (LPARAM)pi;
Parameters:
nRow If pi is zero, nRow specified the row index of the target item to choose.
pi Handle of the target item.
Returns:
Always returns 0.

Definition at line 1054 of file listview.h.

#define LVM_CLEARSUBITEM   0xF114

Clears the content of a subitem.

 LVM_CLEARSUBITEM
 PLVSUBITEM p;
 HLVITEM pi;

 lParam = (LPARAM)p;
 wParam = (WPARAM)pi;
Parameters:
p Pointes to a PLVSUBITEM structure that contains the information of the subitem to clear. If pi is not zero, nItem member of this struct has no meaning.
pi Handle of the target item. If pi equals zero, the row position of the target item is specified by nItem member of p structure.
Returns:
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 458 of file listview.h.

#define LVM_COLSORT   0xF116

Sorts all subitems according to a certain column.

 LVM_COLSORT
 int ncol;

 wParam = (WPARAM)ncol;
 lParam = 0;
Parameters:
ncol Index of the column.
Returns:
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 492 of file listview.h.

#define LVM_DELALLITEM   0xF11D

Removes all the items in listview.

 LVM_DEALLITEM

 wParam = 0;
 lParam = 0;
Returns:
Returns TRUE if successful, or FALSE otherwise.

Definition at line 621 of file listview.h.

#define LVM_DELCOLUMN   0xF115

Deletes a column from listview, all subitem in this column will be removed.

 LVM_DELCOLUMN
 int nCols;

 wParam = (WPARAM)nCol;
 lParam = 0;
Parameters:
nCol The index of the column to be removed.
Returns:
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 475 of file listview.h.

#define LVM_DELITEM   0xF113

Deletes an item form listview.

 LVM_DELITEM
 int nRow;
 HLVITEM pi;

 wParam = (WPARAM)nRow;
 lParam = (LPARAM)pi;
Parameters:
nRow If pi is zero, nRow specified the row index of the target item to delete.
pi Handle of the target item.
Returns:
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 434 of file listview.h.

#define LVM_FILLSUBITEM   0xF111

Sets the content of a subitem, indentified by rows and columns.

 LVM_FILLSUBITEM
 PLVSUBITEM p;
 HLVITEM pi;

 lParam = (LPARAM)p;
 wParam = (WPARAM)pi;
Parameters:
p Pointes to a PLVSUBITEM structure that contains the information of the subitem to set. If pi is not zero, nItem member of this struct has no meaning.
pi Handle of the target item. If pi equals zero, the row position of the target item is specified by nItem member of p structure.
Returns:
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 397 of file listview.h.

#define LVM_FINDITEM   0xF118

Searchs a item.

 LVM_FINDITEM
 PLVFINDINFO plvfi;
 HLVITEM parent;
 wParam = (WPARAM)parent;
 lParam = (LPARAM)plvfi;
Parameters:
parent Handle of the item to search in.
plvfi Points to a LVFINDINFO structure containing information for searching. If parent is zero, iStart member of plvfi specifieds the start position on search.
Returns:
Returns the handle of the found item if successful, or 0 otherwise.

Definition at line 535 of file listview.h.

#define LVM_FOLDITEM   0xF142

Folds or unfolds an item.

 LVM_FOLDITEM
 int bFold;
 HLVITEM pi;

 wParam = (WPARAM)bFold;
 lParam = (LPARAM)pi;
Parameters:
bFold To fold or to unfold, TRUE is to fold.
pi Handle of the target item.
Returns:
Always returns 0.

Definition at line 1140 of file listview.h.

#define LVM_GETCOLUMN   0xF125

Retrieves the information about a listview column.

 LVM_GETCOLUMN
 int nCol;
 PLVCOLUMN pcol;

 wParam = (WPARAM)nCol;
 lParam = (LPARAM)pcol;
Parameters:
nCol Index of the column.
pcol Points to a LVCOLUMN structure for retrieving the information about the column.
Returns:
Returns TRUE if successful, or FALSE otherwise.

Definition at line 790 of file listview.h.

#define LVM_GETCOLUMNCOUNT   0xF11B

Gets the number of all the columns in listview.

 LVM_GETCOLUMNCOUNT

 wParam = 0;
 lParam = 0;
Returns:
Returns the number of all the columns in listview.

Definition at line 591 of file listview.h.

#define LVM_GETCOLUMNWIDTH   0xF126

Retrieves the width of a listview column.

 LVM_GETCOLUMNWIDTH
 int nCol;

 wParam = (WPARAM)nCol;
 lParam = (LPARAM)0;
Parameters:
nCol Index of the column.
Returns:
Returns the column width if successful, or -1 otherwise.

Definition at line 808 of file listview.h.

#define LVM_GETITEM   0xF127

Retrieves the item's attributes.

 LVM_GETITEM
 HLVITEM pi;
 LVITEM item_info;

 wParam = (WPARAM)pi;
 lParam = (LPARAM)&item_info;
Parameters:
pi Handle of the target item.
item_info Used for storing the target item's attributes. If pi is zero, nItem field of item_info specified the row index of the target item to get.
Returns:
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 830 of file listview.h.

#define LVM_GETITEMADDDATA   0xF137

Gets the 32-bit data value associated with an item.

An application sends an LVM_GETITEMADDDATA message to a listview to get the 32-bit data value stored for the item with index of wParam; By default this is zero. An application must set the item data value by sending an LVM_SETITEMADDDATA message to the listview for this value to have meaning.

 LVM_GETITEMADDDATA
 int index;
 HLVITEM pi;

 wParam = (WPARAM)index;
 lParam = (LPARAM)pi;
Parameters:
pi Handle of the target item.
index The index of the specified item. If pi is not zero, use pi instead.
Returns:
The 32-bit data value associated with an item on success, otherwise -1 to indicate an error.

Definition at line 1008 of file listview.h.

#define LVM_GETITEMCOUNT   0xF11A

Gets the number of all the items(rows) in a listview.

 LVM_GETITEMCOUNT

 wParam = 0;
 lParam = 0;
Returns:
The number of the items.

Definition at line 576 of file listview.h.

#define LVM_GETITEMSTATE   0xF128

Retrieves the state of a listview item.

 LVM_GETITEMSTATE
 UINT mask;
 HLVITEM pi;

 wParam = (WPARAM)pi;
 lParam = (LPARAM)mask;
Parameters:
pi Handle of the target item.
mask Contains state information to retrieve, can be the combination of the following values.
Returns:
Returns the current state of the specified item.

Definition at line 851 of file listview.h.

#define LVM_GETRELATEDITEM   0xF141

Retrives related item of specific item.

 LVM_GETRELATEDITEM
 int related;
 GHANDLE item;

 wParam = (WPARAM)related;
 lParam = (LPARAM)item;
Parameters:
related A integer which indicates the relationship between the item to retrive and the specified item, can be one of the following values:

  • TVIR_PARENT
    To retrive the parent item of the specified item.
  • TVIR_FIRSTCHILD
    To retrive the first child item of the specified item.
  • TVIR_NEXTSIBLING
    To retrive the next sibling item of the specified item.
  • TVIR_PREVSIBLING
    To retrive the previous sibling item of the specified item.
item The handle to the known item.
Returns:
The handle of the related item on success, otherwise 0.

Definition at line 1120 of file listview.h.

#define LVM_GETSELECTEDCOLUMN   0xF129

Retrieves the index of the currently selected column of a listview.

 LVM_GETSELECTEDCOLUMN

 wParam = 0;
 lParam = 0;
Returns:
Returns the index of the selected column.

Definition at line 866 of file listview.h.

#define LVM_GETSELECTEDCOUNT   0xF130

Retrieves the number of the selected items in a listview.

 LVM_GETSELECTEDCOUNT

 wParam = 0;
 lParam = 0;
Returns:
Returns the number of the selected items.

Definition at line 881 of file listview.h.

#define LVM_GETSELECTEDITEM   0xF11C

Gets the current selected item.

 LVM_GETSELECTEDITEM

 wParam = 0;
 lParam = 0;
Returns:
Returns the handle of the current selected item.

Definition at line 606 of file listview.h.

#define LVM_GETSELECTEDITEMRECT   0xF144

Get the selected item's Rectangle.

 LVM_GETSELECTEDITEMRECT
 RECT * prcItem

 wPram = (WPARAM)0
 lParam = (LPARAM)prcItem
Parameters:
prcItem Pointer to a RECT which recieve the Item Rectangle
Returns:
If got, return TRUE, otherwise return FALSE

Definition at line 1176 of file listview.h.

#define LVM_GETSUBITEMLEN   0xF121

Gets the text length of the subitem.

 LVM_GETSUBITEMLEN
 PLVSUBITEM p;
 HLVITEM pi;

 lParam = (LPARAM)p;
 wParam = (WPARAM)pi;
Parameters:
p Pointes to a PLVSUBITEM structure that contains the information of the subitem to set. If pi is not zero, nItem member of this struct has no meaning.
pi Handle of the target item. If pi equals zero, the row position of the target item is specified by nItem member of p structure.
Returns:
Returns the text length if successful, or LV_ERR otherwise.

Definition at line 703 of file listview.h.

#define LVM_GETSUBITEMTEXT   0xF119

Retrieves the text of a listview subitem.

 LVM_GETSUBITEMTEXT
 PLVSUBITEM p;
 HLVITEM pi;

 lParam = (LPARAM)p;
 wParam = (WPARAM)pi;
Parameters:
p Pointes to a PLVSUBITEM structure that contains the information of the subitem to set. If pi is not zero, nItem member of this struct has no meaning.
pi Handle of the target item. If pi equals zero, the row position of the target item is specified by nItem member of p structure.
Returns:
Returns len of the text if successful, -1 otherwise.

Definition at line 561 of file listview.h.

#define LVM_GETTOPVISIBLE   0xF131

Retrieves the index of the topmost visible item in a listview.

 LVM_GETTOPVISIBLE

 wParam = 0;
 lParam = 0;
Returns:
Returns the index of the topmost visible item if successful, or zero.

Definition at line 896 of file listview.h.

#define LVM_MODIFYHEAD   0xF11E

Changes the title of a column.

 LVM_MODIFYHEAD
 PLVCOLUMN pcol;

 wParam = 0;
 lParam = (LPARAM)pcol;
Parameters:
pcol Pointer to a LVCOLUMN struct.
Returns:
Returns LV_OKAY if successfull, or LV_ERR otherwise.

Definition at line 638 of file listview.h.

#define LVM_NULL   0xF132

reserved.

Definition at line 902 of file listview.h.

#define LVM_SELECTITEM   0xF11F

Selects an item.

 LVM_SELECTITEM
 int nRow;
 HLVITEM pi;

 wParam = (WPARAM)nRow;
 lParam = (LPARAM)pi;
Parameters:
nRow If pi is zero, nRow specified the row index of the target item to select.
pi Handle of the target item.
Returns:
Always returns 0.

Definition at line 658 of file listview.h.

#define LVM_SETCOLUMN   0xF122

Sets the attributes of a list view column.

 LVM_SETCOLUMN
 PLVCOLUMN pcol;

 wParam = 0;
 lParam = (LPARAM)pcol;
Parameters:
pcol Points to a LVCOLUMN structure containing the new column information.
Returns:
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 721 of file listview.h.

#define LVM_SETCUSTOMDRAW   0xF143

Sets the customized drawing functions of listview.

 LVM_SETCUSTOMDRAW
 LVCUSTOMDRAWFUNCS myFuncs;

 wParam = (WPARAM)0;
 lParam = (LPARAM)&myFuncs;
Parameters:
myFuncs Pointer to a customized drawing functions structure.
Returns:
Always returns 0.

Definition at line 1158 of file listview.h.

#define LVM_SETHEADHEIGHT   0xF136

Changes the height of the header.

 LVM_SETHEADHEIGHT
 int height;

 wParam = (WPARAM)height;
 lParam = 0;
Parameters:
height The new height of the header.
Returns:
Returns TRUE if successful, or FALSE otherwise.

Definition at line 981 of file listview.h.

#define LVM_SETITEMADDDATA   0xF138

Associates a 32-bit data value with an item.

An application sends an LVM_SETITEMADDDATA message to associate a 32-bit data value specified in the lParam parameter with an item in the listview.

 LVM_SETITEMADDDATA
 HLVITEM pi;
 DWORD addData;

 wParam = (WPARAM)pi;
 lParam = (LPARAM)addData;
Parameters:
pi Handle of the target item.
addData The 32-bit data value which will associated with the item.
Returns:
One of the following values:
  • LV_OKAY
    Success
  • LV_ERR
    Invalid item index

Definition at line 1034 of file listview.h.

#define LVM_SETITEMHEIGHT   0xF135

Changes the height of a item.

 LVM_SETITEMHEIGHT
 int height;
 HLVITEM pi;

 wParam = (WPARAM)pi;
 lParam = (LPARAM)height;
Parameters:
height The new height of the item.
pi Handle of the target item.
Returns:
Returns TRUE if successful, or FALSE otherwise.

Definition at line 964 of file listview.h.

#define LVM_SETITEMSTATE   0xF133

reserved.

Definition at line 908 of file listview.h.

#define LVM_SETSTRCMPFUNC   0xF140

Sets the STRCMP function used to sort items.

An application sends a LVM_SETSTRCMPFUNC message to set a new STRCMP function to sort items in the Listview control.

Note that you should send this message before adding any item to the Listview control.

 static int my_strcmp (const char* s1, const char* s2, size_t n)
 {
      ...
      return 0;
 }

 LVM_SETSTRCMPFUNC

 wParam = 0;
 lParam = (LPARAM) my_strcmp;
Parameters:
my_strcmp Your own function to compare two strings.
Returns:
One of the following values:
  • 0
    Success
  • -1
    Not an empty TreeView control

Definition at line 1085 of file listview.h.

#define LVM_SETSUBITEM   0xF124

Sets the attributes of a subitem.

 LVM_SETSUBITEM
 PLVSUBITEM p;
 HLVITEM pi;

 lParam = (LPARAM)p;
 wParam = (WPARAM)pi;
Parameters:
p Pointes to a PLVSUBITEM structure that contains the information of the subitem to set. If pi is not zero, nItem member of this struct has no meaning.
pi Handle of the target item. If pi equals zero, the row position of the target item is specified by nItem member of p structure.
Returns:
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 769 of file listview.h.

#define LVM_SETSUBITEMCOLOR   0xF117

Sets the text color of a subitem.

 LVM_SETSUBITEMCOLOR
 PLVSUBITEM p;
 HLVITEM pi;

 lParam = (LPARAM)p;
 wParam = (WPARAM)pi;
Parameters:
p Pointes to a PLVSUBITEM structure that contains the information of the subitem to set. If pi is not zero, nItem member of this struct has no meaning.
pi Handle of the target item. If pi equals zero, the row position of the target item is specified by nItem member of p structure.
Returns:
Always returns 0;

Definition at line 516 of file listview.h.

#define LVM_SETSUBITEMTEXT   0xF123

Sets the text of a subitem.

 LVM_SETSUBITEMTEXT
 PLVSUBITEM p;
 HLVITEM pi;

 wParam = (WPARAM)pi;
 lParam = (LPARAM)p;
Parameters:
p Pointes to a PLVSUBITEM structure that contains the information of the subitem to set. If pi is not zero, nItem member of this struct has no meaning.
pi Handle of the target item. If pi equals zero, the row position of the target item is specified by nItem member of p structure.
Returns:
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 745 of file listview.h.

#define LVM_SHOWITEM   0xF120

Makes the item is entirely visible in the list view.

 LVM_SHOWITEM
 int nRow;
 HLVITEM pi;

 wParam = (WPARAM)nRow;
 lParam = (LPARAM)pi;
Parameters:
nRow If pi is zero, nRow specified the row index of the target item to show.
pi Handle of the target item.
Returns:
Always returns 0.

Definition at line 679 of file listview.h.

#define LVM_SORTITEMS   0xF134

Uses an application-defined comparision function to sort the items.

 LVM_SORTITEMS
 PLVSORTDATA sortData;
 PFNLVCOMPARE pfnCompare;

 wParam = (WPARAM)sortData;
 lParam = (LPARAM)pfnCompare;
Parameters:
sortData Sorting datas passed to the comparision function.
pfnCompare Pointer to the application-defined comparision function. The comparision function is called during the sort operation each time the relative order of the two items needs to be compared.

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

The comparision function has the following form:

int CompareFunction(int nItem1, int nItem2, PLVSORTDATA sortData);

nItem1 is the handle of the first item, nItem2 is the handle of the second item, and sortData is passed to CompareFunction as the third parameter.

Returns:
Returns TRUE if successful, or FALSE otherwise.

Definition at line 944 of file listview.h.

Generated on Thu Apr 7 15:58:36 2011 for MiniGUI V3.0.12 API Reference by  doxygen 1.6.3