查注册表:
HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/Shell Folders
Personal
函数:
function GetMyDocuments: String;
var
R: TRegistry;
begin
R := TRegistry.Create;
R.RootKey := HKEY_CURRENT_USER;
R.CreateKey('/Software/Microsoft/Windows/CurrentVersion/Explorer/Shell Folders');
R.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Explorer/Shell Folders', False);
Result := R.ReadString('Personal');
R.Free;
end;