(Gast)
n/a Beiträge
|
AW: Parsen von EnvironmentPath
14. Aug 2018, 14:15
So geht's jetzt!
Delphi-Quellcode:
function TShortCut.ExpandEnvironment(EnvironmentPath: PWideChar): PWideChar;
var
lpDest: array [0 .. 32768] of WideChar;
begin
result := '';
FillChar(lpDest, SizeOf(lpDest), 0);
if ExpandEnvironmentStringsW(PWideChar(EnvironmentPath), lpDest, 32767) <> 0 then
result := lpDest;
end;
Delphi-Quellcode:
sTmpWork := GetExePath(Trim(ParseThis(sBF, ',', 3)), ExtractFilePath(sShellTo));
if sTmpWork > '' then
begin
SplitID := Split(sTmpWork, '\');
if LeftStr(SplitID[High(SplitID)], 1) = '%' then
sWorkDir := ExpandEnvironment(PWideChar(SplitID[High(SplitID)] + '\'))
else
sWorkDir := sTmpWork;
end else
sWorkDir := sTmpWork;
Danke für die Hilfe
gruss
Geändert von EWeiss (14. Aug 2018 um 14:55 Uhr)
|
|
Zitat
|