Registriert seit: 30. Jan 2005
Ort: Münster
745 Beiträge
Delphi 3 Professional
|
Re: "Arbeitsplatz" in der Sprache des installierte
18. Nov 2006, 22:36
Hallo,
mach auch mal einen Vorschlag:
Delphi-Quellcode:
uses
//...
shlobj, activex;
//...
function Get_CSIDL_DRIVES_Name : String;
var IMyShellFolder :ISHELLFOLDER;
IDL : PItemIDList;
DisName : TStrRet;
pMalloc : IMalloc;
begin
result:=' ';
if SHGetMalloc(pMalloc) <> NO_ERROR then
exit;
if Succeeded(SHGetSpecialFolderLocation(0, CSIDL_DRIVES, IDL)) then
if Succeeded(SHGetDesktopFolder(IMyShellFolder)) then
if Succeeded(IMyShellFolder.GetDisplayNameOf(IDL,SHGDN_NORMAL, DisName)) then
case DisName.uType of
STRRET_WSTR : result := WideCharToString(DisName.pOleStr);
STRRET_OFFSET : result := String(PChar(longint(IDL) + DisName.uOffset));
STRRET_CSTR : result := DisName.cStr;
end;
pMalloc.Free(IDL);
end;
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
|
|
Zitat
|