MiniGUI API Reference (MiniGUI-Standalone)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros
Messages of ListView control

Macros

#define LVM_ADDITEM   0xF110
 Adds a item to listview, this item is also called a row. More...
 
#define LVM_FILLSUBITEM   0xF111
 Sets the content of a subitem, indentified by rows and columns. More...
 
#define LVM_ADDCOLUMN   0xF112
 Adds a new column to listview, identified by column. More...
 
#define LVM_DELITEM   0xF113
 Deletes an item form listview. More...
 
#define LVM_CLEARSUBITEM   0xF114
 Clears the content of a subitem. More...
 
#define LVM_DELCOLUMN   0xF115
 Deletes a column from listview, all subitem in this column will be removed. More...
 
#define LVM_COLSORT   0xF116
 Sorts all subitems according to a certain column. More...
 
#define LVM_SETSUBITEMCOLOR   0xF117
 Sets the text color of a subitem. More...
 
#define LVM_FINDITEM   0xF118
 Searchs a item. More...
 
#define LVM_GETSUBITEMTEXT   0xF119
 Retrieves the text of a listview subitem. More...
 
#define LVM_GETITEMCOUNT   0xF11A
 Gets the number of all the items(rows) in a listview. More...
 
#define LVM_GETCOLUMNCOUNT   0xF11B
 Gets the number of all the columns in listview. More...
 
#define LVM_GETSELECTEDITEM   0xF11C
 Gets the current selected item. More...
 
#define LVM_DELALLITEM   0xF11D
 Removes all the items in listview. More...
 
#define LVM_MODIFYHEAD   0xF11E
 Changes the title of a column. More...
 
#define LVM_SELECTITEM   0xF11F
 Selects an item. More...
 
#define LVM_SHOWITEM   0xF120
 Makes the item is entirely visible in the list view. More...
 
#define LVM_GETSUBITEMLEN   0xF121
 Gets the text length of the subitem. More...
 
#define LVM_SETCOLUMN   0xF122
 Sets the attributes of a list view column. More...
 
#define LVM_SETSUBITEMTEXT   0xF123
 Sets the text of a subitem. More...
 
#define LVM_SETSUBITEM   0xF124
 Sets the attributes of a subitem. More...
 
#define LVM_GETCOLUMN   0xF125
 Retrieves the information about a listview column. More...
 
#define LVM_GETCOLUMNWIDTH   0xF126
 Retrieves the width of a listview column. More...
 
#define LVM_GETITEM   0xF127
 Retrieves the item's attributes. More...
 
#define LVM_GETITEMSTATE   0xF128
 Retrieves the state of a listview item. More...
 
#define LVM_GETSELECTEDCOLUMN   0xF129
 Retrieves the index of the currently selected column of a listview. More...
 
#define LVM_GETSELECTEDCOUNT   0xF130
 Retrieves the number of the selected items in a listview. More...
 
#define LVM_GETTOPVISIBLE   0xF131
 Retrieves the index of the topmost visible item in a listview. More...
 
#define LVM_NULL   0xF132
 reserved. More...
 
#define LVM_SETITEMSTATE   0xF133
 reserved. More...
 
#define LVM_SORTITEMS   0xF134
 Uses an application-defined comparision function to sort the items. More...
 
#define LVM_SETITEMHEIGHT   0xF135
 Changes the height of a item. More...
 
#define LVM_SETHEADHEIGHT   0xF136
 Changes the height of the header. More...
 
#define LVM_GETITEMADDDATA   0xF137
 Gets the 32-bit data value associated with an item. More...
 
#define LVM_SETITEMADDDATA   0xF138
 Associates a 32-bit data value with an item. More...
 
#define LVM_CHOOSEITEM   0xF139
 Selects and shows an item. More...
 
#define LVM_SETSTRCMPFUNC   0xF140
 Sets the STRCMP function used to sort items. More...
 
#define LVM_GETRELATEDITEM   0xF141
 Retrives related item of specific item. More...
 
#define LVM_FOLDITEM   0xF142
 Folds or unfolds an item. More...
 
#define LVM_SETCUSTOMDRAW   0xF143
 Sets the customized drawing functions of listview. More...
 
#define LVM_GETSELECTEDITEMRECT   0xF144
 Get the selected item's Rectangle. More...
 

Detailed Description

Macro Definition Documentation

#define LVM_ADDCOLUMN   0xF112

Adds a new column to listview, identified by column.

1 LVM_ADDCOLUMN
2 PLVCOLUMN p;
3 
4 wParam = 0;
5 lParam =(LPARAM)p;
Parameters
pPointes to a LVCOLUMN structure that contains the information about the new column to be added.

Definition at line 435 of file listview.h.

