1
uses
2 ShlObj;
3
4 procedure TForm1.Button1Click(Sender: TObject);
5 var
6 pItem: PItemIDList;
7 sPath: array [ 0 ..MAX_PATH - 1 ] of Char;
8 begin
9 { <user name>\Application Data }
10 SHGetSpecialFolderLocation(Handle, CSIDL_APPDATA, pItem);
11 FillChar(sPath, SizeOf(sPath), 0 );
12 SHGetPathFromIDList(pItem, sPath);
13 ShowMessage(StrPas(sPath));
14 end ;
2 ShlObj;
3
4 procedure TForm1.Button1Click(Sender: TObject);
5 var
6 pItem: PItemIDList;
7 sPath: array [ 0 ..MAX_PATH - 1 ] of Char;
8 begin
9 { <user name>\Application Data }
10 SHGetSpecialFolderLocation(Handle, CSIDL_APPDATA, pItem);
11 FillChar(sPath, SizeOf(sPath), 0 );
12 SHGetPathFromIDList(pItem, sPath);
13 ShowMessage(StrPas(sPath));
14 end ;