Nine Posted March 2, 2021 Share Posted March 2, 2021 (edited) I made this because I wanted a specific behavior when selecting multiple folders at once. With this UDF, you select the folders you want by checking the TreeView checkbox of each folder. Automatically, it will show in the selection ListBox at the right of the TreeView. If you uncheck the folder, it will be removed from the ListBox. By selecting (highlighting) a folder, a list of the files included in that specific folder will replace the selection ListBox. If you check/uncheck a folder, the selection ListBox will reappear. I also needed a Root Selector that enables Drives and Network (UNC) selection that can serve to start the Multiple Folders Selector. This is practical if you need to select a large number of folders from a specific part of the tree. Be careful though when selecting a Root that includes hundreds of subfolders. Selecting C:\ as a root can take quite some time to be shown. Version 2024-05-01 * Added support for horizontal scrollbars in folders and files list boxes when appropriate Version 2021-03-04 * Added optional list of folders to be pre-checked (must be full path name and 0-based) Here a simple example : #include <Array.au3> #include "MultiFoldersSelectorUDF.au3" ; Select root folder and return all chosen folders Local $sSelectedRoot = _MFS_SelectRootFolder() If @error Then Exit Local $aListFolder = _MFS_SelectMultipleFolders($sSelectedRoot) If Not @error Then _ArrayDisplay($aListFolder) ; Pre-check all folders starting with "Aut" in AutoIt3 root folder and returns new checked/unchecked list of folders Local $aPreChecked = _FileListToArrayRec(@ProgramFilesDir & "\AutoIt3", "Aut*", $FLTAR_FOLDERS, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_FULLPATH) _ArrayDelete($aPreChecked, 0) $aListFolder = _MFS_SelectMultipleFolders(@ProgramFilesDir & "\AutoIt3", $aPreChecked) If Not @error Then _ArrayDisplay($aListFolder) Let me know if you find it useful. MultiFoldersSelectorUDF.au3 Edited May 1 by Nine mike1950r 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nine Posted March 4, 2021 Author Share Posted March 4, 2021 New version available “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
mike1950r Posted May 1 Share Posted May 1 Hi Nine, thanks for this library. BTW the listbox does not enable scrollbars if necessary ? Have not found a solution so far. Cheers mike Link to comment Share on other sites More sharing options...
Nine Posted May 1 Author Share Posted May 1 (edited) @mike1950r You must mean horizontal scrollbar ? Because vertical scrollbar are automatically enabled. You must also mean in folder list, right ? ps. if you meant horizontal, you are right, they do not appear automatically, I will review the code accordingly. Thanks. Good catch. Edited May 1 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nine Posted May 1 Author Share Posted May 1 New version available “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
mike1950r Posted May 1 Share Posted May 1 29 minutes ago, Nine said: @mike1950r You must mean horizontal scrollbar ? Because vertical scrollbar are automatically enabled. You must also mean in folder list, right ? ps. if you meant horizontal, you are right, they do not appear automatically, I will review the code accordingly. Thanks. Good catch. Hi Nine, this is exactly what mean: folder view and horizontal. I see you have new version. Will download and check. Thanks Cheers mike Link to comment Share on other sites More sharing options...
mike1950r Posted May 2 Share Posted May 2 Hi Nine, this works now fine activating horizontal scrollbar. I find it difficult to size the listbox same as the treeview. Is there a reason for that? _GUICtrlTreeView_Create($hGUI, 30, 50, 320, 396 _GUICtrlListBox_Create($hGUI, "", 370, 50, 360, 421 The last values ( height) should be same, but they are 396 and 421 to get them looking same height. Even the second value (top) is a bit different. In my case I had to mount this value for listbox higher by 1. Ofcourse this is not a question of your library. This is caused by GuiTreeView.au3 and GuiListBox.au3. Do you know, why this is? Cheers mike Link to comment Share on other sites More sharing options...
Nine Posted May 2 Author Share Posted May 2 Glad it now works. I remember struggling with the size of the boxes. I first thought it was an UDF problem, but it is not. Both (TV and LB) use the same method to create the control (CreateWindowEX). So it is Windows making a different decision based on the class of the object. I felt, at the time, that both classes do not treat horizontal scrollbar the same way. But never got to test it to find if my impression was right or wrong. 41 minutes ago, mike1950r said: Even the second value (top) is a bit different. In my case I had to mount this value for listbox higher by 1. I don't have that issue on my side. They are perfectly aligned. (Win10). I did check it in Ms-Paint to make sure... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
mike1950r Posted May 2 Share Posted May 2 The (top), which does not make problem on yours, is because I use other dimensions here. The only solution was to check and check and try until it fits. Cheers mike Link to comment Share on other sites More sharing options...
mike1950r Posted May 13 Share Posted May 13 (edited) Hi Nine, works all exellent. Cheers mike Edited May 13 by mike1950r 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