#define LVM_ADDITEM   0xF110

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

1 LVM_ADDITEM
2 PLVITEM p
3 HLVITEM parent;
4 
5 wParam = (WPARAM)parent;
6 p =(LPARAM)lParam;
Parameters
pPointes 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.
parentHandle 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 394 of file listview.h.

#define LVM_CHOOSEITEM   0xF139

Selects and shows an item.

1 LVM_CHOOSEITEM
2 int nRow;
3 HLVITEM pi;
4 
5 wParam = (WPARAM)nRow;
6 lParam = (LPARAM)pi;
Parameters
nRowIf pi is zero, nRow specified the row index of the target item to choose.
piHandle of the target item.
Returns
Always returns 0.

Definition at line 1075 of file listview.h.

#define LVM_CLEARSUBITEM   0xF114

Clears the content of a subitem.

1 LVM_CLEARSUBITEM
2 PLVSUBITEM p;
3 HLVITEM pi;
4 
5 lParam = (LPARAM)p;
6 wParam = (WPARAM)pi;
Parameters
pPointes 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.
piHandle 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 479 of file listview.h.

#define LVM_COLSORT   0xF116

Sorts all subitems according to a certain column.

1 LVM_COLSORT
2 int ncol;
3 
4 wParam = (WPARAM)ncol;
5 lParam = 0;
Parameters
ncolIndex of the column.
Returns
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 513 of file listview.h.

#define LVM_DELALLITEM   0xF11D

Removes all the items in listview.

1 LVM_DEALLITEM
2 
3 wParam = 0;
4 lParam = 0;
Returns
Returns TRUE if successful, or FALSE otherwise.

Definition at line 642 of file listview.h.

#define LVM_DELCOLUMN   0xF115

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

1 LVM_DELCOLUMN
2 int nCols;
3 
4 wParam = (WPARAM)nCol;
5 lParam = 0;
Parameters
nColThe index of the column to be removed.
Returns
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 496 of file listview.h.

#define LVM_DELITEM   0xF113

Deletes an item form listview.

1 LVM_DELITEM
2 int nRow;
3 HLVITEM pi;
4 
5 wParam = (WPARAM)nRow;
6 lParam = (LPARAM)pi;
Parameters
nRowIf pi is zero, nRow specified the row index of the target item to delete.
piHandle of the target item.
Returns
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 455 of file listview.h.

#define LVM_FILLSUBITEM   0xF111

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

1 LVM_FILLSUBITEM
2 PLVSUBITEM p;
3 HLVITEM pi;
4 
5 lParam = (LPARAM)p;
6 wParam = (WPARAM)pi;
Parameters
pPointes 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.
piHandle 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 418 of file listview.h.

#define LVM_FINDITEM   0xF118

Searchs a item.

1 LVM_FINDITEM
2 PLVFINDINFO plvfi;
3 HLVITEM parent;
4 wParam = (WPARAM)parent;
5 lParam = (LPARAM)plvfi;
Parameters
parentHandle of the item to search in.
plvfiPoints 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 556 of file listview.h.

#define LVM_FOLDITEM   0xF142

Folds or unfolds an item.

1 LVM_FOLDITEM
2 int bFold;
3 HLVITEM pi;
4 
5 wParam = (WPARAM)bFold;
6 lParam = (LPARAM)pi;
Parameters
bFoldTo fold or to unfold, TRUE is to fold.
piHandle of the target item.
Returns
Always returns 0.

Definition at line 1161 of file listview.h.

#define LVM_GETCOLUMN   0xF125

Retrieves the information about a listview column.

1 LVM_GETCOLUMN
2 int nCol;
3 PLVCOLUMN pcol;
4 
5 wParam = (WPARAM)nCol;
6 lParam = (LPARAM)pcol;
Parameters
nColIndex of the column.
pcolPoints to a LVCOLUMN structure for retrieving the information about the column.
Returns
Returns TRUE if successful, or FALSE otherwise.

Definition at line 811 of file listview.h.

#define LVM_GETCOLUMNCOUNT   0xF11B

Gets the number of all the columns in listview.

1 LVM_GETCOLUMNCOUNT
2 
3 wParam = 0;
4 lParam = 0;
Returns
Returns the number of all the columns in listview.

Definition at line 612 of file listview.h.

#define LVM_GETCOLUMNWIDTH   0xF126

Retrieves the width of a listview column.

1 LVM_GETCOLUMNWIDTH
2 int nCol;
3 
4 wParam = (WPARAM)nCol;
5 lParam = (LPARAM)0;
Parameters
nColIndex of the column.
Returns
Returns the column width if successful, or -1 otherwise.

Definition at line 829 of file listview.h.

