mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 19:39:18 +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;
|
function GetDarwinNormalizedFilename(Filename: string; nForm:Integer=2): string;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
// windows paths
|
||||||
|
{$IFDEF windows}
|
||||||
|
function SHGetFolderPathUTF8(ID : Integer) : String;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure SplitCmdLineParams(const Params: string; ParamList: TStrings;
|
procedure SplitCmdLineParams(const Params: string; ParamList: TStrings;
|
||||||
ReadBackslash: boolean = false);
|
ReadBackslash: boolean = false);
|
||||||
function StrToCmdLineParam(const Param: string): string;
|
function StrToCmdLineParam(const Param: string): string;
|
||||||
|
@ -361,7 +361,7 @@ end;
|
|||||||
|
|
||||||
{$IFDEF WINCE}
|
{$IFDEF WINCE}
|
||||||
// In WinCE these API calls are in Windows unit
|
// In WinCE these API calls are in Windows unit
|
||||||
function GetWindowsSpecialDirW(ID : Integer) : String;
|
function SHGetFolderPathUTF8(ID : Integer) : String;
|
||||||
Var
|
Var
|
||||||
APath : Array[0..MAX_PATH] of WideChar;
|
APath : Array[0..MAX_PATH] of WideChar;
|
||||||
WS: WideString;
|
WS: WideString;
|
||||||
@ -415,7 +415,7 @@ begin
|
|||||||
Raise Exception.Create('Could not determine SHGetFolderPathW Function');
|
Raise Exception.Create('Could not determine SHGetFolderPathW Function');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetWindowsSpecialDirW(ID : Integer) : String;
|
function SHGetFolderPathUTF8(ID : Integer) : String;
|
||||||
Var
|
Var
|
||||||
APath : Array[0..MAX_PATH] of WideChar;
|
APath : Array[0..MAX_PATH] of WideChar;
|
||||||
WS: WideString;
|
WS: WideString;
|
||||||
@ -453,9 +453,9 @@ const
|
|||||||
CSIDL_LOCAL = {$IFDEF WINCE}CSIDL_APPDATA{$ELSE}CSIDL_LOCAL_APPDATA{$ENDIF};
|
CSIDL_LOCAL = {$IFDEF WINCE}CSIDL_APPDATA{$ELSE}CSIDL_LOCAL_APPDATA{$ENDIF};
|
||||||
begin
|
begin
|
||||||
If Global then
|
If Global then
|
||||||
Result := GetWindowsSpecialDirW(CSIDL_GLOBAL)
|
Result := SHGetFolderPathUTF8(CSIDL_GLOBAL)
|
||||||
else
|
else
|
||||||
Result := GetWindowsSpecialDirW(CSIDL_LOCAL);
|
Result := SHGetFolderPathUTF8(CSIDL_LOCAL);
|
||||||
If (Result <> '') then
|
If (Result <> '') then
|
||||||
begin
|
begin
|
||||||
if VendorName <> '' then
|
if VendorName <> '' then
|
||||||
|
Loading…
Reference in New Issue
Block a user