BOOL SHGetSpecialFolderPath( HWND hwndOwner, LPTSTR lpszPath, int nFolder, BOOL fCreate );Parameters hwndOwner Handle to the owner window the client should specify if it displays a dialog box or message box. lpszPath 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. nFolder A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail. fCreate 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.CSIDL_PERSONAL File system directory that serves as a common repository for documents. A typical path is C:\Documents and Settings\username\My Documents. This should be distinguished from the virtual My Documents folder in the namespace. To access that virtual folder, use the technique described in Managing the File System.
HWND hwndOwner,
LPTSTR lpszPath,
int nFolder,
BOOL fCreate
);Parameters
hwndOwner
Handle to the owner window the client should specify if it displays a dialog box or message box.
lpszPath
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.
nFolder
A CSIDL that identifies the folder of interest. If a virtual folder is specified, this function will fail.
fCreate
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.CSIDL_PERSONAL
File system directory that serves as a common repository for documents. A typical path is C:\Documents and Settings\username\My Documents. This should be distinguished from the virtual My Documents folder in the namespace. To access that virtual folder, use the technique described in Managing the File System.
#pragma comment(lib, "shell32.lib")TCHAR szPath[MAX_PATH];
SHGetSpecialFolderPath(NULL, szPath, CSIDL_COMMON_DOCUMENTS, FALSE);
// szPath 就是