Leaderboard
Popular Content
Showing content with the highest reputation on 03/18/2025 in all areas
-
VBScript is deprecated in Windows 11 and Windows 10
argumentum and one other reacted to jchd for a topic
For those who need an AU3-only solution for decoding entities: HTMLentities.au32 points -
FileExplorer Treeview and Listview (TreeListExplorer)
WildByDesign and one other reacted to Kanashius for a topic
I did not use Github, because I didn't think it would get that many changes, to be honest I did some commits with some versions I still had as BackUp and added everything to Github (link in the main post). So you can see at least most of the Versions differences2 points -
I have been creating few controls with round corners for awhile for my own needs and I felt it was time to make an UDF and share it with the community. The idea behind this UDF is to use essentially simple basic AutoIt GUI functions. I did not want to embark in GDI+ to create the controls. I wanted to be easy to use with enough features that it would answer most requirements. The functions contained in the UDF : _RGUI_RoundLabel _RGUI_RoundButton _RGUI_RoundInput _RGUI_RoundEdit _RGUI_RoundGroup _RGUI_RoundScrollBar _RGUI_ScrollBarSet _RGUI_ScrollBarDestroy _RGUI_RoundRect _RGUI_DrawLine _RGUI_ButtonPress _RGUI_ButtonReset Version 2025-04-06 * Solved an issue where scroll bar and control are not in the same GUI child * Added 4th example on how to use scrollbar with ListView over a background generated by GDI+ Version 2025-03-28 * Added support to auto-size label and button controls (by passing -1 for width and/or height) * Removed the requirement to pass handle of the GUI to _RGUI_RoundGroup * Added 3rd example on how to use scrollbar with RichEdit Version 2025-03-21 * Added support of round corner scrollbar * Added a 2nd example on how to use scrollbar with ListBox Version 2025-03-15 * Basic framework for the UDF Here an example of what could be done with the UDF : If you feel there should be new controls, I will consider adding them to the UDF. RoundGUI.zip1 point
-
FileExplorer Treeview and Listview (TreeListExplorer)
WildByDesign reacted to Kanashius for a topic
I found it. The problem was using the extension instead of the path when retrieving individual file icons from the cache, which returned 0 (=folder icon) with not ".exe" present. But I checked correctly, if the path is in the cache, so it did not fail there... Additionally I added your proposed _WinAPI_AssocQueryString(".sys", $ASSOCSTR_DEFAULTICON) as a possibility to retrieve the icon from the registry. So that is working now. Thanks for your research into that1 point -
Help with Automating File Processing in AutoIt
argumentum reacted to RTFC for a topic
Please explore "parallel/concurrent processing" UDFs in the Wiki.1 point -
FileExplorer Treeview and Listview (TreeListExplorer)
WildByDesign reacted to SOLVE-SMART for a topic
Thank you very much 😀 . I know exactly what you mean. Very often, when I publish code on GitHub (smaller private projects) or an GitLab (for my work), I instantly realize what is missing or people will give some hints 😂 . That's why it's always worth it (for me). Best regards Sven1 point -
FileExplorer Treeview and Listview (TreeListExplorer)
WildByDesign reacted to Kanashius for a topic
Done1 point -
FileExplorer Treeview and Listview (TreeListExplorer)
Kanashius reacted to WildByDesign for a topic
Instead of: Local $hIcon = _WinAPI_ExtractIcon($sIconPath, $iIconIndex, True) I get better results on my 125% scaling monitor with: Local $hIcon = _WinAPI_ShellExtractIcon($sIconPath, $iIconIndex, 20, 20) If we can somehow specify icon size, it would be best. Can that somehow use the $iIconSize variable?1 point -
FileExplorer Treeview and Listview (TreeListExplorer)
SOLVE-SMART reacted to WildByDesign for a topic
I agree. I run a diff with VSCodium each update to learn more and understand. But Github would be easier.1 point -
FileExplorer Treeview and Listview (TreeListExplorer)
WildByDesign reacted to Kanashius for a topic
@WildByDesign 1. You are right, done 2. That is more of a workaround, I implemented support for basically any file, so .sys should be supported as well 3. Yeah, I added the extraction of .exe icons (for .url and .lnk files as well). I also added the __TreeListExplorer_FreeIconCache method. Because a lot of icons are cached now, with some special ones not only for extensions but also single files, it may become a little big (normally it should be fine, but who nows about extrem usage :D). So there is a possibility to clear it up. (I mean, how many .exe/.url/.lnk files can someone have? 4. Well, that should be fixed now.1 point -
MiniMark (a minimalistic rtf editor)
TheAutomator reacted to argumentum for a topic
#autoit3wrapper_icon=setup\setup.ico, 201 ... ... DllCall('shell32.dll', 'long', 'SetCurrentProcessExplicitAppUserModelID', 'wstr', StringStripWS(@ScriptName, 8)) ; look at _WinAPI_SetCurrentProcessExplicitAppUserModelID() $form = GUICreate('MiniMark Setup', 300, 300, Default, Default, $ws_popup, $ws_ex_layered) Gui_SetIconIf("setup\icon.ico", 201) Func Gui_SetIconIf($sIconFile, $iIconID) If @AutoItExe = @ScriptFullPath And Not FileGetSize($sIconFile) Then GUISetIcon(@AutoItExe, $iIconID) Else GUISetIcon($sIconFile) EndIf EndFunc ;==>Gui_SetIconIf That function I use in one of my scripts where if compiled uses the internal Icon, else, use the file but if is there, maybe the user wanted a different one so use the one on disk. Similarly you can keep all the files on disk or embed it in the executable, or both as described above. It would take installing to where a user can modify anything that a non-admin could. @AppDataDir could be a good folder as @ProgramFilesDir requires admin level. In cv.exe there is code to elevate and de-elevate. You can use that or scrape the forum for the original sources. That would give the user the option to install as admin or user. Oh, that. I wanted to edit as little as possible and, have what I wanted, hence the extra variable. As is from the download, it didn't run. Yes it is. The reason for my requests is to have a nice product that would please as many users as possible, in as many circumstances as there may be. Maybe 10 users will use your script as a product, or a million, no clue. But if your script is an example of how to code something, better These requests are perfectly doable. Is just a matter of coding it that way, if is not too far from what you had in mind. Along those lines of expanding capabilities, making the GUI resizable would be nice. Resize the font too ( for those that need bigger letters because they don't see very well ). "Zoom in / out: ctrl + scroll" with memory, for the next time is loaded. One feature at the time is good. Thanks for paying attention to my demands requests1 point -
what is a GUI you think of as "good"?
mLipok reacted to DutchCoder for a topic
1 point -
Hello, a little add : Dir (scan directory) #include <GUIConstantsEx.au3> #include <ListboxConstants.au3> #Include <GuiListBox.au3> #include <WindowsConstants.au3> #include <String.au3> ;HotKeySet("!o", "_ArDisplay") Opt('MustDeclareVars', 1) Global $guictrl[9] Global $files[1] Global $arraypos = 0 Global $last_selected Global $name = "playlist.m3u" _main() Func _main() Local $msg Local $title = "M3U Creator" GUICreate($title, 700, 250) GUISetFont(7.5) GUISetState(@SW_SHOW) $guictrl[0] = GUICtrlCreateButton("Import", 10, 10, 45) $guictrl[1] = GUICtrlCreateList("", 65, 10, 625, 225, BitOR($WS_HSCROLL, $WS_VSCROLL, $LBS_EXTENDEDSEL)) $guictrl[2] = GUICtrlCreateButton("Add ", 10, 40, 45) $guictrl[3] = GUICtrlCreateButton("Dir", 10, 70, 45) $guictrl[4] = GUICtrlCreateButton("Save ", 10, 100, 45) $guictrl[5] = GUICtrlCreateButton("Delete ", 10, 130, 45) $guictrl[6] = GUICtrlCreateButton(" ^ ", 20, 160, 25) $guictrl[7] = GUICtrlCreateButton(" v ", 20, 190, 25) $guictrl[8] = GUICtrlCreateButton("Clear", 10, 220, 45) GUICtrlSetFont($guictrl[1], 8.5, "", "", "Courier New") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $guictrl[0] _Import() Case $msg = $guictrl[2] _OpenDialog() Case $msg = $guictrl[3] _FolderScan() Case $msg = $guictrl[4] _Save($title) Case $msg = $guictrl[5] _Delete() Case $msg = $guictrl[6] _MoveUp() Case $msg = $guictrl[7] _MoveDown() Case $msg = $guictrl[8] _ClearArray() EndSelect WEnd GUIDelete() EndFunc Func _Import() Local $import Local $i = 0 Local $filesize Local $k = 0 Local $skip = 0 $import = FileOpenDialog("Select M3U file.", @WorkingDir, "Playlist (*.M3U)") $i = FileGetSize($import) - 1 If @error Or $i = -1 Then MsgBox("", "Error", "File is empty") Return EndIf $filesize = StringLen(StringAddCR(FileRead($import, $i))) - $i + 1 $i = 0 Local $temp[$filesize] While $i < $filesize $skip = 0 $k = 0 $temp[$i] = FileReadLine($import, $i + 1) If StringInStr($temp[$i], "\") Then Else $temp[$i] = _StringInsert($temp[$i], @WorkingDir & "\", 0) EndIf While $k < $arraypos If $temp[$i] = $files[$k] Then MsgBox(0, "", '"' & $temp[$i] & '" is already in the library') $skip = 1 EndIf $k += 1 WEnd $k = 0 If $skip = 0 Then ; Redimensionner le tableau si nécessaire If $arraypos >= UBound($files) Then ReDim $files[$arraypos + 100] EndIf $files[$arraypos] = $temp[$i] $arraypos += 1 EndIf $i += 1 WEnd _UpdateList() EndFunc Func _OpenDialog() Local $odfile Local $pos Local $i = 1 Local $k = 0 Local $temp[200] Local $skip = 0 $odfile = FileOpenDialog("Select Files", @WorkingDir, "Music (*.MP3; *.WMA; *.ASF; *.AC3; *.FLAC; *.OGG;*.M4A; *.MKA; *.TTA; *.WV; *.WAV)", 4) If @error Then Return If StringInStr($odfile, "|") Then $temp = StringSplit($odfile, "|") While $i < $temp[0] $skip = 0 While $k < $arraypos If $temp[1] & "\" & $temp[$i + 1] = $files[$k] Then MsgBox(0, "", '"' & $temp[$i + 1] & '" is already in the library') $skip = 1 EndIf $k += 1 WEnd $k = 0 If $skip = 0 Then ; Redimensionner le tableau si nécessaire If $arraypos >= UBound($files) Then ReDim $files[$arraypos + 100] ; Augmente de 100 à chaque fois EndIf $files[$arraypos] = $temp[1] & "\" & $temp[$i + 1] $arraypos += 1 EndIf $i += 1 WEnd Else While $k < $arraypos If $odfile = $files[$k] Then MsgBox(0, "", '"' & $odfile & '" is already in the library') $skip = 1 EndIf $k += 1 WEnd $k = 0 If $skip = 0 Then ; Redimensionner le tableau si nécessaire If $arraypos >= UBound($files) Then ReDim $files[$arraypos + 100] ; Augmente de 100 à chaque fois EndIf $files[$arraypos] = $odfile $arraypos += 1 EndIf EndIf _UpdateList() EndFunc Func _UpdateList() Local $i Local $strlen Local $horiz_fit Local $max_len = 0 GUICtrlSetData($guictrl[1], "") While $i < $arraypos GUICtrlSetData($guictrl[1], $files[$i]) $strlen = StringLen($files[$i]) If $strlen > 88 Then If $strlen > $max_len Then $max_len = $strlen EndIf EndIf $i += 1 WEnd $horiz_fit = Round($max_len * 7.08) _GUICtrlListBox_SetHorizontalExtent($guictrl[1], $horiz_fit) _GUICtrlListBox_SetSel($guictrl[1], $last_selected) EndFunc Func _Save(ByRef $title) Local $i = 0 Local $saveas Local $file_name Local $overwrite Local $temp_namer[20] $saveas = FileSaveDialog("Save As", @WorkingDir, "Playlist (*.m3u)", "", $name) If @error Then Return If StringInStr($saveas, ".") Then $file_name = $saveas Else $file_name = $saveas & ".m3u" EndIf If FileExists($file_name) Then $overwrite = MsgBox(276, "Overwrite?", "Would you like to Overwrite this file?") If $overwrite = 6 Then FileDelete($file_name) Else Return EndIf EndIf While $i < $arraypos FileWriteLine($file_name, $files[$i]) $i += 1 WEnd $temp_namer = StringSplit($file_name, "\") $name = $temp_namer[$temp_namer[0]] If StringLen($title & " - " & $file_name) > 97 Then If StringLen($title & " - " & $temp_namer[1] & "\ . . . \" & $temp_namer[$temp_namer[0] - 2] & "\" & $temp_namer[$temp_namer[0] - 1] & "\" & $temp_namer[$temp_namer[0]]) > 97 Then WinSetTitle($title, "", $title & " - " & $temp_namer[1] & "\ . . . \" & $temp_namer[$temp_namer[0] - 1] & "\" & $temp_namer[$temp_namer[0]]) Else WinSetTitle($title, "", $title & " - " & $temp_namer[1] & "\ . . . \" & $temp_namer[$temp_namer[0] - 2] & "\" & $temp_namer[$temp_namer[0] - 1] & "\" & $temp_namer[$temp_namer[0]]) EndIf Else WinSetTitle($title, "", $title & " - " & $file_name) EndIf EndFunc Func _ClearArray() Local $i Local $clear $clear = MsgBox(276, "Clear playlist?", "Are you sure you want to clear your playlist?") If $clear = 6 Then Else Return EndIf GUICtrlSetData($guictrl[1], "") While $i < $arraypos $files[$i] = "" $i += 1 WEnd $last_selected = "" $arraypos = 0 EndFunc Func _Delete() Local $i = 0 Local $k = 0 Local $temp $temp = GUICtrlRead($guictrl[1]) While $i < $arraypos If $temp = $files[$i] Then $files[$i] = "" $k = $i While $k < $arraypos $files[$k] = $files[$k + 1] $k += 1 WEnd $arraypos -= 1 $last_selected = $i _UpdateList() Return EndIf $i += 1 WEnd EndFunc Func _MoveUp() Local $i Local $temp $temp = GUICtrlRead($guictrl[1]) While $i < $arraypos If $temp = $files[$i] Then If $i = 0 Then MsgBox(0,"Error", "Sorry, This file is allready at the top of the list.") Return EndIf _Swap($i, $i - 1) Return EndIf $i += 1 WEnd EndFunc Func _MoveDown() Local $i Local $temp $temp = GUICtrlRead($guictrl[1]) While $i < $arraypos If $temp = $files[$i] Then If $i = $arraypos - 1 Then MsgBox(0,"Error", "Sorry, This file is allready at the bottom of the list.") Return EndIf _Swap($i, $i + 1) Return EndIf $i += 1 WEnd EndFunc Func _Swap($pos1, $pos2) Local $temp If $pos1 > $pos2 Then $last_selected = $pos1 - 1 Else $last_selected = $pos1 + 1 EndIf $temp = $files[$pos1] $files[$pos1] = $files[$pos2] $files[$pos2] = $temp _UpdateList() EndFunc Func _FolderScan() Local $folder = FileSelectFolder("Sélectionnez un répertoire à scanner", "") If @error Then Return Local $fileExt = "(*.MP3;*.WMA;*.ASF;*.AC3;*.FLAC;*.OGG;*.M4A;*.MKA;*.TTA;*.WV;*.WAV)" Local $searchHandle, $file, $fullPath, $skip $searchHandle = FileFindFirstFile($folder & "\*.*") If $searchHandle = -1 Then Return While 1 $file = FileFindNextFile($searchHandle) If @error Then ExitLoop $fullPath = $folder & "\" & $file If @extended Then ; Si c'est un dossier _FolderScanRecursive($fullPath) Else ; Si c'est un fichier If StringRegExp($file, "(?i)\.(mp3|wma|asf|ac3|flac|ogg|m4a|mka|tta|wv|wav)$") Then $skip = 0 For $k = 0 To $arraypos - 1 If $fullPath = $files[$k] Then $skip = 1 ExitLoop EndIf Next If $skip = 0 Then ; Redimensionner le tableau si nécessaire If $arraypos >= UBound($files) Then ReDim $files[$arraypos + 100] EndIf $files[$arraypos] = $fullPath $arraypos += 1 EndIf EndIf EndIf WEnd FileClose($searchHandle) _UpdateList() EndFunc Func _FolderScanRecursive($folderPath) Local $searchHandle, $file, $fullPath, $skip $searchHandle = FileFindFirstFile($folderPath & "\*.*") If $searchHandle = -1 Then Return While 1 $file = FileFindNextFile($searchHandle) If @error Then ExitLoop $fullPath = $folderPath & "\" & $file If @extended Then ; Si c'est un dossier _FolderScanRecursive($fullPath) Else ; Si c'est un fichier If StringRegExp($file, "(?i)\.(mp3|wma|asf|ac3|flac|ogg|m4a|mka|tta|wv|wav)$") Then $skip = 0 For $k = 0 To $arraypos - 1 If $fullPath = $files[$k] Then $skip = 1 ExitLoop EndIf Next If $skip = 0 Then ; Redimensionner le tableau si nécessaire If $arraypos >= UBound($files) Then ReDim $files[$arraypos + 100] EndIf $files[$arraypos] = $fullPath $arraypos += 1 EndIf EndIf EndIf WEnd FileClose($searchHandle) EndFunc m3u.au31 point
-
I ran a script which basically deleted itself and I can't find my file! HELPPPP =[[[[[1 point
-
Getting default icons for files
WildByDesign reacted to Yashied for a topic
I use the following. Returns a path to the icon and its index in "pure" form. #Include <WinAPIEx.au3> Global $Ext = '.au3' ConsoleWrite('(' & $Ext & ')' & @CR) ConsoleWrite('--------------------' & @CR) ConsoleWrite('Type: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_FRIENDLYDOCNAME) & @CR) ConsoleWrite('Command: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_COMMAND) & @CR) ConsoleWrite('Executable: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_EXECUTABLE) & @CR) ConsoleWrite('Icon: ' & _WinAPI_AssocQueryString($Ext, $ASSOCSTR_DEFAULTICON) & @CR) WinAPIEx.au31 point