Chris_1013 Posted January 5, 2005 Share 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 Link to comment Share on other sites More sharing options...
this-is-me Posted January 5, 2005 Share 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? Link to comment Share on other sites More sharing options...
Chris_1013 Posted January 5, 2005 Author Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now