ListView property for "Rows of Height"?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SAbboushi
Posts: 252
Joined: 08 Dec 2014, 22:13

ListView property for "Rows of Height"?

15 Dec 2018, 17:30

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...
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: ListView property for "Rows of Height"?

16 Dec 2018, 04:12

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
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
just me
Posts: 9451
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: ListView property for "Rows of Height"?

16 Dec 2018, 04:26

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")

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 220 guests