GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||
GeezerVison is showing learn.microsoft.com — SHGetKnownFolderPath function (shlobj_core.h) - Win32 apps Note Access to this page requires authorization. You can try signing in or changing directories. Access to this page requires authorization. You can try changing directories. SHGetKnownFolderPath function (shlobj_core.h)Retrieves the full path of a known folder identified by the folder's KNOWNFOLDERID. Syntax
Parameters
Type: REFKNOWNFOLDERID A reference to the KNOWNFOLDERID that identifies the folder.
Type: DWORD Flags that specify special retrieval options. This value can be 0; otherwise, one or more of the KNOWN_FOLDER_FLAG values.
Type: HANDLE An access token that represents a particular user. If this parameter is NULL, which is the most common usage, the function requests the known folder for the current user. Request a specific user's folder by passing the hToken of that user. This is typically done in the context of a service that has sufficient privileges to retrieve the token of a given user. That token must be opened with TOKEN_QUERY and TOKEN_IMPERSONATE rights. In some cases, you also need to include TOKEN_DUPLICATE. In addition to passing the user's hToken, the registry hive of that specific user must be mounted. See Access Control for further discussion of access control issues. Assigning the hToken parameter a value of -1 indicates the Default User. This allows clients of SHGetKnownFolderPath to find folder locations (such as the Desktop folder) for the Default User. The Default User user profile is duplicated when any new user account is created, and includes special folders such as Documents and Desktop. Any items added to the Default User folder also appear in any new user account. Note that access to the Default User folders requires administrator privileges.
Type: PWSTR* When this method returns, contains the address of a pointer to a null-terminated Unicode string that specifies the path of the known folder. The calling process is responsible for freeing this resource once it is no longer needed by calling CoTaskMemFree, whether SHGetKnownFolderPath succeeds or not. The returned path does not include a trailing backslash. For example, "C:\Users" is returned rather than "C:\Users\". Return valueType: HRESULT Returns S_OK if successful, or an error value otherwise, including the following:
RemarksThis function replaces SHGetFolderPath. That older function is now simply a wrapper for SHGetKnownFolderPath. Requirements
See alsoFeedbackWas this page helpful? NoAdditional resources
| ||||||||||||||||||||
| You are visitor 01402894 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |