Chris_1013 0 Posted January 5, 2005 As the title says, is there a way to do this? I want to loop through all instances in a ListBox, which I can select using ControlCommand("title","text",controlID,SetCurrentSelection",occurrence) but I don't know how to find out how many entries are in the list box to know how many I need to loop through. Is this do-able? Chris Share this post Link to post Share on other sites
this-is-me 6 Posted January 5, 2005 You can use sendmessage with dllcall to find the total amount of items. $LB_GETCOUNT = 0x18B $hwnd = ControlGetHandle("Advanced TCP/IP Settings", "", "ListBox1") $ret = DllCall("user32.dll", "int", "SendMessage", "hWnd", $hwnd, "int", $LB_GETCOUNT, "int", 0, "int", 0) $items = $ret[0] Who else would I be? Share this post Link to post Share on other sites
Chris_1013 0 Posted January 5, 2005 (edited) Good 'ol DLLCall, was sure someone would know what to do... As an aside, does anyone know why whenever I get an e-mail from a topic I've subscribed to on the forum that contains a code sample it contains loads of "(", """ and the likes in it - tried to post an example, but it doesn't display them! Edited January 5, 2005 by Chris_1013 Share this post Link to post Share on other sites