Arungeorge Posted June 15, 2020 Share Posted June 15, 2020 hi there First of all. let me say, i am new to autoit and have to finish a project in autoit for installing and uninstall softwares. Here, the issue is, i have a code that displays the currently installed softwares in a system and i could not add any checkboxes for selecting the apps. Could somebody help in doing this?? newOne.au3 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 15, 2020 Moderators Share Posted June 15, 2020 Moved to the appropriate forum. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
water Posted June 15, 2020 Share Posted June 15, 2020 Welcome to AutoIt and the forum! You could use or at least have a look at the Volatran project 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...
BigDaddyO Posted June 15, 2020 Share Posted June 15, 2020 Here is some sample to auto-create and cascade checkboxes as well as recognizing what is checked. It's all about the 2D array that you will need to generate. expandcollapse popup;generate a cascade of checkboxes Opt("GUIOnEventMode", 1) ;Use Event mode to call functions directly #include <GUIConstantsEx.au3> ;This array will need to be generated by your code ;[][0] is reserved for the handle auto-generated in the loop that creates the checkboxes ;[][1] is the text you want displayed in the GUI ;[][2]+ These can be anything else you want/need. Path, Install commands, whatever else you need Global $aApplications[][] = [[0, "Application Name 1", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 2", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 3", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 4", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 5", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 6", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 7", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 8", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 9", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 10", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 11", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 12", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 13", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 14", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 15", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 16", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 17", "Application Install/Uninstall Path or whatever else you need to remember"], _ [0, "Application Name 18", "Application Install/Uninstall Path or whatever else you need to remember"]] $iGuiW = 920 $iGuiH = 680 $hGUI = GUICreate(">SAMPLE<", $iGuiW, $iGuiH) GUISetOnEvent($GUI_EVENT_CLOSE, "_ExitApp") $iChkX = 40 $iChkY = 175 For $a = 0 to UBound($aApplications) - 1 $iChkY += 25 ;Every 15 checkboxes move over to the next column If $a > 0 and Mod($a, 15) = 0 Then $iChkX += 220 ;Move over to the next column $iChkY = 200 ;Reset the Y back to the top of the list EndIf $aApplications[$a][0] = GUICtrlCreateCheckbox($aApplications[$a][1], $iChkX, $iChkY, 200, 20) ;This is used to set the font to RED if there is a problem, like you found an app but [][2] is empty so you cant uninstall it! ;DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0) ;GUICtrlSetColor($aFunctionsAppSupt[$a][0], $COLOR_RED) Next GUICtrlCreateButton("Start", 40, $iGuiH - 40, 120, 20) GUICtrlSetOnEvent(-1, "_Start") GUISetState(@SW_SHOW, $hGUI) While 1 ;Loop waiting for the user to click something. sleep(100) WEnd Func _Start() $sChecked = "" ;Scan each of the checkboxes to see if they are checked or not For $t = 0 to UBound($aApplications) - 1 if BitAND(GUICtrlRead($aApplications[$t][0]), $GUI_CHECKED) = $GUI_CHECKED Then $sChecked &= $aApplications[$t][1] & @CRLF EndIf Next MsgBox(0, "Checked", $sChecked) EndFunc Func _ExitApp() Exit EndFunc 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