Page 1 of 1

ListView property for "Rows of Height"?

Posted: 15 Dec 2018, 17:30
by SAbboushi
Not finding anything in AHK forum/AHK documentation or Windows API: Is there a way to determine how many rows of height a ListView is configured for? e.g.

Code: Select all

LV := Gui.Add("ListView", "r20 w700", "Name|Size (KB)")
Is there a property that will tell me that 20 rows will fit in the Listview ("r20")? Or some other way to get this programatically?

I found this link, but not being a c# programmer (and with the contradictory positions in the post), I'm not sure if the answer is in there...

Re: ListView property for "Rows of Height"?

Posted: 16 Dec 2018, 04:12
by gwarble
Try a creative use of:
https://autohotkey.com/boards/viewtopic.php?f=7&t=42570
Something like:
Get height of listview for an estimate, start with that estimate, get approximate rect, and compare

Increase or decrease that estimate and try again as needed

Re: ListView property for "Rows of Height"?

Posted: 16 Dec 2018, 04:26
by just me
Maybe (for report view):

Code: Select all

; LVM_GETCOUNTPERPAGE -> docs.microsoft.com/en-us/windows/desktop/Controls/lvm-getcountperpage
MaxVisibleRows := DllCall("SendMessage", "Ptr", LV.Hwnd, "UInt", 0x1028, "Ptr", 0, "Ptr", 0, "Ptr")