#define LVM_GETITEM   0xF127

Retrieves the item's attributes.

1 LVM_GETITEM
2 HLVITEM pi;
3 LVITEM item_info;
4 
5 wParam = (WPARAM)pi;
6 lParam = (LPARAM)&item_info;
Parameters
piHandle of the target item.
item_infoUsed 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 851 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.

1 LVM_GETITEMADDDATA
2 int index;
3 HLVITEM pi;
4 
5 wParam = (WPARAM)index;
6 lParam = (LPARAM)pi;
Parameters
piHandle of the target item.
indexThe 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 1029 of file listview.h.

#define LVM_GETITEMCOUNT   0xF11A

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

1 LVM_GETITEMCOUNT
2 
3 wParam = 0;
4 lParam = 0;
Returns
The number of the items.

Definition at line 597 of file listview.h.

#define LVM_GETITEMSTATE   0xF128

Retrieves the state of a listview item.

1 LVM_GETITEMSTATE
2 UINT mask;
3 HLVITEM pi;
4 
5 wParam = (WPARAM)pi;
6 lParam = (LPARAM)mask;
Parameters
piHandle of the target item.
maskContains state information to retrieve, can be the combination of the following values.
Returns
Returns the current state of the specified item.

Definition at line 872 of file listview.h.

#define LVM_GETRELATEDITEM   0xF141

Retrives related item of specific item.

1 LVM_GETRELATEDITEM
2 int related;
3 GHANDLE item;
4 
5 wParam = (WPARAM)related;
6 lParam = (LPARAM)item;
Parameters
relatedA 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.
itemThe handle to the known item.
Returns
The handle of the related item on success, otherwise 0.

Definition at line 1141 of file listview.h.

#define LVM_GETSELECTEDCOLUMN   0xF129

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

1 LVM_GETSELECTEDCOLUMN
2 
3 wParam = 0;
4 lParam = 0;
Returns
Returns the index of the selected column.

Definition at line 887 of file listview.h.

#define LVM_GETSELECTEDCOUNT   0xF130

Retrieves the number of the selected items in a listview.

1 LVM_GETSELECTEDCOUNT
2 
3 wParam = 0;
4 lParam = 0;
Returns
Returns the number of the selected items.

Definition at line 902 of file listview.h.

#define LVM_GETSELECTEDITEM   0xF11C

Gets the current selected item.

1 LVM_GETSELECTEDITEM
2 
3 wParam = 0;
4 lParam = 0;
Returns
Returns the handle of the current selected item.

Definition at line 627 of file listview.h.

#define LVM_GETSELECTEDITEMRECT   0xF144

Get the selected item's Rectangle.

1 LVM_GETSELECTEDITEMRECT
2 RECT * prcItem
3 
4 wPram = (WPARAM)0
5 lParam = (LPARAM)prcItem
Parameters
prcItemPointer to a RECT which recieve the Item Rectangle
Returns
If got, return TRUE, otherwise return FALSE

Definition at line 1197 of file listview.h.

#define LVM_GETSUBITEMLEN   0xF121

Gets the text length of the subitem.

1 LVM_GETSUBITEMLEN
2 PLVSUBITEM p;
3 HLVITEM pi;
4 
5 lParam = (LPARAM)p;
6 wParam = (WPARAM)pi;
Parameters
pPointes 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.
piHandle 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 724 of file listview.h.

#define LVM_GETSUBITEMTEXT   0xF119

Retrieves the text of a listview subitem.

1 LVM_GETSUBITEMTEXT
2 PLVSUBITEM p;
3 HLVITEM pi;
4 
5 lParam = (LPARAM)p;
6 wParam = (WPARAM)pi;
Parameters
pPointes 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.
piHandle 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 582 of file listview.h.

#define LVM_GETTOPVISIBLE   0xF131

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

1 LVM_GETTOPVISIBLE
2 
3 wParam = 0;
4 lParam = 0;
Returns
Returns the index of the topmost visible item if successful, or zero.

Definition at line 917 of file listview.h.

#define LVM_MODIFYHEAD   0xF11E

Changes the title of a column.

1 LVM_MODIFYHEAD
2 PLVCOLUMN pcol;
3 
4 wParam = 0;
5 lParam = (LPARAM)pcol;
Parameters
pcolPointer to a LVCOLUMN struct.
Returns
Returns LV_OKAY if successfull, or LV_ERR otherwise.

Definition at line 659 of file listview.h.

#define LVM_NULL   0xF132

reserved.

Definition at line 923 of file listview.h.

#define LVM_SELECTITEM   0xF11F

Selects an item.

