>  how can an application know at run time the complete path of the "Program
>files" directory, ( for all languages).
>
> Also, is there a way to know the path of the start-menu directory where
>programs shorcuts are installed to be accessible from the START Windows
>menu?

I posted a similar query to this list quite a while back to find the name of the
MyDocuments dir. in the any language OS. The following is the function that I 
now use
as a result of the replies.
-------------------
function GetMyDocs: string ;
// Needs "shlobj, windows" in USES clause
var
  ppidl: PItemIdList;
  PerDir: string;
begin
  ppidl := nil;
  SHGetSpecialFolderLocation(0, CSIDL_PERSONAL, ppidl);
  SetLength(perdir, MAX_PATH);
  if not SHGetPathFromIDList(ppidl, PChar(perdir)) then
        raise exception.create('Could not find your default documents folder');
  //endif
  SetLength(perdir, lStrLen(PChar(perdir)));
  Result := perdir ;
end;
-----------------

To get the programmes folder just substitute CSIDL_PROGRAMS for
CSIDL_PERSONAL

Regards,

Tony Foale
Espa�a/Spain

www.tonyfoale.com

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to