mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-21 23:19:29 +02:00
lazfileutils: added windows function SHGetFolderPathUTF8
git-svn-id: trunk@51881 -
This commit is contained in:
parent
7d3a022290
commit
69de6012ba
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user