网站首页  词典首页

请输入您要查询的函数:

 

术语 getlongpathname
释义 GetLongPathName
语法:
C++
DWORD WINAPI GetLongPathName(
__in LPCTSTR lpszShortPath,
__out LPTSTR lpszLongPath,
__in DWORD cchBuffer
);
GetLongPathName功能
将指定的路径,其长期的形式。
作为一个要执行此操作的事务操作,请使用GetLongPathNameTransacted功能。
有关文件和路径名信息,请参见命名一个文件。
参数
lpszShortPath [in]
路径转换。
在此函数的ANSI版本,名称被限制为MAX_PATH字符。为了延长此限制,以32,767宽字符,调用的功能和前面加上“\\ Unicode版本\\?\\”的路径。有关更多信息,请参见命名一个文件。
lpszLongPath [out]
一个缓冲区指针接受的漫长道路。
您可以使用相同的缓冲区您为lpszShortPath参数。
cchBuffer [in]
缓冲区lpszLongPath点大小,在TCHARs。
返回值
如果函数成功,返回值是长度,TCHARs,复制到lpszLongPath字符串,不包括终止空字符。
如果lpBuffer缓冲区太小包含的路径,返回值的大小,在TCHARs,认为须持有的路径和终止空字符缓冲区。
如果函数失败任何其他原因,例如,如果该文件不存在,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
在许多文件系统,一个短文件名包含一个波形符(?)字符。然而,并非所有文件系统遵循这一惯例。因此,不要以为您可以跳过调用GetLongPathName如果路径不包含波形符(?)字符。
如果该文件或目录是否存在,而是一项长期找不到路径,GetLongPathName成功后,复制该字符串提及lpszShortPath参数缓冲区提及lpszLongPath参数。
如果返回值是比cchBuffer指定的值大,您可以再次调用该函数的缓冲区足够大,以保存路径。对于这个案例,看到GetFullPathName示例代码部分。
注意:尽管在这种情况下返回值是一个长度,其中包括终止空字符,就成功返回值不包括终止在伯爵空字符。
实例
举一个例子,它使用GetLongPathName,看到GetFullPathName示例代码部分。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetLongPathNameW(Unicode)和GetLongPathNameA(ANSI)的
参见
文件管理函数
GetFullPathName
GetLongPathNameTransacted
GetShortPathName
命名一个文件
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==GetLongPathName Function
Converts the specified path to its long form.
To perform this operation as a transacted operation, use the GetLongPathNameTransacted function.
For more information about file and path names, see Naming a File .
Syntax
C++
DWORD WINAPI GetLongPathName(
__in LPCTSTR lpszShortPath,
__out LPTSTR lpszLongPath,
__in DWORD cchBuffer
);
Parameters
lpszShortPath [in]
The path to be converted.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\\\?\\" to the path. For more information, see Naming a File .
lpszLongPath [out]
A pointer to the buffer to receive the long path.
You can use the same buffer you used for the lpszShortPath parameter.
cchBuffer [in]
The size of the buffer lpszLongPath points to, in TCHARs.
Return Value
If the function succeeds, the return value is the length, in TCHARs, of the string copied to lpszLongPath, not including the terminating null character.
If the lpBuffer buffer is too small to contain the path, the return value is the size, in TCHARs, of the buffer that is required to hold the path and the terminating null character.
If the function fails for any other reason, such as if the file does not exist, the return value is zero. To get extended error information, call GetLastError .
Remarks
On many file systems, a short file name contains a tilde (~) character. However, not all file systems follow this convention. Therefore, do not assume that you can skip calling GetLongPathName if the path does not contain a tilde (~) character.
If the file or directory exists but a long path is not found, GetLongPathName succeeds, having copied the string referred to by the lpszShortPath parameter to the buffer referred to by the lpszLongPath parameter.
If the return value is greater than the value specified in cchBuffer, you can call the function again with a buffer that is large enough to hold the path. For an example of this case, see the Example Code section for GetFullPathName .
Note Although the return value in this case is a length that includes the terminating null character, the return value on success does not include the terminating null character in the count.
Examples
For an example that uses GetLongPathName, see the Example Code section for GetFullPathName.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetLongPathNameW (Unicode) and GetLongPathNameA (ANSI)
See Also
File Management Functions
GetFullPathName
GetLongPathNameTransacted
GetShortPathName
Naming a File
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa364980(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:24:29