How to determine the path to the users Application Data

106 49
For example, something that would return the string: 'C:\Documents and Settings\[username]\Application Data\', for the currently logged Windows user, when queried?

Valid only on Windows NT/2K/XP.

uses ShFolderPath; ... function LocalAppDataPath : string; const    SHGFP_TYPE_CURRENT = 0; var    path: array [0..MAX_PATH] of char; begin    SHGetFolderPath(0,CSIDL_LOCAL_APPDATA,0,SHGFP_TYPE_CURRENT,@path[0]) ;    Result := path; end;

Delphi tips navigator:
» Hiding the cursor from the screen
« How to draw rotated text

Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.