1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. chesstiger

Beiträge von chesstiger

  • Textchange Funktion?

    • chesstiger
    • 12. Mai 2013 um 21:22

    Natürlich geht das.^^

    [autoit]


    #include <StaticConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    $hWnd = GUICreate("Live-Aktualisierung", 300, 300)
    $cText = GUICtrlCreateLabel("Template", 0, 0, 300, 150, $SS_CENTER + $SS_CENTERIMAGE)
    $cName = GUICtrlCreateInput("", 0 + 50, 150 + 50 + 15, 200, 20, $SS_CENTER)

    [/autoit][autoit][/autoit][autoit]

    GUISetState()

    [/autoit][autoit][/autoit][autoit]

    Local $sCurrent

    [/autoit][autoit][/autoit][autoit]

    While True
    Switch GUIGetMsg()
    Case -3 ;GUI_EVENT_CLOSE
    Exit
    EndSwitch

    [/autoit][autoit][/autoit][autoit]

    If $sCurrent <> GUICtrlRead($cName) Then
    GUICtrlSetData($cText, "Mein Hund heißt " & GUICtrlRead($cName) & "!")
    $sCurrent = GUICtrlRead($cName)
    EndIf
    WEnd

    [/autoit]

    lg

  • Festplatte nach Dateitype durchsuchen

    • chesstiger
    • 12. Mai 2013 um 20:39

    Oscar
    Ja, aber deine Funktion unterstützt ja keine Live-Aktualisierung des Fortschrittes (Was ja Sinn und Zweck meiner Methode sowie des DirGetSize's war). ;)

    lg

  • Festplatte nach Dateitype durchsuchen

    • chesstiger
    • 12. Mai 2013 um 18:44

    Nach einem Gespräch in der SB mit dem Threadstarter habe ich noch eine Lösung, welche die Live-Aktualisierung des Fortschrittes ermöglicht (Die oben genannte Suche dauert ja ziemlich lange).
    Ich habe eine Funktion von BugFix aus diesem Thread ein wenig modifiziert und um eine Callback-Möglichkeit erweitert.
    Ist, denke ich, weitestgehend selbsterklärend.^^

    Spoiler anzeigen
    [autoit]


    #include<Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $ret = _GetFilesFolder_Rekursiv(@ProgramFilesDir, "_Output", 'exe', 0, 0)
    _ArrayDisplay($ret, 'Rekursiv alle au3-Dateien')

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Output($iCurrSize, $iFullSize, $sFile)
    ToolTip(Round(($iCurrSize / $iFullSize) * 100, 3) & "%" & @CRLF & $sFile, 0, 0)
    EndFunc ;==>_Output

    [/autoit] [autoit][/autoit] [autoit]

    ;==================================================================================================
    ; Function Name: _GetFilesFolder_Rekursiv($sPath [, $sExt='*' [, $iDir=-1 [, $iRetType=0 ,[$sDelim='0']]]])
    ; Description: Rekursive Auflistung von Dateien und/oder Ordnern
    ; Parameter(s): $sPath der Basispfad für die Auflistung ('.' -aktueller Pfad, '..' -Parentpfad)
    ; $sCallback Callback-Funktion für den aktuellen Status
    ; $sExt Erweiterung für Dateiauswahl '*' oder -1 für alle (Standard)
    ; $iDir -1 Dateien+Ordner(Standard), 0 nur Dateien, 1 nur Ordner
    ; optional: $iRetType 0 gibt Array, 1 gibt String zurück
    ; optional: $sDelim legt Trennzeichen für Stringrückgabe fest
    ; 0 -@CRLF (Standard) 1 -@CR 2 -@LF 3 -';' 4 -'|'
    ; Return Value(s): Array (Standard) od. String mit den gefundenen Pfaden der Dateien und/oder Ordner
    ; Array[0] enthält die Anzahl der gefundenen Dateien/Ordner
    ; Author(s): BugFix ([email='bugfix@autoit.de'][/email])
    ; Modified ......: chesstiger (Progress-Callback)
    ;==================================================================================================
    Func _GetFilesFolder_Rekursiv($sPath, $sCallback, $sExt = '*', $iDir = -1, $iRetType = 0, $sDelim = '0')
    Global $oFSO = ObjCreate('Scripting.FileSystemObject')
    Global $strFiles = ''
    Switch $sDelim
    Case '1'
    $sDelim = @CR
    Case '2'
    $sDelim = @LF
    Case '3'
    $sDelim = ';'
    Case '4'
    $sDelim = '|'
    Case Else
    $sDelim = @CRLF
    EndSwitch
    If ($iRetType < 0) Or ($iRetType > 1) Then $iRetType = 0
    If $sExt = -1 Then $sExt = '*'
    If ($iDir < -1) Or ($iDir > 1) Then $iDir = -1

    [/autoit] [autoit][/autoit] [autoit]

    Local $iCurrSize = 0, $iFullSize = DirGetSize($sPath)

    [/autoit] [autoit][/autoit] [autoit]

    _ShowSubFolders($oFSO.GetFolder($sPath), $sExt, $iDir, $sDelim, $iCurrSize, $iFullSize, $sCallback)
    If $iRetType = 0 Then
    Local $aOut
    $aOut = StringSplit(StringTrimRight($strFiles, StringLen($sDelim)), $sDelim, 1)
    If $aOut[1] = '' Then
    ReDim $aOut[1]
    $aOut[0] = 0
    EndIf
    Return $aOut
    Else
    Return StringTrimRight($strFiles, StringLen($sDelim))
    EndIf
    EndFunc ;==>_GetFilesFolder_Rekursiv

    [/autoit] [autoit][/autoit] [autoit]

    Func _ShowSubFolders($Folder, $Ext, $Dir, $Delim, ByRef $iCurrSize, $iFullSize, $sCallback)
    If Not IsDeclared("strFiles") Then Global $strFiles = ''
    If ($Dir = -1) Or ($Dir = 0) Then
    For $file In $Folder.Files
    If $Ext <> '*' Then
    If StringRight($file.Name, StringLen($Ext)) = $Ext Then
    $strFiles &= $file.Path & $Delim
    $sCallFileName = $file.Path
    Else
    $sCallFileName = 0
    EndIf
    Else
    $strFiles &= $file.Path & $Delim
    $sCallFileName = $file.Path
    EndIf
    $iCurrSize += $file.Size
    Call($sCallback, $iCurrSize, $iFullSize, $sCallFileName)
    Next
    EndIf
    For $Subfolder In $Folder.SubFolders
    If ($Dir = -1) Or ($Dir = 1) Then $strFiles &= $Subfolder.Path & '\' & $Delim
    _ShowSubFolders($Subfolder, $Ext, $Dir, $Delim, $iCurrSize, $iFullSize, $sCallback)
    Next
    EndFunc ;==>_ShowSubFolders

    [/autoit]

    lg

  • Festplatte nach Dateitype durchsuchen

    • chesstiger
    • 12. Mai 2013 um 17:06

    Ja.

    Spoiler anzeigen
    [autoit]


    #include-once

    [/autoit] [autoit][/autoit] [autoit]

    ;#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

    [/autoit] [autoit][/autoit] [autoit]

    ; #INDEX# =======================================================================================================================
    ; Title .........: _RecFileListToArray
    ; AutoIt Version : v3.3.1.1 or higher
    ; Language ......: English
    ; Description ...: Lists files and\or folders in a specified path with optional recursion and sort.
    ; Remarks .......:
    ; Note ..........:
    ; Author(s) .....: Melba23
    ; Remark ........: Modified Array.au3 functions - credit: Jos van der Zande, LazyCoder, Tylo, Ultima, SolidSnake and gcriaco
    ; ===============================================================================================================================

    [/autoit] [autoit][/autoit] [autoit]

    ; #CURRENT# =====================================================================================================================
    ; _RecFileListToArray: Lists files and\or folders in a specified path with optional recursion and sort.
    ; ===============================================================================================================================

    [/autoit] [autoit][/autoit] [autoit]

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; _RFLTA_AddFileLists ....; Add element to list which is resized if necessary
    ; _RFLTA_AddToList .......; Add internal arrays after resizing and optional sorting
    ; _RFLTA_ArraySearch .....; Search array for partial match
    ; _RFLTA_ArraySort .......; Wrapper for QuickSort function
    ; _RFLTA_QuickSort .......: recursive array sort
    ; _RFLTA_ArrayConcatenate : Join 2 arrays
    ; _RFLTA_ArrayInsert .....: Insert element into array
    ; ===============================================================================================================================

    [/autoit] [autoit][/autoit] [autoit]

    ; #FUNCTION# ====================================================================================================================
    ; Name...........: _RecFileListToArray
    ; Description ...: Lists files and\or folders in a specified path with optional recursion and sort. Compatible with existing _FileListToArray syntax
    ; Syntax.........: _RecFileListToArray($sPath[, $sInclude_List = "*"[, $iReturn = 0[, $fRecur = 0[, $fSort = 0[, $sReturnPath = 1[, $sExclude_List = ""]]]]]])
    ; Parameters ....: $sPath - Initial path used to generate filelist. If path ends in \ then folders will be returned with an ending \
    ; $sInclude_List - Optional: the filter for included results (default is "*"). Multiple filters must be separated by ";"
    ; $iReturn - Optional: specifies whether to return files, folders or both
    ; |$iReturn = 0 (Default) Return both files and folders
    ; |$iReturn = 1 Return files only
    ; |$iReturn = 2 Return folders only
    ; $fRecur - Optional: specifies whether to Search recursively in subfolders
    ; |$fRecur = 0 (Default) Do not Search in subfolders
    ; |$fRecur = 1 Search in subfolders
    ; $fSort - Optional: sort ordered in alphabetical and depth order
    ; |$fSort = 0 (Default) Not sorted
    ; |$fSort = 1 Sorted
    ; $sReturnPath - Optional: specifies displayed path of results
    ; |$sReturnPath = 0 File/folder name only
    ; |$sReturnPath = 1 (Default) Initial path not included
    ; |$sReturnPath = 2 Initial path included
    ; $sExclude_List - Optional: the filter for excluded results (default is ""). Multiple filters must be separated by ";"
    ; Requirement(s).: v3.3.1.1 or higher
    ; Return values .: Success: One-dimensional array made up as follows:
    ; |$array[0] = Number of Files\Folders returned
    ; |$array[1] = 1st File\Folder
    ; |$array[2] = 2nd File\Folder
    ; |...
    ; |$array[n] = nth File\Folder
    ; Failure: Null string and @error = 1 with @extended set as follows:
    ; |1 = Path not found or invalid
    ; |2 = Invalid $sInclude_List
    ; |3 = Invalid $iReturn
    ; |4 = Invalid $fRecur
    ; |5 = Invalid $fSort
    ; |6 = Invalid $iFullPath
    ; |7 = Invalid $sExclude_List
    ; |8 = No files/folders found
    ; Author ........: Melba23 using SRE code from forums
    ; Remarks .......:
    ; Related .......:
    ; Link ..........;
    ; Example .......; Yes
    ; ===============================================================================================================================
    Func _RecFileListToArray($sInitialPath, $sInclude_List = "*", $iReturn = 0, $fRecur = 0, $fSort = 0, $sReturnPath = 1, $sExclude_List = "")

    [/autoit] [autoit][/autoit] [autoit]

    Local $asReturnList[100] = [0], $asFileMatchList[100] = [0], $asRootFileMatchList[100] = [0], $asFolderMatchList[100] = [0], $asFolderList[100] = [1]
    Local $sFolderSlash = "", $sInclude_List_Mask, $sExclude_List_Mask, $hSearch, $fFolder, $sRetPath = "", $sCurrentPath, $sName

    [/autoit] [autoit][/autoit] [autoit]

    ; Check valid path
    If Not FileExists($sInitialPath) Then Return SetError(1, 1, "")
    ; Check if folders should have trailing \ and ensure that $sInitialPath does have one
    If StringRight($sInitialPath, 1) = "\" Then
    $sFolderSlash = "\"
    Else
    $sInitialPath = $sInitialPath & "\"
    EndIf
    ; Add path to folder list
    $asFolderList[1] = $sInitialPath

    [/autoit] [autoit][/autoit] [autoit]

    ; Determine Filter mask for SRE check
    If $sInclude_List = "*" Then
    $sInclude_List_Mask = ".+" ; Set mask to exclude base folder with NULL name
    Else
    If StringRegExp($sInclude_List, "\\|/|:|\<|\>|\|") Then Return SetError(1, 2, "") ; Check For invalid characters within $sInclude_List
    $sInclude_List = StringReplace(StringStripWS(StringRegExpReplace($sInclude_List, "\s*;\s*", ";"), 3), ";", "|") ; Strip WS and insert | for ;
    $sInclude_List_Mask = "(?i)^(" & StringReplace(StringReplace(StringRegExpReplace($sInclude_List, "(\^|\$|\.)", "\\$1"), "?", "."), "*", ".*?") & ")\z" ; Convert to SRE pattern
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Determine Exclude mask for SRE check
    If $sExclude_List = "" Then
    $sExclude_List_Mask = ":" ; Set unmatchable mask
    Else
    If StringRegExp($sExclude_List, "\\|/|:|\<|\>|\|") Then Return SetError(1, 7, "") ; Check For invalid characters within $sInclude_List
    $sExclude_List = StringReplace(StringStripWS(StringRegExpReplace($sExclude_List, "\s*;\s*", ";"), 3), ";", "|") ; Strip WS and insert | for ;
    $sExclude_List_Mask = "(?i)^(" & StringReplace(StringReplace(StringRegExpReplace($sExclude_List, "(\^|\$|\.)", "\\$1"), "?", "."), "*", ".*?") & ")\z" ; Convert to SRE pattern
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Verify other parameter values
    If Not ($iReturn = 0 Or $iReturn = 1 Or $iReturn = 2) Then Return SetError(1, 3, "")
    If Not ($fRecur = 0 Or $fRecur = 1) Then Return SetError(1, 4, "")
    If Not ($fSort = 0 Or $fSort = 1) Then Return SetError(1, 5, "")
    If Not ($sReturnPath = 0 Or $sReturnPath = 1 Or $sReturnPath = 2) Then Return SetError(1, 6, "")

    [/autoit] [autoit][/autoit] [autoit]

    ; Search in listed folders
    While $asFolderList[0] > 0

    [/autoit] [autoit][/autoit] [autoit]

    ; Set path to search
    $sCurrentPath = $asFolderList[$asFolderList[0]]
    ; Reduce folder array count
    $asFolderList[0] -= 1

    [/autoit] [autoit][/autoit] [autoit]

    ; Determine return path to add to file/folder name
    Switch $sReturnPath
    ; Case 0 ; Name only
    ; Leave as ""
    Case 1 ; Initial path not included
    $sRetPath = StringReplace($sCurrentPath, $sInitialPath, "")
    Case 2 ; Initial path included
    $sRetPath = $sCurrentPath
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    If $fSort Then

    [/autoit] [autoit][/autoit] [autoit]

    ; Get folder name
    $sName = StringRegExpReplace(StringReplace($sCurrentPath, $sInitialPath, ""), "(.+?\\)*(.+?)(\\.*?(?!\\))", "$2")

    [/autoit] [autoit][/autoit] [autoit]

    ; Get Search handle
    $hSearch = FileFindFirstFile($sCurrentPath & "*")
    ; If folder empty move to next in list
    If $hSearch = -1 Then ContinueLoop

    [/autoit] [autoit][/autoit] [autoit]

    ; Search folder
    While 1
    $sName = FileFindNextFile($hSearch)
    ; Check for end of folder
    If @error Then ExitLoop
    ; Check for file - @extended set for subfolder in 3.3.1.1 +
    If @extended Then
    ; If recursive search, add subfolder to folder list
    If $fRecur Then _RFLTA_AddToList($asFolderList, $sCurrentPath & $sName & "\")

    [/autoit] [autoit][/autoit] [autoit]

    ; Add folder name if matched against Include/Exclude masks
    If StringRegExp($sName, $sInclude_List_Mask) And Not StringRegExp($sName, $sExclude_List_Mask) Then _
    _RFLTA_AddToList($asFolderMatchList, $sRetPath & $sName & $sFolderSlash)

    [/autoit] [autoit][/autoit] [autoit]

    Else
    ; Add file name if matched against Include/Exclude masks
    If StringRegExp($sName, $sInclude_List_Mask) And Not StringRegExp($sName, $sExclude_List_Mask) Then
    If $sCurrentPath = $sInitialPath Then
    _RFLTA_AddToList($asRootFileMatchList, $sRetPath & $sName)
    Else
    _RFLTA_AddToList($asFileMatchList, $sRetPath & $sName)
    EndIf
    EndIf
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ; Close current search
    FileClose($hSearch)

    [/autoit] [autoit][/autoit] [autoit]

    Else ; No sorting required

    [/autoit] [autoit][/autoit] [autoit]

    ; Get Search handle
    $hSearch = FileFindFirstFile($sCurrentPath & "*")
    ; If folder empty move to next in list
    If $hSearch = -1 Then ContinueLoop

    [/autoit] [autoit][/autoit] [autoit]

    ; Search folder
    While 1
    $sName = FileFindNextFile($hSearch)
    ; Check for end of folder
    If @error Then ExitLoop
    ; Check for subfolder - @extended set in 3.3.1.1 +
    $fFolder = @extended

    [/autoit] [autoit][/autoit] [autoit]

    ; If recursive search, add subfolder to folder list
    If $fRecur And $fFolder Then _RFLTA_AddToList($asFolderList, $sCurrentPath & $sName & "\")

    [/autoit] [autoit][/autoit] [autoit]

    ; Check file/folder type against required return value and file/folder name against Include/Exclude masks
    If $fFolder + $iReturn <> 2 And StringRegExp($sName, $sInclude_List_Mask) And Not StringRegExp($sName, $sExclude_List_Mask) Then
    ; Add final "\" to folders
    If $fFolder Then $sName &= $sFolderSlash
    _RFLTA_AddToList($asReturnList, $sRetPath & $sName)
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ; Close current search
    FileClose($hSearch)

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    If $fSort Then

    [/autoit] [autoit][/autoit] [autoit]

    ; Check if any file/folders have been added
    If $asRootFileMatchList[0] = 0 And $asFileMatchList[0] = 0 And $asFolderMatchList[0] = 0 Then Return SetError(1, 8, "")

    [/autoit] [autoit][/autoit] [autoit]

    Switch $iReturn
    Case 2 ; Folders only
    ; Correctly size folder match list
    ReDim $asFolderMatchList[$asFolderMatchList[0] + 1]
    ; Copy size folder match array
    $asReturnList = $asFolderMatchList
    ; Simple sort list
    _RFLTA_ArraySort($asReturnList)
    Case 1 ; Files only
    If $sReturnPath = 0 Then ; names only so simple sort suffices
    ; Combine file match lists
    _RFLTA_AddFileLists($asReturnList, $asRootFileMatchList, $asFileMatchList)
    ; Simple sort combined file list
    _RFLTA_ArraySort($asReturnList)
    Else
    ; Combine sorted file match lists
    _RFLTA_AddFileLists($asReturnList, $asRootFileMatchList, $asFileMatchList, 1)
    EndIf
    Case 0 ; Both files and folders
    If $sReturnPath = 0 Then ; names only so simple sort suffices
    ; Combine file match lists
    _RFLTA_AddFileLists($asReturnList, $asRootFileMatchList, $asFileMatchList)
    ; Set correct count for folder add
    $asReturnList[0] += $asFolderMatchList[0]
    ; Resize and add file match array
    ReDim $asFolderMatchList[$asFolderMatchList[0] + 1]
    _RFLTA_ArrayConcatenate($asReturnList, $asFolderMatchList)
    ; Simple sort final list
    _RFLTA_ArraySort($asReturnList)
    Else
    ; Combine sorted file match lists
    _RFLTA_AddFileLists($asReturnList, $asRootFileMatchList, $asFileMatchList, 1)
    ; Add folder count
    $asReturnList[0] += $asFolderMatchList[0]
    ; Sort folder match list
    ReDim $asFolderMatchList[$asFolderMatchList[0] + 1]
    _RFLTA_ArraySort($asFolderMatchList)

    [/autoit] [autoit][/autoit] [autoit]

    ; Now add folders in correct place
    Local $iLastIndex = $asReturnList[0]
    For $i = $asFolderMatchList[0] To 1 Step -1
    ; Find first filename containing folder name
    Local $iIndex = _RFLTA_ArraySearch($asReturnList, $asFolderMatchList[$i])
    If $iIndex = -1 Then
    ; Empty folder so insert immediately above previous
    _RFLTA_ArrayInsert($asReturnList, $iLastIndex, $asFolderMatchList[$i])
    Else
    ; Insert folder at correct point above files
    _RFLTA_ArrayInsert($asReturnList, $iIndex, $asFolderMatchList[$i])
    $iLastIndex = $iIndex
    EndIf
    Next
    EndIf
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    Else ; No sort

    [/autoit] [autoit][/autoit] [autoit]

    ; Check if any file/folders have been added
    If $asReturnList[0] = 0 Then Return SetError(1, 8, "")

    [/autoit] [autoit][/autoit] [autoit]

    ; Remove any unused return list elements from last ReDim
    ReDim $asReturnList[$asReturnList[0] + 1]

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Return $asReturnList

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_RecFileListToArray

    [/autoit] [autoit][/autoit] [autoit]

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _RFLTA_AddToList
    ; Description ...: Add element to list which is resized if necessary
    ; Syntax ........: _RFLTA_AddToList(ByRef $asList, $sValue)
    ; Parameters ....: $asList - List to be added to
    ; $sValue - Value to add
    ; Return values .: None - array modified ByRef
    ; Author ........: Melba23
    ; Remarks .......: This function is used internally by _RecFileListToArray
    ; ===============================================================================================================================
    Func _RFLTA_AddToList(ByRef $asList, $sValue)

    [/autoit] [autoit][/autoit] [autoit]

    ; Increase list count
    $asList[0] += 1
    ; Double list size if too small (fewer ReDim needed)
    If UBound($asList) <= $asList[0] Then ReDim $asList[UBound($asList) * 2]
    ; Add value
    $asList[$asList[0]] = $sValue

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_RFLTA_AddToList

    [/autoit] [autoit][/autoit] [autoit]

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _RFLTA_AddFileLists
    ; Description ...: Add internal arrays after resizing and optional sorting
    ; Syntax ........: _RFLTA_AddFileLists(ByRef $asReturnList, $asRootFileMatchList, $asFileMatchList[, $iSort = 0])
    ; Parameters ....: $asReturnList - Base list
    ; $asRootFileMatchList - First list to add
    ; $asFileMatchList - Second list to add
    ; $iSort - (Optional) Whether to sort lists before adding
    ; |$iSort = 0 (Default) No sort
    ; |$iSort = 1 Sort in descending alphabetical order
    ; Return values .: None - array modified ByRef
    ; Author ........: Melba23
    ; Remarks .......: This function is used internally by _RecFileListToArray
    ; ===============================================================================================================================
    Func _RFLTA_AddFileLists(ByRef $asReturnList, $asRootFileMatchList, $asFileMatchList, $iSort = 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; Correctly size root file match array
    ReDim $asRootFileMatchList[$asRootFileMatchList[0] + 1]
    ; Simple sort root file match array if required
    If $iSort = 1 Then _RFLTA_ArraySort($asRootFileMatchList)
    ; Copy root file match array
    $asReturnList = $asRootFileMatchList
    ; Add file match count
    $asReturnList[0] += $asFileMatchList[0]
    ; Correctly size file match array
    ReDim $asFileMatchList[$asFileMatchList[0] + 1]
    ; Simple sort file match array if required
    If $iSort = 1 Then _RFLTA_ArraySort($asFileMatchList)
    ; Add file match array
    _RFLTA_ArrayConcatenate($asReturnList, $asFileMatchList)

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_RFLTA_AddFileLists

    [/autoit] [autoit][/autoit] [autoit]

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _RFLTA_ArraySearch
    ; Description ...: Search array downwards for partial match
    ; Syntax ........: _RFLTA_ArraySearch(Const ByRef $avArray, $vValue)
    ; Parameters ....: $avArray - Array to search
    ; $vValue - PValue to Search for
    ; Return values .: Success: Index of array in which element was found
    ; Failure: returns -1
    ; Author ........: SolidSnake, gcriaco, Ultima
    ; Modified.......: Melba23
    ; Remarks .......: This function is used internally by _RecFileListToArray
    ; ===============================================================================================================================
    Func _RFLTA_ArraySearch(Const ByRef $avArray, $vValue)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To UBound($avArray) - 1
    If StringInStr($avArray[$i], $vValue) > 0 Then Return $i
    Next
    Return -1

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_RFLTA_ArraySearch

    [/autoit] [autoit][/autoit] [autoit]

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _RFLTA_ArraySort
    ; Description ...: Wrapper for QuickSort function
    ; Syntax ........: _RFLTA_ArraySort(ByRef $avArray)
    ; Parameters ....: $avArray - Array to sort
    ; $pNew_WindowProc - Pointer to new WindowProc
    ; Return values .: None - array modified ByRef
    ; Author ........: Jos van der Zande, LazyCoder, Tylo, Ultima
    ; Modified.......: Melba23
    ; Remarks .......: This function is used internally by _RecFileListToArray
    ; ===============================================================================================================================
    Func _RFLTA_ArraySort(ByRef $avArray)

    [/autoit] [autoit][/autoit] [autoit]

    Local $iStart = 1, $iEnd = UBound($avArray) - 1
    _RFLTA_QuickSort($avArray, $iStart, $iEnd)

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_RFLTA_ArraySort

    [/autoit] [autoit][/autoit] [autoit]

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _RFLTA_QuickSort
    ; Description ...: recursive array sort
    ; Syntax ........: _RFLTA_QuickSort(ByRef $avArray, ByRef $iStart, ByRef $iEnd)
    ; Parameters ....: $avArray - Array to sort in descending alphabetical order
    ; $iStart - Start index
    ; $iEnd - End index
    ; Return values .: None - array modified ByRef
    ; Author ........: Jos van der Zande, LazyCoder, Tylo, Ultima
    ; Modified.......: Melba23
    ; Remarks .......: This function is used internally by _RFLTA_ArraySort
    ; ===============================================================================================================================
    Func _RFLTA_QuickSort(ByRef $avArray, ByRef $iStart, ByRef $iEnd)

    [/autoit] [autoit][/autoit] [autoit]

    Local $vTmp
    If ($iEnd - $iStart) < 15 Then
    Local $i, $j, $vCur
    For $i = $iStart + 1 To $iEnd
    $vTmp = $avArray[$i]
    If IsNumber($vTmp) Then
    For $j = $i - 1 To $iStart Step -1
    $vCur = $avArray[$j]
    If ($vTmp >= $vCur And IsNumber($vCur)) Or (Not IsNumber($vCur) And StringCompare($vTmp, $vCur) >= 0) Then ExitLoop
    $avArray[$j + 1] = $vCur
    Next
    Else
    For $j = $i - 1 To $iStart Step -1
    If (StringCompare($vTmp, $avArray[$j]) >= 0) Then ExitLoop
    $avArray[$j + 1] = $avArray[$j]
    Next
    EndIf
    $avArray[$j + 1] = $vTmp
    Next
    Return
    EndIf
    Local $L = $iStart, $R = $iEnd, $vPivot = $avArray[Int(($iStart + $iEnd) / 2)], $fNum = IsNumber($vPivot)
    Do
    If $fNum Then
    While ($avArray[$L] < $vPivot And IsNumber($avArray[$L])) Or (Not IsNumber($avArray[$L]) And StringCompare($avArray[$L], $vPivot) < 0)
    $L += 1
    WEnd
    While ($avArray[$R] > $vPivot And IsNumber($avArray[$R])) Or (Not IsNumber($avArray[$R]) And StringCompare($avArray[$R], $vPivot) > 0)
    $R -= 1
    WEnd
    Else
    While (StringCompare($avArray[$L], $vPivot) < 0)
    $L += 1
    WEnd
    While (StringCompare($avArray[$R], $vPivot) > 0)
    $R -= 1
    WEnd
    EndIf
    If $L <= $R Then
    $vTmp = $avArray[$L]
    $avArray[$L] = $avArray[$R]
    $avArray[$R] = $vTmp
    $L += 1
    $R -= 1
    EndIf
    Until $L > $R
    _RFLTA_QuickSort($avArray, $iStart, $R)
    _RFLTA_QuickSort($avArray, $L, $iEnd)

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_RFLTA_QuickSort

    [/autoit] [autoit][/autoit] [autoit]

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _RFLTA_ArrayConcatenate
    ; Description ...: Joins 2 arrays
    ; Syntax ........: _RFLTA_ArrayConcatenate(ByRef $avArrayTarget, Const ByRef $avArraySource)
    ; Parameters ....: $avArrayTarget - Base array
    ; $avArraySource - Array to add from element 1 onwards
    ; Return values .: None - array modified ByRef
    ; Author ........: Ultima
    ; Modified.......: Melba23
    ; Remarks .......: This function is used internally by _RecFileListToArray
    ; ===============================================================================================================================
    Func _RFLTA_ArrayConcatenate(ByRef $avArrayTarget, Const ByRef $avArraySource)

    [/autoit] [autoit][/autoit] [autoit]

    Local $iUBoundTarget = UBound($avArrayTarget) - 1, $iUBoundSource = UBound($avArraySource)
    ReDim $avArrayTarget[$iUBoundTarget + $iUBoundSource]
    For $i = 1 To $iUBoundSource - 1
    $avArrayTarget[$iUBoundTarget + $i] = $avArraySource[$i]
    Next

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_RFLTA_ArrayConcatenate

    [/autoit] [autoit][/autoit] [autoit]

    ; #INTERNAL_USE_ONLY#============================================================================================================
    ; Name...........: _RFLTA_ArrayInsert
    ; Description ...: Insert element into array
    ; Syntax ........: _RFLTA_ArrayInsert(ByRef $avArray, $iElement, $vValue = "")
    ; Parameters ....: $avArray - Array to modify
    ; $iElement - Index position for insertion
    ; $vValue - Value to insert
    ; Return values .: None - array modified ByRef
    ; Author ........: Jos van der Zande, Ultima
    ; Modified.......: Melba23
    ; Remarks .......: This function is used internally by _RecFileListToArray
    ; ===============================================================================================================================
    Func _RFLTA_ArrayInsert(ByRef $avArray, $iElement, $vValue = "")

    [/autoit] [autoit][/autoit] [autoit]

    Local $iUBound = UBound($avArray) + 1
    ReDim $avArray[$iUBound]
    For $i = $iUBound - 1 To $iElement + 1 Step -1
    $avArray[$i] = $avArray[$i - 1]
    Next
    $avArray[$iElement] = $vValue

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_RFLTA_ArrayInsert

    [/autoit]


    Diese Funktion von Melba23 aus dem EN-Forum ermöglicht das ganz einfach:
    Suchpfad: C:\
    Suchpattern: *.exe
    Rekursion an.

    lg^^

  • Bewerbung Maker v3

    • chesstiger
    • 11. Mai 2013 um 21:19

    So:
    Ausgeführt habe ich das Programm nicht, ich habe mir nur den Quellcode angeschaut (reicht ja).

    Und der ist, gelinde gesagt, unordentlich (Einrückung, Präfixe), Nicht eindeutig (Variablennamen ala $Input26) und teilweise ineffizient.
    Ich schmetter das einfach mal so raus.^^

    Tipps:
    Verwende kein Koda, sondern designe deine GUIs/Forms per Quellcode. Ordentlicher, und du bekommst ein bessere Verständnis dafür. ;)
    Die ganzen FileWrites... Einfach alles in einen String schreiben, dann diesen String per FileWrite schreiben. ;)

    Es freut mich, dass du gleich ein so großes Programm codest; dennoch zeige ich dir einfach mal unverfroren deine Fehler.
    Nimm das bitte nicht böse, es soll dir nur helfen. ^^

    lg

  • Duplikate Problem

    • chesstiger
    • 10. Mai 2013 um 15:19

    Ach, wenn's weiter nichts ist. :D

    Spoiler anzeigen
    [autoit]


    #include <File.au3>
    #include <Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $sSongliste = FileOpenDialog("Neue Liste", @ScriptDir, "Songliste (*.txt)")
    $sInterpretFile = "Interpreten.txt"

    [/autoit] [autoit][/autoit] [autoit]

    Local $aSongs, $aInterpreten_UNIQUE
    _FileReadToArray($sSongliste, $aSongs)
    Local $aInterpreten[$aSongs[0]]
    For $i = 1 To $aSongs[0]
    $aInfo = StringSplit($aSongs[$i], ";", 3)
    If UBound($aInfo) <> 2 Then ContinueLoop
    $aInterpreten[$i - 1] = $aInfo[1]
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $aInterpreten_UNIQUE = _ArrayUnique($aInterpreten)
    _ArrayDisplay($aInterpreten_UNIQUE)

    [/autoit] [autoit][/autoit] [autoit]

    _FileWriteFromArray($sInterpretFile, $aInterpreten_UNIQUE)

    [/autoit]

    Dann hast du eine ungültige Zeile ohne ";" dabei gehabt.^^

    lg

  • Duplikate Problem

    • chesstiger
    • 10. Mai 2013 um 15:11

    Was setzt _FileWriteFromArray denn für einen Fehlerwert (@error)?

    Sonst öffne die Datei mal manuell vor dem _FileWriteFromArray (Nicht vergessen, im Schreibmodus (flag = 1) zu öffnen, und danach wieder zu schließen!). ^^

    Wenn das nicht klappt: Mit einer For-Schleife selbst schreiben.

    lg

  • Duplikate Problem

    • chesstiger
    • 10. Mai 2013 um 14:40
    Spoiler anzeigen
    [autoit]


    #include <File.au3>
    #include <Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $sSongliste = FileOpenDialog("Neue Liste", @ScriptDir, "Songliste (*.txt)")
    $sInterpretFile = "Interpreten.txt"

    [/autoit] [autoit][/autoit] [autoit]

    Local $aSongs, $aInterpreten_UNIQUE
    _FileReadToArray($sSongliste, $aSongs)
    Local $aInterpreten[$aSongs[0]]
    For $i = 1 To $aSongs[0]
    $aInfo = StringSplit($aSongs[$i], ";", 3)
    $aInterpreten[$i - 1] = $aInfo[1]
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $aInterpreten_UNIQUE = _ArrayUnique($aInterpreten)
    _ArrayDisplay($aInterpreten_UNIQUE)

    [/autoit] [autoit][/autoit] [autoit]

    _FileWriteFromArray($sInterpretFile, $aInterpreten_UNIQUE)

    [/autoit]

    Verstanden, wie ich das meinte?
    Mein temporäres Array wird hier automatisch durch _FileReadToArray erzeugt. ^^

    lg

  • Duplikate Problem

    • chesstiger
    • 10. Mai 2013 um 13:15

    Alle Titel erstmal temporär in einem Array speichern, dann _ArrayUnique, dann _FileWriteFromArray.
    Fertig.^^

    lg

  • MySQL Tabelle über PHP in Listview?

    • chesstiger
    • 9. Mai 2013 um 15:01

    Dann gib sie durch ein PHP-Skript aus, rufe das mit InetRead auf, und verarbeite die Daten dann (In deinem Fall: ListView).^^

    lg

  • GDI+ CleanUp

    • chesstiger
    • 9. Mai 2013 um 11:07

    Punkt 1:
    Das war eine der Sachen, die ich noch geplant hatte.^^
    Punkt 2:
    Genau deswegen wird eine _GDIPlus_DisposeAll-Funktion erzeugt, die dann selbst an entsprechenden Punkt aufgerufen werden kann, wie ich das schon oben gemacht habe. Ich dachte, das überlasse ich lieber dem Programmierer. ^^
    Punkt 3:
    Wieso sollte IsHWnd bei einem GDI+-Objekt True zurück geben? 8|
    HWnd ist doch hWindow, also ein Fensterhandle, oder?

    lg^^

  • Gdi + Speicherprobleme?

    • chesstiger
    • 8. Mai 2013 um 22:27

    @Make Das Problem ist aber, dass der interne Counter zwischenzeitlich auf 0 steht, die Dll also freigegeben wird. ;)
    Danach, beim nächsten Aufruf, wird sie dann erneut geladen...

    lg

  • Gdi + Speicherprobleme?

    • chesstiger
    • 8. Mai 2013 um 21:57

    GDI+ nur einmal am Skriptanfang starten, und einmal am Skriptende beenden!
    Graphics gibt man mit _GDIPlus_GraphicsDispose frei.
    Bitmaps mit _GDIPlus_ImageDispose oder _GDIPlus_BitmapDispose (Müsste aber auch mit _WinAPI_DeleteObject gehen...).

    lg

  • GDI+ CleanUp

    • chesstiger
    • 8. Mai 2013 um 21:55

    Hi,

    ich fange einfach mal so an:

    Spoiler anzeigen
    [autoit]


    #include <GDIPlus.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", True)

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("GDI +", 250, 250)
    GUISetOnEvent(-3, "_Exit")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics(250, 250, $hGraphics)
    $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

    [/autoit] [autoit][/autoit] [autoit]

    $hBrush = _GDIPlus_BrushCreateSolid(0xff0000ff) ;blau

    [/autoit] [autoit][/autoit] [autoit]

    $hPen = _GDIPlus_PenCreate(0xffff00ff, 5) ;pink
    $hPen2 = _GDIPlus_PenCreate(0xffff00ff, 5) ;pink

    [/autoit] [autoit][/autoit] [autoit]

    While True
    _GDIPlus_GraphicsClear($hBuffer, 0xffffffff)

    [/autoit] [autoit][/autoit] [autoit]

    $iX = Random(0, 250 - 50, 1)
    $iY = Random(0, 250 - 50, 1)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsFillRect($hBuffer, $iX, $iY, 50, 50, $hBrush)
    _GDIPlus_GraphicsDrawRect($hBuffer, $iX, $iY, 50, 50, $hPen)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    Sleep(20)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    Exit
    EndFunc

    [/autoit]

    Und jetzt die große Preisfrage... Was fehlt? :whistling:
    Genau: Das Freigeben der Ressourcen!

    Nun, das bedeutet jetzt: Das ganze Skript nochmal durchgehen, und alle geladenen Ressourcen einzeln wieder freigeben.

    Das ist mir beim GDI+-Rumspielen so auf den Nerv gegangen (Faulheit! :party: ), dass ich mir ein Skript geschrieben habe, welches eine Dispose-Funktion erstellt.^^

    GDI+ CleanUp.au3
    [autoit]


    #include <File.au3>
    #include <String.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $sFile = $CmdLine[1]
    $sDisposeFuncName = "_GDIPlus_DisposeAll"
    $sFunctionComment = "Common GDI+ Dispose Function, created with 'GDI+ CleanUp.au3'"

    [/autoit] [autoit][/autoit] [autoit]

    $iReplCounter = 0
    Local $aLines[1]
    _FileReadToArray($sFile, $aLines)

    [/autoit] [autoit][/autoit] [autoit]

    $sCode = FileRead($sFile)
    If StringInStr($sCode, "Func " & $sDisposeFuncName & "()" & @CRLF) Then
    $sFunctionCode = _StringBetween($sCode, "Func " & $sDisposeFuncName & "()", "EndFunc")
    $sCode = StringReplace($sCode, @CRLF & @CRLF &"Func " & $sDisposeFuncName & "()" & $sFunctionCode[0] & "EndFunc", "")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $sExitFuncCode = "Func " & $sDisposeFuncName & "()" & @CRLF & @TAB & ";" & $sFunctionComment & @CRLF

    [/autoit] [autoit][/autoit] [autoit]

    For $iLine = 1 To $aLines[0]
    $sLine = StringRegExpReplace($aLines[$iLine], """(.+)""", "", 1)

    [/autoit] [autoit][/autoit] [autoit]

    If Not StringInStr($sLine, "=") Then ContinueLoop ;Keine Ressource wurde erstellt -> Abbruch

    [/autoit] [autoit][/autoit] [autoit]

    $aLR = StringSplit($sLine, "=", 2)
    $sVar = StringStripWS($aLR[0], 8)
    $sCommandLine = StringStripWS($aLR[1], 8)
    If StringLeft($sCommandLine, 9) <> "_GDIPlus_" Then ContinueLoop ;Keine GDIPlus-Zeile -> Abbruch
    $iReplCounter += 1
    $aTMP = StringSplit($sCommandLine, "(", 2)
    $sCommand = $aTMP[0]
    ;Bestimmen, welche Art von Ressource vorliegt...

    [/autoit] [autoit][/autoit] [autoit]

    Switch $sCommand
    Case "_GDIPlus_GraphicsCreateFromHWND", "_GDIPlus_GraphicsCreateFromHDC", "_GDIPlus_ImageGetGraphicsContext"
    ;Graphics
    $sDisposeCommand = "_GDIPlus_GraphicsDispose"
    Case "_GDIPlus_BitmapCreateFromFile", "_GDIPlus_BitmapCreateFromGraphics", "_GDIPlus_BitmapCreateFromHBITMAP", "_GDIPlus_BitmapCreateHBITMAPFromBitmap"
    ;Bitmaps
    $sDisposeCommand = "_GDIPlus_BitmapDispose"
    Case "_GDIPlus_ImageLoadFromFile"
    ;Images
    $sDisposeCommand = "_GDIPlus_ImageDispose"
    Case "_GDIPlus_BrushCreateSolid"
    ;Brushes
    $sDisposeCommand = "_GDIPlus_BrushDispose"
    Case "_GDIPlus_PenCreate"
    ;Pens
    $sDisposeCommand = "_GDIPlus_PenDispose"
    Case "_GDIPlus_FontCreate"
    ;Fonts
    $sDisposeCommand = "_GDIPlus_FontDispose"
    Case "_GDIPlus_FontFamilyCreate"
    ;FontFamilies
    $sDisposeCommand = "_GDIPlus_FontFamilyDispose"
    Case "_GDIPlus_MatrixCreate"
    ;Matrizen
    $sDisposeCommand = "_GDIPlus_MatrixDispose"
    Case "_GDIPlus_StringFormatCreate"
    ;StringFormat
    $sDisposeCommand = "_GDIPlus_StringFormatDispose"
    Case "_GDIPlus_ArrowCapCreate"
    ;ArrowCaps
    $sDisposeCommand = "_GDIPlus_ArrowCapDispose"
    Case Else
    ;Befehl nicht bekannt...
    ContinueLoop
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    $sExitFuncCode &= @TAB & $sDisposeCommand & "(" & $sVar & ")" & @CRLF
    ;~ ConsoleWrite("GDIPlus line found @ " & $iLine & " with: " & $sCommand & @CRLF)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $sExitFuncCode &= @TAB & "_GDIPlus_Shutdown()" & @CRLF & "EndFunc"

    [/autoit] [autoit][/autoit] [autoit]

    $sCode &= @CRLF & @CRLF & $sExitFuncCode

    [/autoit] [autoit][/autoit] [autoit]

    $hFile = FileOpen($sFile, 2)
    FileWrite($hFile, $sCode)
    FileClose($hFile)

    [/autoit] [autoit][/autoit] [autoit]

    ConsoleWrite(StringFormat("+> Es wurden %i Ressourcen verarbeitet.\n+> Dispose-Funktion: %s\n", $iReplCounter, $sDisposeFuncName))

    [/autoit]


    Bei Gelegenheit könnte man das auch noch auf die WinAPI und DllStruct's erweitern...
    Generell ist das ganze noch verbesserungswürdig, aber das kommt noch. Betrachtet es als "Beta".^^

    Nach CleanUp
    [autoit]


    #include <GDIPlus.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", True)

    [/autoit] [autoit][/autoit] [autoit]

    $hWnd = GUICreate("GDI +", 250, 250)
    GUISetOnEvent(-3, "_Exit")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()

    [/autoit] [autoit][/autoit] [autoit]

    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics(250, 250, $hGraphics)
    $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

    [/autoit] [autoit][/autoit] [autoit]

    $hBrush = _GDIPlus_BrushCreateSolid(0xff0000ff) ;blau

    [/autoit] [autoit][/autoit] [autoit]

    $hPen = _GDIPlus_PenCreate(0xffff00ff, 5) ;pink
    $hPen2 = _GDIPlus_PenCreate(0xffff00ff, 5) ;pink

    [/autoit] [autoit][/autoit] [autoit]

    While True
    _GDIPlus_GraphicsClear($hBuffer, 0xffffffff)

    [/autoit] [autoit][/autoit] [autoit]

    $iX = Random(0, 250 - 50, 1)
    $iY = Random(0, 250 - 50, 1)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsFillRect($hBuffer, $iX, $iY, 50, 50, $hBrush)
    _GDIPlus_GraphicsDrawRect($hBuffer, $iX, $iY, 50, 50, $hPen)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
    Sleep(20)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    _GDIPlus_DisposeAll()
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _GDIPlus_DisposeAll()
    ;Common GDI+ Dispose Function, created with 'GDI+ CleanUp.au3'
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_PenDispose($hPen2)
    _GDIPlus_Shutdown()
    EndFunc

    [/autoit]


    Der Dispose-Funktionsname und der Kommentar lassen sich im Skript natürlich anpassen (#ToDo: In INI auslagern und Konfigurationsoberfläche implementieren).^^

    Was natürlich noch fehlt:
    Die Einbindung in SciTE (Hier ein Danke an BugFix, ohne den wäre ich an dem Lua-Kram gescheitert :D).
    SciTEUser.properties

    Code
    command.name.36.$(au3)=GDI+ CleanUp
    command.36.*.au3="$(autoit3dir)\autoit3.exe" "$(SciteDefaultHome)\GDI+ CleanUp.au3" "$(FilePath)"
    command.mode.36.*=savebefore:yes
    command.shortcut.36.*.au3=Ctrl+Alt+G


    Gegebenenfalls dann den Pfad anpassen (Hier würde die Datei im SciTE-Ordner liegen).^^

    Have Fun,

    chess

  • Unvergessliche Geschichten/About your life

    • chesstiger
    • 8. Mai 2013 um 00:19

    Von Staplern, Brennspiritus & Feuer...

    Spoiler anzeigen


    General Kaboom hat es ja schon erwähnt, ich habe in der SB von einer Geschichte angefangen... Und er hat mich ja auch explizit aufgefordert, mal alles zu erzählen. :D

    Vorab: Wir haben einen recht großen Familienbetrieb (Großhandel, spezialisiert auf Obst & Gemüse), in dem ich mich seit eh und jeh frei bewege.
    So auch damals, ich muss ungefähr 6 Jahre alt gewesen sein... Ich war mit meinem Vater in der Firma, und bin alleine in der Halle rumgerannt... Bis dato hatte mich immer der große Stapler fasziniert... Und an diesem Tag habe ich ihn dann ausprobiert. Ich habe mich reingesetzt (Bzw. gestellt, um an die Pedale zu kommen), Schlüssel umgedreht und Vollgas gegeben. :D Dabei habe ich dann einen von den Angestellten über den Haufen gefahren... Nichts ernstes, nur eine Quetschung im Fuß, kaputte Brille, Prellung am Arm (Vom Umfallen) und eine Menge Angst vor kleinen Kindern auf Staplern. :D
    Naja, während sich dann alle um den Verletzen scharrten, und ich einen kleinen Einlauf von meinem Vater bekommen hatte, habe ich mich dann in die hinterste Abteilung von der Halle verzogen: Die Feuer & Brennspiritus-Abteilung. 8o
    Ich habe mir ein paar Kartons aus dem Müll geholt, habe mich gemütlich in die Ecke gesetzt, einen ordentlichen Schuss Brennspiritus darauf gegeben, die offene Flasche ca. 20 cm daneben stehen gelassen und das ganze angezündet. Nebenbei... Knapp neben der offenen Flasche standen 5 x 20er Packs von diesen Flaschen... Die Kettenreaktion ist, denk' ich mal, offensichtlich. :D Zum Glück fand mich mein Vater durch den durchdringenden Feuergeruch und die Rauchwolken unter der Decke, bevor etwas wirklich schlimmes wie die oben beschriebene Kettenreaktion zustande kam. :D

    Ich habe noch einen Haufen mehr Geschichten, keine Angst. :D

    @GK :rofl:

    lg^^

  • Schriftart unter Benutzer ohne Adminrechte installieren

    • chesstiger
    • 7. Mai 2013 um 15:48

    Achso, sorry, nicht richtig gelesen.

    Das geht (soviel ich weiß) leider nicht.
    Die UAC (User Account Control) verbietet das. Während der Passworteingabe wird jedes Skript blockiert...
    Du kannst allerhöchstens die UAC komplett deaktivieren (Nicht zu empfehlen).

    lg

  • Schriftart unter Benutzer ohne Adminrechte installieren

    • chesstiger
    • 7. Mai 2013 um 14:59

    #requireAdmin an den Skriptanfang.^^

    lg

  • Anzahl der Vorkommen eines Strings in txt

    • chesstiger
    • 6. Mai 2013 um 15:06
    [autoit]


    $sString = "Bla..."
    $sFile = "DeineDatei.txt"

    [/autoit][autoit][/autoit][autoit]

    StringReplace(FileRead($sFile), $sString, "")
    $iCount = @extended
    MsgBox(0, "", "Vorkommen: " & $iCount)

    [/autoit]

    So?^^

    lg

  • Input ÜBER eine Grafik legen?

    • chesstiger
    • 5. Mai 2013 um 21:48

    Dann nimm eine Child-GUI.^^

    lg

  • Input ÜBER eine Grafik legen?

    • chesstiger
    • 5. Mai 2013 um 21:41

    Nein, aber wenn ich die Prinzipien von GDI+ und der WinAPI richtig in Erinnerung habe...

    Probier's aus.
    Unter die Zeile, wo das Pic-Control erstellt wird, GUICtrlSetState(-1, $GUI_DISABLE)

    lg

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™