lazfileutils: added windows function SHGetFolderPathUTF8

git-svn-id: trunk@51881 -
This commit is contained in:
mattias 2016-03-09 13:15:53 +00:00
parent 7d3a022290
commit 69de6012ba
2 changed files with 9 additions and 4 deletions

View File

@ -139,6 +139,11 @@ function GetDarwinSystemFilename(Filename: string): string;
function GetDarwinNormalizedFilename(Filename: string; nForm:Integer=2): string;
{$ENDIF}
// windows paths
{$IFDEF windows}
function SHGetFolderPathUTF8(ID : Integer) : String;
{$ENDIF}
procedure SplitCmdLineParams(const Params: string; ParamList: TStrings;
ReadBackslash: boolean = false);
function StrToCmdLineParam(const Param: string): string;

View File

@ -361,7 +361,7 @@ end;
{$IFDEF WINCE}
// In WinCE these API calls are in Windows unit
function GetWindowsSpecialDirW(ID : Integer) : String;
function SHGetFolderPathUTF8(ID : Integer) : String;
Var
APath : Array[0..MAX_PATH] of WideChar;
WS: WideString;
@ -415,7 +415,7 @@ begin
Raise Exception.Create('Could not determine SHGetFolderPathW Function');
end;
function GetWindowsSpecialDirW(ID : Integer) : String;
function SHGetFolderPathUTF8(ID : Integer) : String;
Var
APath : Array[0..MAX_PATH] of WideChar;
WS: WideString;
@ -453,9 +453,9 @@ const
CSIDL_LOCAL = {$IFDEF WINCE}CSIDL_APPDATA{$ELSE}CSIDL_LOCAL_APPDATA{$ENDIF};
begin
If Global then
Result := GetWindowsSpecialDirW(CSIDL_GLOBAL)
Result := SHGetFolderPathUTF8(CSIDL_GLOBAL)
else
Result := GetWindowsSpecialDirW(CSIDL_LOCAL);
Result := SHGetFolderPathUTF8(CSIDL_LOCAL);
If (Result <> '') then
begin
if VendorName <> '' then