windows中目录字符串处理函数, MSDN里有使用的例子
2012-01-01 15:30
771 查看
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.
相关文章推荐
- 字符串处理函数详细使用例子
- !!! C++/CLI中使用using namespace System::Windows::Forms;+MessageBox报错---最重要的是看MSDN 每个函数的使用例子
- PHP图片处理之使用imagecopyresampled函数实现图片缩放例子
- PHP图片处理之使用imagecopyresampled函数裁剪图片例子
- JavaScript 字符串处理函数使用小结
- 字符串处理函数sscanf的使用(某些程度上替代正则表达式,很强大)
- PHP图片处理之使用imagecopyresampled函数裁剪图片例子
- C库函数使用与总结之字符串处理函数
- DELPHI字符串处理函数大全(收藏在此方便以后查找使用)
- 使用PL SQL 编写一个逗号分割字符串分割处理函数
- 【原创】字符串处理函数使用和结果
- JavaScript 字符串处理函数使用小结
- Windows内核函数(1) - 字符串处理函数
- PHP图片处理之使用imagecopyresampled函数实现图片缩放例子
- Ruby中常用的字符串处理函数使用实例
- SQL Server 字符串处理函数大全(例子)
- PHP - Manual手册 - CLXI. String 字符串处理函数 - str_pad使用另一个字符串将一个字符串填充到指定长度
- 浅析python 内置字符串处理函数的使用方法
- C语言:使用链表实现的可变长度字符串处理函数
- 常见的c字符串处理函数的源代码以及简单例子【2】