 |
SHGetFolderPath ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
Takes the CSIDL of a folder and returns the pathname. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
HRESULT SHGetFolderPath(
HWND hwndOwner,
int nFolder,
HANDLE hToken,
DWORD dwFlags,
LPTSTR pszPath
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE SHORT SHGetFolderPath IN shell32;
INTEGER hwndOwner,;
INTEGER nFolder,;
INTEGER hToken,;
INTEGER dwFlags,;
STRING @pszPath
|
 |
 |
 |
| Parameters: |
 |
hwndOwner
[in] Handle to an owner window. This parameter is typically set to NULL.
nFolder
[in] A CSIDL value that identifies the folder whose path is to be retrieved.
hToken
[in]
An access token that can be used to represent a particular user.
dwFlags
[in] Flags to specify which path is to be returned.
pszPath
[out] Pointer to a null-terminated string of length MAX_PATH which will receive the path. |
 |
 |
| Return value: |
 |
| Returns standard HRESULT codes, including the following: S_FALSE, E_FAIL, E_INVALIDARG, SUCCESS (0). |
 |
 |
| Usage: |
 |
cBuffer = Repli(Chr(0), MAX_PATH)
IF SHGetFolderPath(0, nFlag, nToken,;
SHGFP_TYPE_CURRENT, @cBuffer) = 0
cPath = STRTRAN(cBuffer, Chr(0), "")
ENDIF
|
 |
 |
| My comment: |
 |
CSIDL values provide a unique system-independent way to identify special folders used frequently by applications, but which may not have the same name or location on any given system. For example, the system folder may be "C:\Windows" on one system and "C:\Winnt" on another.
CSIDL list.
For Windows versions 98, NT4 the SHGetFolderPath is obtained through SHFolder.dll, not through Shell32.dll.
SHFolder.dll continues to be included for backward compatibility, though the function is now implemented in Shell32.dll.
See also: SHGetSpecialFolderLocation, SHGetKnownFolderPath, SHGetPathFromIDList |
 |
 |
| Word Index links for the SHGetFolderPath : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2003-07-16 17:37:43 | | Modified: | 2011-01-20 08:31:27 | Visited in last 7 days: 21 |