Hi, i want to speed up the process wich add items to a listview control.
If someone have some code about that ( i think using APIs is faster than the own methods of the control )
thank you in advance
Printable View
Hi, i want to speed up the process wich add items to a listview control.
If someone have some code about that ( i think using APIs is faster than the own methods of the control )
thank you in advance
I've been thru MSDN and the listview documentation. There are no APIs to add items; the listview control was designed for use with COM, so it doesn't support APIs.
Are you sure ?
I know that using SendMessage with the parameter LVW_ADDITEM , and with special structure LVW_ITEM , we can poblat ethe listview.
BUT I WANT A LITTLE EXAMPLE PLEASE, BECAUSE I DON´T KNOW WHAT I´M DOING WRONG
bye
Well I played around with this for 10mins and got this far. There is little to no info on the web that I could find for a VB implementation.
Well try this. If you get it to work properly, please send me an email [email protected].
VB Code:
Option Explicit Private Type LV_ITEM mask As Long iItem As Long iSubItem As Long state As Long stateMask As Long pszText As String cchTextMax As Long iImage As Long lParam As Long iIndent As Long End Type Private Declare Function SendMessage Lib "User32" _ Alias "SendMessageA" _ (ByVal hWnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ lParam As Any) As Long Const LVIF_TEXT = &H1 Const LVM_FIRST = &H1000 Const LVM_INSERTITEMA = (LVM_FIRST + 7) Private Sub Form_Load() Dim LV As LV_ITEM LV.mask = LVIF_TEXT LV.iItem = 0 LV.pszText = "test" Call SendMessage(ListView1.hWnd, LVM_INSERTITEMA, 0&, LV) End Sub