PathSearchAndQualify Function
Determines if a given path is correctly formatted and fully qualified.
Syntax
BOOL PathSearchAndQualify( LPCTSTR pcszPath, LPTSTR pszFullyQualifiedPath, UINT cchFullyQualifiedPath );
Parameters
pcszPath
- [in] Pointer to a null-terminated string of maximum length MAX_PATH that contains the path to search.
pszFullyQualifiedPath- [out] Pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be referenced.
cchFullyQualifiedPath- [in] Width of the path pointed to by pszFullyQualifiedPath, in characters.
Return Value
Returns TRUE if the path is qualified, or FALSE otherwise.
PathSetDlgItemPath Function
Sets the text of a child control in a window or dialog box, using PathCompactPath to make sure the path fits in the control.
Syntax
void PathSetDlgItemPath( HWND hDlg, int id, LPCSTR pszPath );
Parameters
hDlg
- [in] Handle to the dialog box or window.
id- [in] Identifier of the control.
pszPath- [in] Pointer to a null-terminated string of maximum length MAX_PATH that contains the path to set in the control.
Return Value
No return value.
PathSkipRoot Function
Parses a path, ignoring the drive letter or Universal Naming Convention (UNC) server/share path parts.
Syntax
LPTSTR PathSkipRoot( LPCTSTR pszPath );
Parameters
pszPath
- [in, out] Pointer to a null-terminated string of maximum length MAX_PATH that contains the path to parse.
Return Value
Returns the address of the beginning of the subpath that follows the root (drive letter or UNC server/share).PathUndecorate Function
Removes the decoration from a path string.
Syntax
void PathUndecorate( LPTSTR pszPath );Parameters
pszPath
- [in] Null-terminated string that contains the path. When the function returns, pszPath points to the undecorated string.
Return Value
No return value.Remarks
A decoration consists of a pair of square brackets with one or more digits in between, inserted immediately after the base name and before the file name extension.
Example
The following table illustrates how strings are modified by PathUndecorate.
Initial String Undecorated String C:\Path\File[5].txt C:\Path\File.txt C:\Path\File[12] C:\Path\File C:\Path\File.txt C:\Path\File.txt C:\Path\[3].txt C:\Path\[3].txt
PathStripPath Function
Removes the path portion of a fully qualified path and file.
Syntax
void PathStripPath( LPTSTR pszPath );Parameters
pszPath
- [in, out] Pointer to a null-terminated string of maximum length MAX_PATH that contains the path and file name that will have the path portion removed.
Return Value
No return value.
PathStripToRoot Function
Removes all parts of the path except for the root information.
Syntax
BOOL PathStripToRoot( LPTSTR szRoot );
Parameters
szRoot
- [in, out] Pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be converted.
Return Value
Returns TRUE if a valid drive letter was found in the path, or FALSE otherwise.