Windows provides special folders for such data. The folder to be used depends on the type of the data (user specific or app specific).
Use the
SHGetKnownFolderPath function (Windows)[
^] to get the path for such folders and append the name of your application. Before storing data the first time you must create the folder.
Depending on your type of data, these folder IDs may be used (see
KNOWNFOLDERID (Windows)[
^] for a complete list):
Per user (not accessible by other users)
FOLDERID_Documents
(
%USERPROFILE%\Documents)
For personal documents created by your application.
FOLDERID_LocalAppData
(
%USERPROFILE%\AppData\Local)
For user specific application data (e.g. settings).
FOLDERID_RoamingAppData
(
%USERPROFILE%\AppData\Roaming)
As above but for domain login accounts (data shared when logged in on multiple systems).
For all users
FOLDERID_ProgramData
For system wide application data.
FOLDERID_PublicDocuments
For public (shared) documents created by your application.