网站首页  词典首页

请输入您要查询的函数:

 

术语 getenvironmentstrings
释义 GetEnvironmentStrings
语法:
C++
LPTCH WINAPI GetEnvironmentStrings(void);
GetEnvironmentStrings功能
获取当前进程的环境变量。
参数
这个函数没有参数。
返回值
如果函数成功,返回值是对当前进程环境块指针。
如果函数失败,返回值为NULL。
备注
该GetEnvironmentStrings函数返回一个指向的内存块,其中包含调用进程的环境变量(包括系统和用户环境变量)。每个环境块包含下列格式的环境变量:
Var1 =值1 \\ 0
Var2 =数值2 \\ 0
Var3 =数值3 \\ 0
...
VarN = ValueN \\ 0 \\ 0
把一个存储器只读,不要直接修改它。要添加或更改环境变量,请使用GetEnvironmentVariable和SetEnvironmentVariable功能。
返回时GetEnvironmentStrings块不再需要,要释放通过调用FreeEnvironmentStrings功能。
请注意,此函数的ANSI版本,GetEnvironmentStringsA,返回的OEM字符。
实例
有关示例,请参阅更改环境变量。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetEnvironmentStringsW(Unicode)和GetEnvironmentStringsA(ANSI)的
参见
环境变量
FreeEnvironmentStrings
GetEnvironmentVariable
SetEnvironmentVariable
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetEnvironmentStrings Function
Retrieves the environment variables for the current process.
Syntax
C++
LPTCH WINAPI GetEnvironmentStrings(void);
Parameters
This function has no parameters.
Return Value
If the function succeeds, the return value is a pointer to the environment block of the current process.
If the function fails, the return value is NULL.
Remarks
The GetEnvironmentStrings function returns a pointer to a block of memory that contains the environment variables of the calling process (both the system and the user environment variables). Each environment block contains the environment variables in the following format:
Var1=Value1\\0
Var2=Value2\\0
Var3=Value3\\0
...
VarN=ValueN\\0\\0
Treat this memory as read-only; do not modify it directly. To add or change an environment variable, use the GetEnvironmentVariable and SetEnvironmentVariable functions.
When the block returned by GetEnvironmentStrings is no longer needed, it should be freed by calling the FreeEnvironmentStrings function.
Note that the ANSI version of this function, GetEnvironmentStringsA, returns OEM characters.
Examples
For an example, see Changing Environment Variables .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetEnvironmentStringsW (Unicode) and GetEnvironmentStringsA (ANSI)
See Also
Environment Variables
FreeEnvironmentStrings
GetEnvironmentVariable
SetEnvironmentVariable
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683187(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:42