Problem scheint gelöst zu sein, zumindest erhalte ich jetzt immer die richtigen Ergebnisse.
Code
Func _FindDuplicates($sPath)
Local $aFiles, $aFind, $aRet
$aFiles = _FileListToArrayRec($sPath, "*", 1, 1, 0, 0)
For $i = 1 To $aFiles[0]
$aFind = _ArrayFindAll($aFiles, $aFiles[$i])
If UBound($aFind) <> 1 Then
If Not StringInStr($aRet, $aFiles[$i]) Then $aRet &= $aFiles[$i] & "|"
EndIf
Next
$aRet = StringSplit(StringTrimRight($aRet, 1), "|")
Return $aRet
EndFunc
Func _CreatePath($sPath, $idParent, $aDupl)
Local $aFolder, $aFiles, $idItem, $aPath
If StringRight($sPath, 1) <> '\' Then $sPath &= '\'
$aFolder = _FileListToArray($sPath, '*', $FLTA_FOLDERS)
If Not @error Then
For $i = 1 To $aFolder[0]
$idItem = GUICtrlCreateTreeViewItem($aFolder[$i], $idParent)
GUICtrlSetColor(-1, 0x098902)
$aPath = _FileListToArrayRec($sPath & $aFolder[$i], "*", 1, 1, 0, 0)
For $s = 1 To $aPath[0]
_ArraySearch($aDupl, $aPath[$s])
If Not @error Then GUICtrlSetColor($idItem, 0xf41e0e)
Next
GUICtrlSetImage(-1, "shell32.dll", 4)
_CreatePath($sPath & $aFolder[$i], $idItem, $aDupl)
Next
EndIf
$aFiles = _FileListToArray($sPath, '*', $FLTA_FILES)
If @error Then Return
For $i = 1 To $aFiles[0]
$idItem = GUICtrlCreateTreeViewItem($aFiles[$i], $idParent)
GUICtrlSetImage(-1, @ScriptDir & "\tools\icon.ico")
GUICtrlSetColor(-1, 0x098902)
_ArraySearch($aDupl, $aFiles[$i])
If Not @error Then GUICtrlSetColor($idItem, 0xf41e0e)
Next
EndFunc
Alles anzeigen
Ergebnis: