网站首页  词典首页

请输入您要查询的函数:

 

术语 getprofileint
释义 GetProfileInt
语法:
C++
UINT WINAPI GetProfileInt(
__in LPCTSTR lpAppName,
__in LPCTSTR lpKeyName,
__in INT nDefault
);
GetProfileInt函数
从检索,在Win.ini文件的指定部分关键整数。
注意:此功能仅提供了兼容性与16位Windows的应用程序。应用程序应该在注册表中存储初始化信息。
参数
lpAppName [in]
在包含键名节的名称。
lpKeyName [in]
键的名称,其价值要检索。此值是一个字符串形式的GetProfileInt函数转换成整数的字符串,并返回整数。
nDefault [in]
默认值时返回键名称不能在初始化文件中找到。
返回值
返回值是字符串的整数之后,相当于在Win.ini中的项名称。如果该函数找不到钥匙,返回值是默认值。如果键的值小于零,则返回值是零。
备注
如果密钥的名称由字符不是数字遵循数字组成,该函数返回唯一的数字值。例如,函数返回以下行102:键名= 102abc。
Windows Server 2003和Windows XP/2000操作系统:呼吁配置功能,可被映射到注册表中,而不是到初始化文件。这个映射初始化时发生文件和节是在注册表中指定在以下项:HKEY_LOCAL_MACHINE \\软件\\微软\\视窗NT \\ CurrentVersion \\ IniFileMapping
当操作已被映射的GetProfileInt函数检索信息从注册表,而不是从初始化文件,在存储位置的变化并没有对函数的行为的影响。
配置文件函数使用下列步骤定位初始化信息:
查找在为下IniFileMapping关键初始化文件的名称登记。
查询由lpAppName指定的节的名称。这将是一个命名值中具有关键的初始化文件名,或者一个子项与此名称或名称将不存在,一个值或子项。
如果区段名称由lpAppName指定一个命名值,则该值指定在注册表中您会发现,该科的钥匙。
如果区段名称由lpAppName指定一个子项,然后命名该子项下的具体值,其中,在注册表中您会发现,该科的钥匙。如果密钥您正在寻找不存在的一个命名值,就会有一个未命名的值(显示为<无名称>),指定注册表中的默认位置,您会发现关键。
如果按lpAppName区段名称不存在指定作为一个命名值或一个子项,然后会有一个未命名的值(显示为<无名称>),指定注册表中的默认位置,您将找到的钥匙一节。
如果没有子项或部分名称项,然后查找磁盘上的实际初始化文件并阅读其内容。
当在注册表值寻找其他指定的注册表位置,有几个前缀是改变的。ini文件映射的行为:
! -这个人物写的所有部队都进入到注册表和。ini文件在磁盘上。
# -该字符会导致注册表值被设置为在Windows 3.1的。ini文件中的价值当新用户登录的安装后的第一次。
@ -此字不允许任何人去。ini文件在磁盘上,如果请求的数据不在注册表中读取。
USR: -这个前缀代表HKEY_CURRENT_USER,文本后的前缀是相对于该键。
SYS: -这个前缀代表HKEY_LOCAL_MACHINE \\软件,文本后的前缀是相对于该键。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetProfileIntW(Unicode)和GetProfileIntA(ANSI)的
参见
GetPrivateProfileInt
WriteProfileString
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==GetProfileInt Function
Retrieves an integer from a key in the specified section of the Win.ini file.
Note This function is provided only for compatibility with 16-bit Windows-based applications. Applications should store initialization information in the registry.
Syntax
C++
UINT WINAPI GetProfileInt(
__in LPCTSTR lpAppName,
__in LPCTSTR lpKeyName,
__in INT nDefault
);
Parameters
lpAppName [in]
The name of the section containing the key name.
lpKeyName [in]
The name of the key whose value is to be retrieved. This value is in the form of a string; the GetProfileInt function converts the string into an integer and returns the integer.
nDefault [in]
The default value to return if the key name cannot be found in the initialization file.
Return Value
The return value is the integer equivalent of the string following the key name in Win.ini. If the function cannot find the key, the return value is the default value. If the value of the key is less than zero, the return value is zero.
Remarks
If the key name consists of digits followed by characters that are not numeric, the function returns only the value of the digits. For example, the function returns 102 for the following line: KeyName=102abc.
Windows Server 2003 and Windows XP/2000: Calls to profile functions may be mapped to the registry instead of to the initialization files. This mapping occurs when the initialization file and section are specified in the registry under the following key:HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\IniFileMapping
When the operation has been mapped, the GetProfileInt function retrieves information from the registry, not from the initialization file; the change in the storage location has no effect on the function's behavior.
The profile functions use the following steps to locate initialization information:
Look in the registry for the name of the initialization file under the IniFileMapping key.
Look for the section name specified by lpAppName. This will be a named value under the key that has the name of the initialization file, or a subkey with this name, or the name will not exist as either a value or subkey.
If the section name specified by lpAppName is a named value, then that value specifies where in the registry you will find the keys for the section.
If the section name specified by lpAppName is a subkey, then named values under that subkey specify where in the registry you will find the keys for the section. If the key you are looking for does not exist as a named value, then there will be an unnamed value (shown as ) that specifies the default location in the registry where you will find the key.
If the section name specified by lpAppName does not exist as a named value or as a subkey, then there will be an unnamed value (shown as ) that specifies the default location in the registry where you will find the keys for the section.
If there is no subkey or entry for the section name, then look for the actual initialization file on the disk and read its contents.
When looking at values in the registry that specify other registry locations, there are several prefixes that change the behavior of the .ini file mapping:
! - this character forces all writes to go both to the registry and to the .ini file on disk.
# - this character causes the registry value to be set to the value in the Windows 3.1 .ini file when a new user logs in for the first time after setup.
@ - this character prevents any reads from going to the .ini file on disk if the requested data is not found in the registry.
USR: - this prefix stands for HKEY_CURRENT_USER, and the text after the prefix is relative to that key.
SYS: - this prefix stands for HKEY_LOCAL_MACHINE\\SOFTWARE, and the text after the prefix is relative to that key.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetProfileIntW (Unicode) and GetProfileIntA (ANSI)
See Also
GetPrivateProfileInt
WriteProfileString
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms724360(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:16:37