LV_EX_GetItemParam()
. i.e. "a7a04166-ea26-11e6-8a43-0225b501000d"[LIB] LV_EX - update on 2016-04-28
Re: [LIB] LV_EX - update on 2016-04-28
What kind of data can be stored in the item's lParam? I am attempting to store a GUID and am not receiving the same string back when calling
Re: [LIB] LV_EX - update on 2016-04-28
lParam will accept pointer-sized numeric values. If you want to use it for strings, store a pointer to the string.
Re: [LIB] LV_EX - update on 2016-04-28
Ok, I figured it out. I had been storing the address to the string correctly but was neglecting to use StrGet to retrieve the actual string stored at that address after retrieving the item's lParam.
EDIT:
So in my instance, I am populating the ListView using an Object containing support ticket information. Is there a way to store the address of a particular field in that object? Unforunately, I used a temp variable for storing the GUID and then assigning the address of that temp variable to the lParam so it get's overwritten for each row that is added. The below didn't work
EDIT:
So in my instance, I am populating the ListView using an Object containing support ticket information. Is there a way to store the address of a particular field in that object? Unforunately, I used a temp variable for storing the GUID and then assigning the address of that temp variable to the lParam so it get's overwritten for each row that is added. The below didn't work
Code: [Select all] [Download] GeSHi © Codebox Plus
for ticket in oIMTickets[queue] {
currTicket := oIMTickets[queue][ticket]
currRow := LV_Add("", currTicket["processid"], currTicket["incidentname"])
LV_EX_SetItemParam(IMLV_LView, currRow, &currTicket["sessionid"])
LV_EX_SetGroup(IMLV_LView, currRow, groupNum)
}
Re: [LIB] LV_EX - update on 2016-04-28
Code: [Select all] [Download] GeSHi © Codebox Plus
LV_EX_SetItemParam(IMLV_LView, currRow, currTicket.GetAddress("sessionid"))
Re: [LIB] LV_EX - update on 2016-04-28
Ah, I was looking at the documentation and only looked at Objects. Didn't realize the subitems had their own pages. Thanks!
-
- Posts: 2
- Joined: 08 Apr 2017, 19:03
Re: [LIB] LV_EX - update on 2016-04-28
Hello! I have a listview like this one:
Col1|Col2
1234|AAA
9655|CCC
2564|AAA
4456|BBB
4556|AAA
7889|CCC
I would liek to group them by all distinct values in col2, like this: (note i want to display the full value as group header - AAA, not just alphabeticly - A )
Col1|Col2
AAA-------------
1234|AAA
2564|AAA
4556|AAA
BBB--------------
4456|BBB
CCC-------------
9655|CCC
7889|CCC
I only saw examples of grouping by row number and not by values. Can you point me to the right approach? I am guessing i should have a mechanism that loops trough the given column, extracts all distinct values and then check if which cell belongs to which value and group accordingly? Btw a function that accepts column number as parameter and automaticly clears all groupings,and then groups the listview by all values inside a column sounds super awesome and useful.
Thanks for sharing the amazing work !
Col1|Col2
1234|AAA
9655|CCC
2564|AAA
4456|BBB
4556|AAA
7889|CCC
I would liek to group them by all distinct values in col2, like this: (note i want to display the full value as group header - AAA, not just alphabeticly - A )
Col1|Col2
AAA-------------
1234|AAA
2564|AAA
4556|AAA
BBB--------------
4456|BBB
CCC-------------
9655|CCC
7889|CCC
I only saw examples of grouping by row number and not by values. Can you point me to the right approach? I am guessing i should have a mechanism that loops trough the given column, extracts all distinct values and then check if which cell belongs to which value and group accordingly? Btw a function that accepts column number as parameter and automaticly clears all groupings,and then groups the listview by all values inside a column sounds super awesome and useful.
Thanks for sharing the amazing work !
Re: [LIB] LV_EX - update on 2016-04-28
You cannot assign a row to a group 'by value'. You might pull the values you want to use as group headers from the contents, add the groups, and assign the related rows by row number.
-
- Posts: 61
- Joined: 18 May 2017, 10:56
Re: [LIB] LV_EX - update on 2016-04-28
Can you give an example of
LV_EX_FindString
function? I could not figure out how to use it to filter the rows. Also how to update the data after adding new rows?Re: [LIB] LV_EX - update on 2016-04-28
Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus
; ======================================================================================================================
; LV_EX_FindString - Searches the first column for an item containing the specified string.
; ======================================================================================================================
LV_EX_FindString(HLV, Str, Start := 0, Partial := False) {
; LVM_FINDITEM -> http://msdn.microsoft.com/en-us/library/bb774903(v=vs.85).aspx
Static LVM_FINDITEM := A_IsUnicode ? 0x1053 : 0x100D ; LVM_FINDITEMW : LVM_FINDITEMA
Static LVFISize := 40
VarSetCapacity(LVFI, LVFISize, 0) ; LVFINDINFO
Flags := 0x0002 ; LVFI_STRING
If (Partial)
Flags |= 0x0008 ; LVFI_PARTIAL
NumPut(Flags, LVFI, 0, "UInt")
NumPut(&Str, LVFI, A_PtrSize, "Ptr")
SendMessage, % LVM_FINDITEM, % (Start - 1), % &LVFI, , % "ahk_id " . HLV
Return (ErrorLevel > 0x7FFFFFFF ? 0 : ErrorLevel + 1)
}
Parameters:
- Str
The string to search for. - Start
The number of the row to begin the search with or 0 to start from the beginning. The specified row is itself excluded from the search. - Partial
If False (default), the function searches for an exact match. Otherwise, the function will check if the item text begins with the string to return a match.
- Returns the number of the row if a match was found, or 0 otherwise.
Return to “Scripts and Functions”
Who is online
Users browsing this forum: No registered users and 21 guests