AuthorMessage
Meka][Meka
Unstopable
Posts: 700

here a little function ive wrote to find sys/win/ or temp dir
simple usage like so:
Code:

FindPath('Windows');

things u can use are as follows
S, System = System Dir
T, Temp = Temp Path
W, Windows = Windows Dir
Code:
//Find path Meka][Meka Util
function TMainFRM.FindPath(dir : string): string;
var
  i:Integer;
begin
  SetLength( dir, MAX_PATH );
  if dir[1] = 'W' then // windows
    i := GetWindowsDirectory( pChar(dir), MAX_PATH )
  else if dir[1] = 'S' then
    i := GetSystemDirectory( pChar(dir), MAX_PATH )
  else if dir[1] = 'T' then
    i := GetTempPath( MAX_PATH, pChar(dir) )
  else
      i := 0;
  if i > 0 then
    SetLength( dir, i )
  else
    dir := 'Unknown';
  Result := dir;
end;

-//Meka][Meka