WildByDesign Posted December 9 Posted December 9 (edited) I would like to introduce Files Au3 as a project that anyone here in the community can help to improve. The name "Files Au3" can potentially change if anyone has a better idea for the name. At the moment, it is a bare bones file viewer. It uses the TreeListExplorer by @Kanashius which has a lot of callback options to extend the functionality further. Note: This uses a separate header control together with a ListView (with no LV header) to get around the AutoIt bug #1492 which causes problems between WS_EX_COMPOSITED and ListView headers due to AutoIt using CS_OWNDC for GUI's despite Microsoft's guidance against using CS_OWNDC. Although I understand that there were reasons for this and it was a decision made likely 15-20 years ago. The Files Au3 GUI will automatically use dark or light mode depending on Windows theme settings. You can force light mode by uncommenting the following: ; testing light mode ;$isDarkMode = False TO DO: Header still needs subclassing for the text color in dark mode (DONE) There is a LV header subclassing example by @UEZ in SampleControls.au3 in Dark Mode There is also a LV header subclassing example by @jpm over in this post in the DarkMode UDF thread Both are for ListView header and I don't know how to convert to standard header control only for subclassing Complete functions for Back, Forward, Up and Refresh buttons (DONE) The TreeListExplorer UDF has a function for Refresh: __TreeListExplorer_Reload() Complete menu bar functions (W.I.P.) Add a status bar Access File Properties Eventually subclass the menu bar for dark mode (and get rid of ModernMenuRaw UDF) Lots more... Then the question is, should we get into actual file management? Use callback features of the UDF UDF may need to be extended to multiple selection? File/folder copy/move/delete/etc. Should file operations been done multi-process for performance etc. Anyway, I don't know how far this will go but I'm just throwing it out there. If anyone wants to contribute, maybe we should just let each other know what part we are working on so that we don't have two people working on the same thing. FilesAu3-2025-12-25.zip FilesAu3-2025-12-26.zip FilesAu3-2025-12-26-r1.zip Edited Saturday at 12:07 AM by WildByDesign 2025-12-26-r1 Kanashius, pixelsearch and ioa747 3
WildByDesign Posted December 9 Author Posted December 9 I just realized that I forgot to dock the controls to the edges for resizing. That explains some of the problems that I noticed. 🤦♂️
Kanashius Posted December 9 Posted December 9 (edited) Hi, I like the project you are doing here. Especially with the work to make the GUI adapting to the system settings (light/dark theme and dpi,...). To contribute a little bit, I looked into the part interacting with my UDF and implemented the Back, Forward, Up and Refresh buttons. To do this I created a History UDF to handle a history of opened folders. I will include all added/changed files in the zip file. I hope this helpes a little bit FilesAu3-ChangedFiles.zip Edited December 9 by Kanashius argumentum, ioa747 and WildByDesign 3 My Website: Kanashius Webside (Some of my Programs you can find there)
WildByDesign Posted December 9 Author Posted December 9 7 hours ago, Kanashius said: I like the project you are doing here. Especially with the work to make the GUI adapting to the system settings (light/dark theme and dpi,...). Thank you, I appreciate it. I've always wanted to make something like this ever since I first came across your original UDF. But I kept shying away from starting this project because it is potentially a lot of work. I just decided it would make sense to open it up for anyone to work on and just do it bit by bit and see what happens. 7 hours ago, Kanashius said: To contribute a little bit, I looked into the part interacting with my UDF and implemented the Back, Forward, Up and Refresh buttons. To do this I created a History UDF to handle a history of opened folders. The addition of the History UDF is fantastic. I tested all buttons in their respective scenarios and everything worked perfectly. Although it did make me realize that I need to make some changes to the custom button disabled state colors. 7 hours ago, Kanashius said: I hope this helpes a little bit It doesn't just help a little bit. This was crucial, important functionality and, as always, you did an incredible job. Thank you. Kanashius 1
WildByDesign Posted December 9 Author Posted December 9 (edited) I've thought about putting this on Github to potentially make it easier for any of us to contribute. But I also realize that many people in this forum don't use Github. So maybe for now we can just share updates here as we go. Anyway, sometime today I will: Add the History UDF and other changes from @Kanashius Update disabled state colors for custom buttons Use GUICtrlSetResizing() to dock the controls so that they don't move when resizing or moving separator Put up a new release with those changes Edited December 9 by WildByDesign
WildByDesign Posted December 9 Author Posted December 9 @pixelsearch I'm having an issue in Files Au3 that carries over from the Need help synchronizing MDI (WS_EX_MDICHILD) window with Child Window (WS_CHILD) thread that I don't fully understand. It is related to the reordering of columns when dragging header items. The following line: _resizeHeaderItems() ; avoid a bad behavior if header item on the left is dropped elsewhere when horizontal scrollbar had been moved. For some reason, it seems to cause the header items to not line up perfectly with the listview columns. Everything moves correctly but the measurements are off by a few pixels. If I comment out that line, when I drag the headers, the measurements end up correct. But, clearly that line serves a purpose. If you have a moment, could you please have a look and see why the _resizeHeaderItems() is not calculating correctly? Thank you.
pixelsearch Posted December 9 Posted December 9 (edited) @WildByDesign to not pollute this thread, I'm about to upload an improved version concerning the horizontal scrolling / header resizing / cols reordering, in your other thread, this post. A button "Infos" has been added, it allows to display anytime in the console infos concerning the actual position & rectangle size of all headers & columns. Hope it helps. Edited December 9 by pixelsearch WildByDesign 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
WildByDesign Posted December 10 Author Posted December 10 (edited) I've updated the Files Au3 script files in the first post. I made a mistake in the date format on the first release naming of the zip archive. I went YYYY-DD-MM on that first release but I've switched it to YYYY-MM-DD to be more consistent. FilesAu3-2025-12-10: Added History UDF and all button changes from @Kanashius Added column resizing improvements from @pixelsearch Updated the custom button colors for the various states for both dark and light modes Used GUICtrlSetResizing() to dock all of the controls for what made the most sense Improved spacing and alignment of buttons Improved width and alignment of Input control Input control now uses slick new Windows dark mode (DarkMode_DarkTheme) if OS is 26100.6899/26200.6899 or newer If OS is older, it falls back to using the original dark mode (DarkMode_Explorer) I would like to make it so that when we click on the Input box that it selects the entire text (path) just as it does with any file manager or browser URL bar. I can do that with WM_COMMAND quite easily but I think that it will conflict with the GUIFrame UDF since it uses WM_COMMAND as well. Edited December 10 by WildByDesign
WildByDesign Posted December 11 Author Posted December 11 Everything with the GUI is starting to look really nice now in both dark and light modes. GUI functionality has improved quite a bit as well. FilesAu3-2025-12-11: Dark mode Header control is subclassed now for proper text color (thanks to @ioa747) Tooltips added for all buttons Improved light mode colors Clicking on the path Input box will select all text now inside the control Similar to any file manager or browser URL bar ioa747 1
WildByDesign Posted December 11 Author Posted December 11 (edited) I really need someone to help me test this, please. There is a weird bug (in FilesAu3-2025-12-11-r1) where anytime I double-click on a JPG image in the ListView, it opens the image as expected but has a bug where it triggers the _About function and loads the About dialog anytime you double-click on a JPG. It doesn't seem to have this bug with any other file types or even other image types. My mind is boggled! 🙃 2025-12-11 rev. 1: Made 'Exit' and 'About' items in menubar functional Added 'View' to menubar but is not functional yet I would like to add the ability to switch between dark and light modes Added file opening/execution on double-click in ListView Follows Windows defaults per file extension Edited December 11 by WildByDesign
ioa747 Posted December 11 Posted December 11 (edited) I don't notice anything like that, when I tried it, it behaves normally However, I have noticed that if I close it from the tray menu, while the gui is closing, the script sometimes continues to run in the background. So I am wondering if there is something already running in the background that is interfering with you? Edited December 11 by ioa747 I know that I know nothing
WildByDesign Posted December 11 Author Posted December 11 3 hours ago, ioa747 said: I don't notice anything like that, when I tried it, it behaves normally It's such a strange thing because it would have to mean that something is sending the GUI Msg for the $idAboutItem control ID. It doesn't even make sense to me how that could happen in this situation. Something about opening JPG files only would somehow be sending that control ID. I'll have to dig into it some more. 3 hours ago, ioa747 said: However, I have noticed that if I close it from the tray menu, while the gui is closing, the script sometimes continues to run in the background. Thanks for letting me know. I can confirm the same issue when exiting from the tray icon. I will probably end up disabling the tray icon at some point, but I've got a fix for now. OnAutoItExitRegister(_CleanExit) Func _CleanExit() __TreeListExplorer_Shutdown() _GUICtrlListView_UnRegisterSortCallBack($g_hListview) _GUICtrlHeader_Destroy($g_hHeader) GUIDelete($g_hGUI) EndFunc I will add that in the next release. 3 hours ago, ioa747 said: So I am wondering if there is something already running in the background that is interfering with you? I just rebooted Windows and ran the script without anything else running and it still seems to open the About dialog msgbox anytime I open a JPG. It seems to happen whether I run the script from double-clicking or from VSCode. Seems to happen in dark mode and light. ioa747 1
ioa747 Posted December 11 Posted December 11 (edited) 1 hour ago, WildByDesign said: ... it would have to mean that something is sending the GUI Msg ... Seems to happen in dark mode and light. Spoiler Since you say that it happens in both dark and light mode. It means it's not in. If $isDarkMode Then GUIRegisterMsg($WM_NCPAINT, "WM_NCPAINT") GUIRegisterMsg($WM_ACTIVATE, "WM_ACTIVATE_Handler") EndIf then there are the GUIRegisterMsg($WM_COMMAND, "WM_COMMAND2") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY2") turn it off alternately to see what (where) happens then try to put #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 and do a more strict check because there are many warnings Good luck Edit: these are common and both are not needed ; custom buttons Global Const $tagNMCUSTOMDRAWINFO = $tagNMHDR & ";dword DrawStage;handle hdc;" & $tagRECT & ";dword_ptr ItemSpec;uint ItemState;lparam lItemParam;" If $isDarkMode Then ; Structure Definitions (using $tagNMHDR and $tagRECT which are defined in includes) Global Const $tagNMCUSTOMDRAW = $tagNMHDR & ";dword DrawStage;handle hdc;" & $tagRECT & ";dword_ptr ItemSpec;uint ItemState;lparam lItemParam;" EndIf one statement would be enough ; Structure Definitions (using $tagNMHDR and $tagRECT which are defined in includes) Global Const $tagNMCUSTOMDRAW = $tagNMHDR & ";dword DrawStage;handle hdc;" & $tagRECT & ";dword_ptr ItemSpec;uint ItemState;lparam lItemParam;" and replace $tagNMCUSTOMDRAWINFO with $tagNMCUSTOMDRAW in the script Edited December 11 by ioa747 Edit: argumentum 1 I know that I know nothing
WildByDesign Posted December 11 Author Posted December 11 (edited) 1 hour ago, ioa747 said: turn it off alternately to see what (where) happens Those were all very helpful troubleshooting ideas. Thank you. It ended up being: ; Register the $WM_SIZE handler to permit resizing _GUIFrame_ResizeReg() I will have to try to figure out how to fix that because it's really important. 1 hour ago, ioa747 said: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Wow that was really eye-opening. I had never seen so many warning before. I will see what I can do to fix these as well. 1 hour ago, ioa747 said: with $tagNMCUSTOMDRAW in the script Done. Thanks. I will have this in the next release. EDIT: I just checked and I'm not using WM_SIZE anywhere else. Edited December 11 by WildByDesign ioa747 1
WildByDesign Posted December 12 Author Posted December 12 @ioa747 I tried switching the OnEvent mode and a variety of other things. It seemed that any new controls that I created would get triggered and the functions would run. Clicking on certain things in the ListView would call GUI Msg 13 and 14 and those belonged to the menu items. Solution? Well, good old @LarsJ code to the rescue. So I thought, well what if I had some control over the control ID's. I did some brief searching in the forum and found: ; LarsJ For $i = 3 To 1000 ; First Control ID = 3 GUICtrlCreateDummy() ; This allocates Control IDs from 3 to 1000 Next ; The next control will get ID = 1001 So I put that right after GUICreate() and the problem is solved! All control ID's start after 1000 and I don't foresee any issues because Files Au3 likely wont have very many controls. Does this seem reasonable?
ioa747 Posted December 12 Posted December 12 (edited) Spoiler from what you say I concluded that the problem is located in TreeListExplorer.au3 at lines 998, 1011 in the command Local $iIndex = _GUICtrlListView_AddItem($hView, $arFiles[$i], $iIconIndex, $iIconIndex) ; ⚠️ 👈 because according to the manual (in '_GUICtrlListView_AddItem ') it states "As AutoIt uses the $iParam parameter to store the controlID of native-created ListView items, this value should be set sufficiently high for UDF-created items to avoid possible conflict with any existing controls - a starting value of 1000 is recommended." so this could be solved by setting an Offset in $iParam e.g. Local $iIndex = _GUICtrlListView_AddItem($hView, $arFiles[$i], $iIconIndex, $iIconIndex + 1000) ; ⚠️ 👈 and accordingly remove it when you use it although I couldn't find where $iParam is used, so I just did it Local $iIndex = _GUICtrlListView_AddItem($hView, $arFiles[$i], $iIconIndex, 0) ; ⚠️ 👈 to test it, and I didn't notice any difference it certainly didn't cause any problems for me to begin with, so I can't check if the original problem was fixed, nor did I research it in depth, just sharing my thoughts 9 hours ago, WildByDesign said: Does this seem reasonable? Now to what you're asking , I would say yes since the folder you're about to open has less than 1000 items (I thing) Edited December 12 by ioa747 pixelsearch, WildByDesign and Kanashius 3 I know that I know nothing
WildByDesign Posted December 12 Author Posted December 12 (edited) @ioa747 Thank you. That is some great detective work. It makes sense why I was always getting the same results. I was always reproducing it by checking my Downloads folder and that number of files and the order that they are in would have stayed the same each time. The icon index makes sense because it would trigger on any JPG image. I made another control after that and it triggered on any ZIP archive. 3 hours ago, ioa747 said: I would say yes since the folder you're about to open has less than 1000 items (I thing) Now I'm not too sure about this. It might be best to get the UDF author to have a look into it. If a user did have more than 1000 files in a folder, that could potentially be a problem. @Kanashius If you have some time, could you please look into what @ioa747 wrote in the hidden comment above? Thank you. I'm just not sure about making that change myself because I don't know what the consequences could be elsewhere in the UDF. EDIT: I should point out that this only occurs in combination with the _GUIFrame_ResizeReg() function from GUIFrame UDF which uses it's _GUIFrame_SIZE_Handler() to handle the WM_SIZE message. If I disable the GUIFrame resizing, the issue does not occur. So I don't quite understand the conflict between _GUIFrame_SIZE_Handler and TreeView UDF's ListView filling. But that does seem to be where that issue occurs. Edited December 12 by WildByDesign ioa747 1
WildByDesign Posted December 12 Author Posted December 12 (edited) Great news! After many months, I finally figured out how to do dark mode statusbar without using the trick to remove the theme and without owner drawing the statusbar. I will upload another release soon with the glorious dark mode statusbar (for those using dark mode, of course). Edited December 12 by WildByDesign
WildByDesign Posted December 12 Author Posted December 12 FilesAu3-2025-12-12: Added statusbar Clicking on a file in ListView will update statusbar with file size More statusbar work to be done Performance improvements in most subclassing functions and ListView/header resizing Smoother GUI overall There's likely more that I've forgotten. Just trying to get this out before I head out.
Kanashius Posted December 12 Posted December 12 (edited) Hey, I agree with @ioa747s findings and fixed the bug in the UDF. Thanks for finding that I did not use the $iParam anywhere, do not now why I even set it, so I removed it. The fixed version is in the UDF-Thread: Edited December 12 by Kanashius WildByDesign and ioa747 1 1 My Website: Kanashius Webside (Some of my Programs you can find there)
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