网站首页  词典首页

请输入您要查询的函数:

 

术语 setfileshortname
释义 SetFileShortName
语法:
C++
BOOL WINAPI SetFileShortName(
__in HANDLE hFile,
__in LPCTSTR lpShortName
);
SetFileShortName功能
设置指定文件的短名称。该文件必须在NTFS文件系统卷。
参数
hFile [in]
阿处理该文件。该文件必须打开,或者是GENERIC_ALL访问权利或GENERIC_WRITE |删除,并与FILE_FLAG_BACKUP_SEMANTICS文件属性。
lpShortName [in]
一个字符串,指定该文件的短名称的指针。
指定一个空(零长度)字符串将删除短文件名,如果由hFile参数指定的文件存在。如果一个短文件名不存在,函数将什么也不做,返回成功。
Windows Server 2008中,Windows Vista中的Windows Server 2003,和Windows XP/2000:此行为不支持。该参数必须包含一个或多个字符有效字符串。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 GetLastError函数可能会返回下列错误代码所特有的这一职能之一。
返回codeDescription
ERROR_ALREADY_EXISTSThe指定的短名称不是唯一的。
ERROR_INVALID_PARAMETEREither指定的文件被打开的情况下,敏感的模式或指定的短名称是无效的。
备注
这个函数的调用者必须具有SE_RESTORE_NAME特权。有关更多信息,请运行特权。
要求:
最低支持client-Windows XP
最低支持serverWindows服务器2003
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesSetFileShortNameW(Unicode)和SetFileShortNameA(ANSI)的
参见
文件管理函数
GetShortPathName
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==SetFileShortName Function
Sets the short name for the specified file. The file must be on an NTFS file system volume.
Syntax
C++
BOOL WINAPI SetFileShortName(
__in HANDLE hFile,
__in LPCTSTR lpShortName
);
Parameters
hFile [in]
A handle to the file. The file must be opened with either the GENERIC_ALL access right or GENERIC_WRITE|DELETE, and with the FILE_FLAG_BACKUP_SEMANTICS file attribute.
lpShortName [in]
A pointer to a string that specifies the short name for the file.
Specifying an empty (zero-length) string will remove the short file name, if it exists for the file specified by the hFile parameter. If a short file name does not exist, the function will do nothing and return success.
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000: This behavior is not supported. The parameter must contain a valid string of one or more characters.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError . GetLastError may return one of the following error codes that are specific to this function.
Return codeDescription
ERROR_ALREADY_EXISTSThe specified short name is not unique.
ERROR_INVALID_PARAMETEREither the specified file has been opened in case-sensitive mode or the specified short name is invalid.

Remarks
The caller of this function must have the SE_RESTORE_NAME privilege. For more information, see Running with Special Privileges .
Requirements
Minimum supported clientWindows XP
Minimum supported serverWindows Server 2003
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesSetFileShortNameW (Unicode) and SetFileShortNameA (ANSI)
See Also
File Management Functions
GetShortPathName
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa365543(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:26:25