Ver Mensaje Individual
  #4  
Antiguo 08-11-2006
Avatar de seoane
[seoane] seoane is offline
Miembro Premium
 
Registrado: feb 2004
Ubicación: A Coruña, España
Posts: 3.717
Reputación: 24
seoane Va por buen camino
Bicho, me ganaste por segundos

Código Delphi [-]
const
  CSIDL_PROFILE = 40;
  SHGFP_TYPE_CURRENT = 0;

function SHGetFolderPath(hwndOwner: HWND;
  nFolder: Integer;
  hToken: THandle;
  dwFlags: DWORD;
  pszPath: LPTSTR): HRESULT; stdcall;
  external 'Shell32.dll' name 'SHGetFolderPathA';

function GetUserProfile: string;
var
  Buffer: array[0..MAX_PATH] of Char;
begin
  FillChar(Buffer, SizeOf(Buffer), 0);
  SHGetFolderPath(0, CSIDL_PROFILE, 0, SHGFP_TYPE_CURRENT, Buffer);
  Result := String(PChar(@Buffer));
end;

Responder Con Cita