1 LVM_SELECTITEM
2 int nRow;
3 HLVITEM pi;
4 
5 wParam = (WPARAM)nRow;
6 lParam = (LPARAM)pi;
Parameters
nRowIf pi is zero, nRow specified the row index of the target item to select.
piHandle of the target item.
Returns
Always returns 0.

Definition at line 679 of file listview.h.

#define LVM_SETCOLUMN   0xF122

Sets the attributes of a list view column.

1 LVM_SETCOLUMN
2 PLVCOLUMN pcol;
3 
4 wParam = 0;
5 lParam = (LPARAM)pcol;
Parameters
pcolPoints to a LVCOLUMN structure containing the new column information.
Returns
Returns LV_OKAY if successful, or LV_ERR otherwise.

Definition at line 742 of file listview.h.

#define LVM_SETCUSTOMDRAW   0xF143

Sets the customized drawing functions of listview.

1 LVM_SETCUSTOMDRAW
2 LVCUSTOMDRAWFUNCS myFuncs;
3 
4 wParam = (WPARAM)0;
5 lParam = (LPARAM)&myFuncs;
Parameters
myFuncsPointer to a customized drawing functions structure.
Returns
Always returns 0.

Definition at line 1179 of file listview.h.

#define LVM_SETHEADHEIGHT   0xF136

Changes the height of the header.

1 LVM_SETHEADHEIGHT
2 int height;
3 
4 wParam = (WPARAM)height;
5 lParam = 0;
Parameters
heightThe new height of the header.
Returns
Returns TRUE if successful, or FALSE otherwise.

Definition at line 1002 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.

1 LVM_SETITEMADDDATA
2 HLVITEM pi;
3 DWORD addData;
4 
5 wParam = (WPARAM)pi;
6 lParam = (LPARAM)addData;
Parameters
piHandle of the target item.
addDataThe 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 1055 of file listview.h.

#define LVM_SETITEMHEIGHT   0xF135

Changes the height of a item.

1 LVM_SETITEMHEIGHT
2 int height;
3 HLVITEM pi;
4 
5 wParam = (WPARAM)pi;
6 lParam = (LPARAM)height;
Parameters
heightThe new height of the item.
piHandle of the target item.
Returns
Returns TRUE if successful, or FALSE otherwise.

Definition at line 985 of file listview.h.

#define LVM_SETITEMSTATE   0xF133

reserved.

Definition at line 929 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.

1 static int my_strcmp (const char* s1, const char* s2, size_t n)
2 {
3  ...
4  return 0;
5 }
6 
7 LVM_SETSTRCMPFUNC
8 
9 wParam = 0;
10 lParam = (LPARAM) my_strcmp;
Parameters
my_strcmpYour own function to compare two strings.
Returns
One of the following values:
  • 0
    Success
  • -1
    Not an empty TreeView control

Definition at line 1106 of file listview.h.

#define LVM_SETSUBITEM   0xF124

Sets the attributes of a subitem.

1 LVM_SETSUBITEM
2 PLVSUBITEM p;
3 HLVITEM pi;
4 
5 lParam = (LPARAM)p;
6 wParam = (WPARAM)pi;
Parameters
pPointes 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.
piHandle 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 790 of file listview.h.

#define LVM_SETSUBITEMCOLOR   0xF117

Sets the text color of a subitem.

1 LVM_SETSUBITEMCOLOR
2 PLVSUBITEM p;
3 HLVITEM pi;
4 
5 lParam = (LPARAM)p;
6 wParam = (WPARAM)pi;
Parameters
pPointes 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.
piHandle 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 537 of file listview.h.

#define LVM_SETSUBITEMTEXT   0xF123

Sets the text of a subitem.

1 LVM_SETSUBITEMTEXT
2 PLVSUBITEM p;
3 HLVITEM pi;
4 
5 wParam = (WPARAM)pi;
6 lParam = (LPARAM)p;
Parameters
pPointes 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.
piHandle 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 766 of file listview.h.

#define LVM_SHOWITEM   0xF120

Makes the item is entirely visible in the list view.

1 LVM_SHOWITEM
2 int nRow;
3 HLVITEM pi;
4 
5 wParam = (WPARAM)nRow;
6 lParam = (LPARAM)pi;
Parameters
nRowIf pi is zero, nRow specified the row index of the target item to show.
piHandle of the target item.
Returns
Always returns 0.

Definition at line 700 of file listview.h.

#define LVM_SORTITEMS   0xF134

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

1 LVM_SORTITEMS
2 PLVSORTDATA sortData;
3 PFNLVCOMPARE pfnCompare;
4 
5 wParam = (WPARAM)sortData;
6 lParam = (LPARAM)pfnCompare;
Parameters
sortDataSorting datas passed to the comparision function.
pfnComparePointer 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 965 of file listview.h.