get "application data" directory in xp, vista
as you know, some folder has different path in winxp and vista.
i get path for application data directory (in winxp, but appdata in vista) using SHGetSpecialFolderPath api function.
then nFolder has const variable like "CSIDL_LOCAL_APPDATA" for getting path for winxp.
BOOL SHGetSpecialFolderPath( HWND hwndOwner,
Handle to the owner window the client should specify if it displays a dialog box or message box.
Pointer to a null-terminated string that receives the drive and path of the specified folder. This buffer must be at least MAX_PATH characters in size.
A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.
Indicates if the folder should be created if it does not already exist. If this value is nonzero, the folder will be created. If this value is zero, the folder will not be created.
but this value dont work in vista.
can you suggest how to solve this problem?
any help will be appreciate.