mihaibr Posted November 12, 2012 Share Posted November 12, 2012 Hi,How can I verify if a listbox (with checkable items),has checked items?The listbox is not in my application (is in a external application).I want to find out what item is checked, and if it's possible ,how to check items(from the same listbox)The listbox looks like this:And here is the Summary from Autoit Windows Info:>>>> Control <<<<Class: ThunderRT6ListBoxInstance: 1ClassnameNN: ThunderRT6ListBox1Name:Advanced (Class): [CLASS:ThunderRT6ListBox; INSTANCE:1]ID: 6Text:Position: 127, 47Size: 97, 94ControlClick Coords: 27, 47Style: 0x540100D9ExStyle: 0x00000204Handle: 0x000104E2Please excuse my poor/bad English Link to comment Share on other sites More sharing options...
mihaibr Posted November 12, 2012 Author Share Posted November 12, 2012 Oups, _GUICtrlListBox_GetSel was doing this, sorry for this topic Link to comment Share on other sites More sharing options...
incepator Posted November 12, 2012 Share Posted November 12, 2012 Exemple: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 106, 110, 192, 114) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 8, 8, 97, 17) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 8, 24, 97, 17) $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 8, 40, 97, 17) $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 8, 56, 97, 17) $Button1 = GUICtrlCreateButton("Button1", 16, 80, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $text = "" If GUICtrlRead($Checkbox1) = "1" Then $text = $text & "Checkbox1 " EndIf If GUICtrlRead($Checkbox2) = "1" Then $text = $text & "Checkbox2 " EndIf If GUICtrlRead($Checkbox3) = "1" Then $text = $text & "Checkbox3 " EndIf If GUICtrlRead($Checkbox4) = "1" Then $text = $text & "Checkbox4 " EndIf MsgBox(0,"",$text) EndSwitch WEnd Link to comment Share on other sites More sharing options...
water Posted November 12, 2012 Share Posted November 12, 2012 @incepator, the OP is talking about a non AutoIt application. Your approach doesn't work then. Best bet is _GUICtrlListBox_GetSel. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
mihaibr Posted November 12, 2012 Author Share Posted November 12, 2012 (edited) @incepator,You totally missed the topic subject. I made a simple exemple(if someone need this) #include <GuiListBox.au3> $hlist=ControlGetHandle("SURSA","","[ID:1]");Replace with your appname,and with the control ID $iCount=_GUICtrlListBox_GetCount($hlist) For $i=0 To $iCount-1 MsgBox(0,"Item " & $i & " status",_GUICtrlListBox_GetSel($hlist,$i)) Next Edited November 12, 2012 by mihaibr Link to comment Share on other sites More sharing options...
incepator Posted November 12, 2012 Share Posted November 12, 2012 ooo yes, I apologize` I was not paying attention to details 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