-
Posts
42 -
Joined
-
Last visited
Everything posted by taz742
-
[fixed] RunWait("filename") limitation
taz742 replied to taz742's topic in AutoIt General Help and Support
Thanks for replies but this isn't what i'm waiting. I know the filefullpath limitation for windows is 255 characters. @weaponx: with your script located in "c:\" it failed at 252 so 251 + 4 ('.txt' lenght) = 255. this confirm the 255 characters limitation for filepath. I use RunWait() to run executable program with multi parameters and by this way the lenght of my "filename" parameter is more than 255. I've test this lenght and AutoIt failed to RunWait with more than 4096 characters' lenght. So i think this AutoIt limitation is define by CMDLINEPARAM_MAXLEN = 4096 in the help -
Is there a maximum limitation for filename's lenght parameter in the RunWait() function? RunWait ( "filename" [, "workingdir" [, flag]] )
-
Great work I'm gonna start playing with !!
-
#include <GuiConstants.au3> #include <EditConstants.au3> $GUI = GUICreate("GUI", 400, 425) $Edit = GUICtrlCreateEdit("Edit", 10, 10, 380, 380, $ES_READONLY) $Button = GUICtrlCreateButton('Undo', 10, 395, 380, 25) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case -3 Exit Case $Button Local $Current_Style = _GUICtrlGetStyle($Edit) If BitAND($Current_Style, $ES_READONLY) Then GUICtrlSetStyle($Edit, BitAND($Current_Style, BitNOT($ES_READONLY)), -1) GUICtrlSetData($Button,"Redo") MsgBox(64, 'Active', 'You can now edit the edit box') Else GUICtrlSetStyle($Edit, BitOR($Current_Style, $ES_READONLY), -1) GUICtrlSetData($Button,"Undo") MsgBox(64, 'Read Only', "You can't edit the edit box") EndIf EndSwitch WEnd Func _GUICtrlGetStyle($CtrlhWnd) If Not IsHWnd($CtrlhWnd) Then $CtrlhWnd = GUICtrlGetHandle($CtrlhWnd) Local $a_Style = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $CtrlhWnd, "int", -16);get existing Style Return $a_Style[0] EndFunc ;==>_GUICtrlGetStyleoÝ÷ Ù&¦z^«b¢w·¢w°ØDÅ+r殶sdgVæ2ôuT7G&ÄvWDW7GÆRb33c´7G&ÆvæB¢bæ÷B4væBb33c´7G&ÆvæBFVâb33c´7G&ÆvæBÒuT7G&ÄvWDæFÆRb33c´7G&ÆvæB¢Æö6Âb33c¶ôW7GÆRÒFÆÄ6ÆÂgV÷C·W6W#3"æFÆÂgV÷C²ÂgV÷C¶ÆöærgV÷C²ÂgV÷C´vWEvæF÷tÆöærgV÷C²ÂgV÷C¶væBgV÷C²Âb33c´7G&ÆvæBÂgV÷C¶çBgV÷C²ÂÓ#¶vWBW7FærW7GÆP¢&WGW&âb33c¶ôW7GÆU³Ð¤VæDgVæ2³ÓÒfwCµôuT7G&ÄvWDW7GÆP
-
#include <GUIConstants.au3> #NoTrayIcon ;Only if you don't want to see it GUICreate("",220,70,100,200,$WS_POPUP,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) GUICtrlCreateLabel("This is what you want"&@CRLF&""&@CRLF&"It is Topmost and is not visable in the taskbar"&@CRLF&";-)",10,10) $exit = GUICtrlCreateButton("X",200,0,20,20) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $exit Then ExitLoop Wend Have fun
-
These function is based on Lazycat's UDF _MP3GetTag() I'll fix and rewrite it because his version wasn't fully support v1.0 and v1.1 ID3 TAG _MP3GetID3v1Tag() #include-once ;=============================================================================== ; Function Name: _MP3GetID3v1Tag($sFile) ; Description: Retrive MP3 ID3Tag v1.0 & v1.1 ; Parameter(s): $sFile = FileFullPath ; Requirement(s): Autoit v3.2.0 ; Return Value(s): On Success - array with data: ; 0 - Title ; 1 - Artist ; 2 - Album ; 3 - Year ; 4 - Comment ; 5 - Track number ; 6 - Genre ; 7 - Tag version ; On Failure empty string and sets @ERROR: ; -1 - File not found ; 1 - TAG not found ; Version : 2.6.0 ; Author(s): taz742 based on Lazycat's UDF _MP3GetTag() ;=============================================================================== ; Func _MP3GetID3v1Tag($sFile) Local $ret = DllCall("kernel32.dll", "int", "CreateFile", _ "str", $sFile, _ "int", 0x80000000, _ "int", 0, _ "ptr", 0, _ "int", 3, _ "int", 0x80, _ "ptr", 0), $error = 0 If @error Or Not $ret[0] Then $error = -1 Else Local $aID3v1 Local $pTag = _FileReadToStruct("char[3];char[30];char[30];char[30];char[4];char[28];byte[2];byte", $ret[0], FileGetSize($sFile) - 128) ;TAG Header|Title|Artist|Album|Year|Comment|Track|Genre If Not (DllStructGetData($pTag, 1) == "TAG") Then $error = 1 Else Dim $aID3v1[8] $aID3v1[0] = DllStructGetData($pTag, 2) ;Title $aID3v1[1] = DllStructGetData($pTag, 3) ;Artist $aID3v1[2] = DllStructGetData($pTag, 4) ;Album $aID3v1[3] = DllStructGetData($pTag, 5) ;Year If DllStructGetData($pTag, 7, 1) = 0 Then ;ID3Tag is v1.1 -> Track $aID3v1[4] = DllStructGetData($pTag, 6) ;Comment $aID3v1[5] = DllStructGetData($pTag, 7, 2) ;Track $aID3v1[7] = "1.1" ;version info Else ;ID3Tag is v1.0 -> Not Track $aID3v1[4] = DllStructGetData($pTag, 6) & String(BinaryToString(DllStructGetData($pTag, 7))) ;Comment $aID3v1[5] = "" ;Track is empty because not yet implanted in ID3v1.0 $aID3v1[7] = "1.0" ;version info EndIf $aID3v1[6] = _MP3GetGenreByID(DllStructGetData($pTag, 8)) ;Genre EndIf EndIf DllCall("kernel32.dll", "int", "CloseHandle", "int", $ret[0]) If Not $error Then Return $aID3v1 SetError($error) Return "" EndFunc ;==>_MP3GetID3v1Tag Func _MP3GetGenreByID($iID) Local $asGenre = StringSplit("Blues,Classic Rock,Country,Dance,Disco,Funk,Grunge,Hip-Hop," & _ "Jazz,Metal,New Age,Oldies,Other,Pop,R&B,Rap,Reggae,Rock,Techno,Industrial,Alternative," & _ "Ska,Death Metal,Pranks,Soundtrack,Euro-Techno,Ambient,Trip-Hop,Vocal,Jazz+Funk,Fusion," & _ "Trance,Classical,Instrumental,Acid,House,Game,Sound Clip,Gospel,Noise,Alternative Rock," & _ "Bass,Soul,Punk,Space,Meditative,Instrumental Pop,Instrumental Rock,Ethnic,Gothic,Darkwave," & _ "Techno-Industrial,Electronic,Pop-Folk,Eurodance,Dream,Southern Rock,Comedy,Cult,Gangsta," & _ "Top 40,Christian Rap,Pop/Funk,Jungle,Native US,Cabaret,New Wave,Psychadelic,Rave,Showtunes," & _ "Trailer,Lo-Fi,Tribal,Acid Punk,Acid Jazz,Polka,Retro,Musical,Rock & Roll,Hard Rock,Folk," & _ "Folk-Rock,National Folk,Swing,Fast Fusion,Bebob,Latin,Revival,Celtic,Bluegrass,Avantgarde," & _ "Gothic Rock,Progressive Rock,Psychedelic Rock,Symphonic Rock,Slow Rock,Big Band,Chorus," & _ "Easy Listening,Acoustic,Humour,Speech,Chanson,Opera,Chamber Music,Sonata,Symphony,Booty Bass," & _ "Primus,Porn Groove,Satire,Slow Jam,Club,Tango,Samba,Folklore,Ballad,Power Ballad,Rhytmic Soul," & _ "Freestyle,Duet,Punk Rock,Drum Solo,Acapella,Euro-House,Dance Hall,Goa,Drum & Bass,Club-House," & _ "Hardcore,Terror,Indie,BritPop,Negerpunk,Polsk Punk,Beat,Christian Gangsta,Heavy Metal,Black Metal," & _ "Crossover,Contemporary C,Christian Rock,Merengue,Salsa,Thrash Metal,Anime,JPop,SynthPop", ",") If ($iID >= 0) And ($iID < 148) Then Return $asGenre[$iID + 1] Return ("") EndFunc ;==>_MP3GetGenreByID Func _FileReadToStruct($vStruct, $hFile, $nOffset) If Not DllStructGetSize($vStruct) Then $vStruct = DllStructCreate($vStruct) Local $nLen = DllStructGetSize($vStruct) Local $ret = DllCall("kernel32.dll", "int", "SetFilePointer", _ "int", $hFile, _ "int", $nOffset, _ "int", 0, _ "int", 0) ; FILE_BEGIN Local $pRead = DllStructCreate("dword") $ret = DllCall("kernel32.dll", "int", "ReadFile", _ "int", $hFile, _ "ptr", DllStructGetPtr($vStruct), _ "int", $nLen, _ "ptr", DllStructGetPtr($pRead), _ "ptr", 0) If @error Then SetError(1) EndIf Local $nRead = DllStructGetData($pRead, 1) $pRead = 0 SetExtended($nRead) If Not ($nRead = $nLen) Then SetError(2) Return $vStruct EndFunc ;==>_FileReadToStruct _MP3GetID3v1Tag.rar
-
I've a probleme with these 2 Listview functions: _GUICtrlListView_GetItemParam() don't return the same value setting up by _GUICtrlListView_SetItemParam(). I use a big value "3333324632463332" in set param and get param return "514037732" so my question is: Is there a limitation for $iParam in those functions? PS: i'm using v3.2.10.0 #include <GuiConstantsEx.au3> #include <GuiListView.au3> Opt('MustDeclareVars', 1) $Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work Example_Internal() ;use autoit built-in listview Example_External() ;use UDF built listview Func Example_Internal() Local $hListView GUICreate("(Internal) ListView Set Item Param", 400, 300) $hListView = GUICtrlCreateListView("", 2, 2, 394, 268) GUISetState() ; Add columns _GUICtrlListView_AddColumn ($hListView, "Items", 100) ; Add items _GUICtrlListView_AddItem ($hListView, "Item 1") _GUICtrlListView_AddItem ($hListView, "Item 2") _GUICtrlListView_AddItem ($hListView, "Item 3") ; Set item 2 parameter _GUICtrlListView_SetItemParam ($hListView, 1, "3333324632463332") MsgBox (4160, "Information", "Item 2 Parameter: " & _GUICtrlListView_GetItemParam ($hListView, 1)) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example_Internal Func Example_External() Local $GUI, $hListView $GUI = GUICreate("(External) ListView Set Item Param", 400, 300) $hListView = _GUICtrlListView_Create ($GUI, "", 2, 2, 394, 268) GUISetState() ; Add columns _GUICtrlListView_AddColumn ($hListView, "Items", 100) ; Add items _GUICtrlListView_AddItem ($hListView, "Item 1") _GUICtrlListView_AddItem ($hListView, "Item 2") _GUICtrlListView_AddItem ($hListView, "Item 3") ; Set item 2 parameter _GUICtrlListView_SetItemParam ($hListView, 1, "3333324632463332") MsgBox (4160, "Information", "Item 2 Parameter: " & _GUICtrlListView_GetItemParam ($hListView, 1)) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example_External
-
Exellent work !!! This UDF is just what I've been looking for ever since I began to use Autoit.
-
_OpenFileFolderDialog($sTitle, $sMsg, $iFoldersOnly = 0, $iParent = '') Retrun an array of selected TreeViewItems in function of $iFoldersOnly $iFoldersOnly = -1 >> Display Files & Folders but return only files $iFoldersOnly = 0 (Default) >> Display Files & Folders and return both $iFoldersOnly = 1 >> Display Folders Only and return folders _OpenFolderFileDialog.v2.rar Edit: Fixed: 2nd level tree folder wasn't returned in array. _OpenFolderFileDialog.v2.2.rar
-
Danny35d : I've finished your work !!!! Now _OpenFolderFileDialog() return an array with the selected files/folder I'm currently working to debug it. I'll post it when debuging will be done
-
Yes this could be a good solution.
-
I do not claim to believe that I did better than "you and all developers joined together" by posting this function on the forum. Far from me this idea I just wanted to share my experiment in the case of it would be useful to somebody. PathSplit() done good work that's just me and arrays aren't friends. I like functions which turns over me directly the anticipated result. So I'm sorry to have annoyed or upset you. I thought that this forum was made for that: to share and why not if it's possible, to improve this superb tool which is AutoIt. Sincerely.
-
Excellent work !!!
-
Great Job!!! Thanks for sharing It
-
Because I'm bored using the UDF's _PathSplit() function & its returned array: I write this function. Hope this help someone. New script using RegExp: _FileGetPathByRegExp() Based on _PathSplitByRegExp() by G.Sandler a.k.a CreatoR (MsCreatoR) so thanks to him $source = @ProgramFilesDir & "\AutoIt3\Include\File.au3" MsgBox("", "_FileGetPathByRegExp() - example", @TAB & "$source = " & @TAB & @TAB & $source & @CRLF & @CRLF & _ "_FileGetPathByRegExp($source, 1):" & @TAB & _FileGetPathByRegExp($source, 1) & @CRLF & _ "_FileGetPathByRegExp($source, 12):" & @TAB & _FileGetPathByRegExp($source, 12) & @CRLF & _ "_FileGetPathByRegExp($source, 123):" & @TAB & _FileGetPathByRegExp($source, 123) & @CRLF & _ "_FileGetPathByRegExp($source, 2):" & @TAB & _FileGetPathByRegExp($source, 2) & @CRLF & _ "_FileGetPathByRegExp($source, 23):" & @TAB & _FileGetPathByRegExp($source, 23) & @CRLF & _ "_FileGetPathByRegExp($source, 234):" & @TAB & _FileGetPathByRegExp($source, 234) & @CRLF & _ "_FileGetPathByRegExp($source, 3):" & @TAB & _FileGetPathByRegExp($source, 3) & @CRLF & _ "_FileGetPathByRegExp($source, 34):" & @TAB & _FileGetPathByRegExp($source, 34) & @CRLF & _ "_FileGetPathByRegExp($source, 4):" & @TAB & _FileGetPathByRegExp($source, 4)) ;=============================================================================== ; Function Name: _FileGetPathByRegExp($sPath [,$opt]) ; Description: Parse a fullpath to output what choosen in $sOutput parameter. ; (Fullpath can be a UNC server) ; Requirement(s): AutoIt 3.2.2.0. ; Parameter(s): $opt ; "1" => Drive ("Drive:") ; (Default) "12" => DirFullPath ("Drive:\Path\") ; "123" => DirFullPath & Filename ("Drive:\Path\File") ; "2" => Path ("\Path\") ; "23" => Path & Filename ("\Path\File") ; "234" => Path & FullFileName ("\Path\File.Ext") ; "3" => Filename ("File") ; "34" => FullFileName ("File.Ext") ; "4" => Extention (".Ext") ; Return Value(s): String ; Author(s): Taz742 based on _PathSplitByRegExp() by G.Sandler a.k.a CreatoR (MsCreatoR) ;=============================================================================== Func _FileGetPathByRegExp($sPath, $opt = 12) Local $pDelim = "", $oPath If StringRegExp($sPath, '^(?i)([A-Z]:|\\)(\\[^\\]+)+$') Then $pDelim = "\\" If $pDelim = "" Then Return SetError(1, 0, $sPath) If StringMid($sPath, 1, 2) = "\\" Then $sPath = StringMid($sPath, 3) Switch $opt Case 1 $oPath = StringRegExpReplace($sPath, $pDelim & '.*', $pDelim) Case 12 $oPath = StringRegExpReplace($sPath, $pDelim & '[^' & $pDelim & ']*$', '') & "\" Case 123 $oPath = StringRegExpReplace($sPath, '\.[^.]*$', '') Case 2 $oPath = StringMid(StringRegExpReplace(StringRegExpReplace($sPath, '(?i)([A-Z]:' & $pDelim & ')', ''), $pDelim & '[^' & $pDelim & ']*$', '') & "\", StringLen(StringRegExpReplace($sPath, $pDelim & '.*', $pDelim)) + 1) Case 23 $oPath = StringMid(StringRegExpReplace(StringRegExpReplace($sPath, '\.[^.]*$', ''), '(?i)([A-Z]:' & $pDelim & ')', ''), StringLen(StringRegExpReplace($sPath, $pDelim & '.*', $pDelim)) + 1) Case 234 $oPath = StringMid(StringRegExpReplace($sPath, '(?i)([A-Z]:' & $pDelim & ')', ''), StringLen(StringRegExpReplace($sPath, $pDelim & '.*', $pDelim)) + 1) Case 3 $oPath = StringRegExpReplace(StringRegExpReplace($sPath, '^.*' & $pDelim, ''), '\.[^.]*$', '') Case 34 $oPath = StringRegExpReplace($sPath, '^.*' & $pDelim, '') Case 4 $oPath = "." & StringRegExpReplace($sPath, '^.*\.', '') EndSwitch If $opt = 1 Or $opt = 12 Or $opt = 123 Then $oPath = "\\" & $oPath Else Switch $opt Case 1 $oPath = StringRegExpReplace($sPath, $pDelim & '.*', $pDelim) Case 12 $oPath = StringRegExpReplace($sPath, $pDelim & '[^' & $pDelim & ']*$', '') & "\" Case 123 $oPath = StringRegExpReplace($sPath, '\.[^.]*$', '') Case 2 $oPath = StringRegExpReplace(StringRegExpReplace($sPath, '(?i)([A-Z]:' & $pDelim & ')', ''), $pDelim & '[^' & $pDelim & ']*$', '') & "\" Case 23 $oPath = StringRegExpReplace(StringRegExpReplace($sPath, '\.[^.]*$', ''), '(?i)([A-Z]:' & $pDelim & ')', '') Case 234 $oPath = StringRegExpReplace($sPath, '(?i)([A-Z]:' & $pDelim & ')', '') Case 3 $oPath = StringRegExpReplace(StringRegExpReplace($sPath, '^.*' & $pDelim, ''), '\.[^.]*$', '') Case 34 $oPath = StringRegExpReplace($sPath, '^.*' & $pDelim, '') Case 4 $oPath = "." & StringRegExpReplace($sPath, '^.*\.', '') EndSwitch EndIf Return $oPath EndFunc ;==>_FileGetPathByRegExp