Listbox Total Count Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
lp230889
Posts: 16
Joined: 06 May 2016, 05:49

Listbox Total Count

19 Jan 2018, 18:29

I need help getting the total count of the items in a Listbox.
For some reason sometimes this code returns the correct number, other times returns nothing.

Code: Select all

NodeCount() 
{
	ControlGet, List, List,  ,ListBox1,
	loop, parse, list, `n, `r
	b_index:=a_index
	return % b_index
}
User avatar
Alguimist
Posts: 428
Joined: 05 Oct 2015, 16:41
Contact:

Re: Listbox Total Count  Topic is solved

19 Jan 2018, 19:13

For ControlGet you have to specify the window title:

Code: Select all

ControlGet, List, List,, ListBox1, Window Title Here
The count of items in a ListBox can also be obtained with:

Code: Select all

SendMessage 0x18B, 0, 0, ListBox1, Window Title ; LB_GETCOUNT
Count := ErrorLevel
lp230889
Posts: 16
Joined: 06 May 2016, 05:49

Re: Listbox Total Count

19 Jan 2018, 19:38

Thanks,
first one worked as soon as i put the script title.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750 and 380 guests