#Region - TimeStamp ; 2012-08-12 13:23:48 #EndRegion - TimeStamp ;=============================================================================== ; Function Name....: _GetFolderLocalized ; Description......: Returns localized folder name for german counterpart ; Parameter(s).....: German folder name as follows: ; .................: 'Programme' ; .................: 'Programme (x86)' ; .................: 'Startmenü' ; .................: 'Autostart' ; .................: 'Eigene Bilder' ; .................: 'Eigene Dokumente' ; .................: 'Eigene Musik' ; .................: 'Eigene Videos' ; .................: 'Öffentliche Bilder' ; .................: 'Öffentliche Dokumente' ; .................: 'Öffentliche Musik' ; .................: 'Öffentliche Videos' ; Requirement(s)...: Windows 7 ; Return Value(s)..: Localized folder name, by using installed system language ; Author(s)........: BugFix ( bugfix@autoit.de ) ;=============================================================================== Func _GetFolderLocalized($_sFolderGER) Local $sDrive = StringLeft(@WindowsDir, 1) Local $sUser = @UserName Local $iIndex = -1 Local $aFolder[12][2] = [ _ ['Programme' , $sDrive & ':\Program Files' ], _ ['Programme (x86)' , $sDrive & ':\Program Files (x86)' ], _ ['Startmenü' , $sDrive & ':\Users\' & $sUser & '\AppData\Roaming\Microsoft\Windows\Start Menu' ], _ ['Autostart' , $sDrive & ':\Users\' & $sUser & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup'], _ ['Eigene Bilder' , $sDrive & ':\Users\' & $sUser & '\Pictures' ], _ ['Eigene Dokumente' , $sDrive & ':\Users\' & $sUser & '\Documents' ], _ ['Eigene Musik' , $sDrive & ':\Users\' & $sUser & '\Music' ], _ ['Eigene Videos' , $sDrive & ':\Users\' & $sUser & '\Videos' ], _ ['Öffentliche Bilder' , $sDrive & ':\Users\Public\Pictures' ], _ ['Öffentliche Dokumente' , $sDrive & ':\Users\Public\Documents' ], _ ['Öffentliche Musik' , $sDrive & ':\Users\Public\Music' ], _ ['Öffentliche Videos' , $sDrive & ':\Users\Public\Videos' ]] For $i = 0 To 11 If $aFolder[$i][0] = $_sFolderGER Then $iIndex = $i ExitLoop EndIf Next If $iIndex = -1 Then Return SetError(1, 0, 0) Local $sPathIni = $aFolder[$iIndex][1] & '\desktop.ini' Local $fh = FileOpen($sPathIni), $sLine, $iNumber = -1 While 1 $sLine = FileReadLine($fh) If @error = -1 Then ExitLoop If StringInStr($sLine, 'LocalizedResourceName') Then $iNumber = StringRegExpReplace($sLine, '(.+shell32\.dll,-)(\d+)\z', '$2') ExitLoop EndIf WEnd FileClose($fh) If $iNumber = -1 Then Return SetError(2, 0, 0) Local $aRet = DllCall("kernel32.dll", "handle", "LoadLibraryExW", "wstr", "shell32.dll", "ptr", 0, "dword", 0x02) If @error Then Return SetError(@error, @extended, 0) Local $hDll = $aRet[0] $aRet = DllCall("user32.dll", "int", "LoadStringW", "handle", $hDll, "uint", $iNumber, "wstr", "", "int", 4096) If @error Then Return SetError(@error, @extended, 0) Local $sLocale = $aRet[3] DllCall("kernel32.dll", "bool", "FreeLibrary", "handle", $hDll) Return $sLocale EndFunc ;==>_GetFolderLocalized