网站首页  词典首页

请输入您要查询的函数:

 

术语 expandenvironmentstrings
释义 ExpandEnvironmentStrings
语法:
C++
DWORD WINAPI ExpandEnvironmentStrings(
__in LPCTSTR lpSrc,
__out_opt LPTSTR lpDst,
__in DWORD nSize
);
ExpandEnvironmentStrings函数
扩展环境变量字符串,并替换为当前用户定义的价值观。
要指定一个特定的用户或系统,使用ExpandEnvironmentStringsForUser功能的环境块。
参数
lpSrc [in]
阿缓冲区包含一个或多个环境变量的格式字符串:%variableName%。对于每个这样的参考,%variableName%的部分被替换该环境变量的当前值。
案例是查找时忽略了环境变量的名称。如果该名称未找到,%variableName%的部分留下未展开。
请注意,此函数不支持的所有特性,Cmd.exe的支持。例如,它不支持%variableName:str1 = STR2赛车%或%variableName:?偏移量,长度%。
lpDst [指出,可选]
阿一个缓冲区,它接收,开拓lpSrc缓冲区中的环境变量字符串的结果指针。请注意,此缓冲区不能作为lpSrc缓冲区相同。
nSize [in]
在可以存储在缓冲区中的最大字符数指向的lpDst参数。当使用ANSI字符串,缓冲区的大小应该是字符串的长度,加上终止空字符,加上一个。当使用Unicode字符串,缓冲区的大小应该是字符串的长度加上终止空字符。
返回值
如果函数成功,返回值是在目标缓冲区存储TCHARs,包括终止空字符。如果目标缓冲区太小举行扩大的字符串,返回值是所需的缓冲区大小,以字符。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
该lpSrc和lpDst缓冲区的大小限制为32K的。
以取代完全与它们相关的环境合格的路径文件夹的名称,变量字符串使用PathUnExpandEnvStrings功能。
要检索的环境变量的进程列表,使用GetEnvironmentStrings功能。
实例
有关示例,请参见获取系统信息。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesExpandEnvironmentStringsW(Unicode)和ExpandEnvironmentStringsA(ANSI)的
参见
环境变量
系统信息功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==ExpandEnvironmentStrings Function
Expands environment-variable strings and replaces them with the values defined for the current user.
To specify the environment block for a particular user or the system, use the ExpandEnvironmentStringsForUser function.
Syntax
C++
DWORD WINAPI ExpandEnvironmentStrings(
__in LPCTSTR lpSrc,
__out_opt LPTSTR lpDst,
__in DWORD nSize
);
Parameters
lpSrc [in]
A buffer that contains one or more environment-variable strings in the form: %variableName%. For each such reference, the %variableName% portion is replaced with the current value of that environment variable.
Case is ignored when looking up the environment-variable name. If the name is not found, the %variableName% portion is left unexpanded.
Note that this function does not support all the features that Cmd.exe supports. For example, it does not support %variableName:str1=str2% or %variableName:~offset,length%.
lpDst [out, optional]
A pointer to a buffer that receives the result of expanding the environment variable strings in the lpSrc buffer. Note that this buffer cannot be the same as the lpSrc buffer.
nSize [in]
The maximum number of characters that can be stored in the buffer pointed to by the lpDst parameter. When using ANSI strings, the buffer size should be the string length, plus terminating null character, plus one. When using Unicode strings, the buffer size should be the string length plus the terminating null character.
Return Value
If the function succeeds, the return value is the number of TCHARs stored in the destination buffer, including the terminating null character. If the destination buffer is too small to hold the expanded string, the return value is the required buffer size, in characters.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
The size of the lpSrc and lpDst buffers is limited to 32K.
To replace folder names in a fully-qualified path with their associated environment-variable strings, use the PathUnExpandEnvStrings function.
To retrieve the list of environment variables for a process, use the GetEnvironmentStrings function.
Examples
For an example, see Getting System Information .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesExpandEnvironmentStringsW (Unicode) and ExpandEnvironmentStringsA (ANSI)
See Also
Environment Variables
System Information Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724265(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 11:22:11