网站首页  词典首页

请输入您要查询的函数:

 

术语 globaladdatom
释义 GlobalAddAtom
语法:
ATOM GlobalAddAtom( LPCTSTR lpString
);
GlobalAddAtom函数
该GlobalAddAtom函数将字符串全球原子表,并返回一个唯一的值(原子)确定字符串。
参数
lpString
[in] 待添加的以null 结束的字符串指针。该字符串可以有255个字节的最大大小。字符串的区别仅在于案件被认为是完全相同的。在此名称的第一个字符串的情况下添加到表中保留和GlobalGetAtomName函数返回。
或者,您可以使用一个整数原子已被转换使用MAKEINTATOM宏。更多信息见备注。
返回值
如果函数成功,返回值是新创建的原子。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
如果字符串已经在全球原子表存在,对现有字符串返回原子和原子的引用计数递增。
与原子相关的字符串不是从内存中删除,直到它的引用计数为零。有关详细信息,请参阅GlobalDeleteAtom功能。
全球原子不会删除该应用程序时自动终止。每到GlobalAddAtom函数调用,必须有相应的调用GlobalDeleteAtom功能。
如果lpString参数的形式为“#1234”,GlobalAddAtom返回一个整数原子,其值为16位,在本例中的字符串(0x04D2,指定的十进制数表示)。如果指定的十进制值是0x0000或大于或等于0xC000,返回值是零,表明一个错误。如果lpString是由该MAKEINTATOM宏,低位字必须在范围0x0001通过0xBFFF。如果低位字不在此范围内,该功能失败。
如果lpString有任何其他形式,GlobalAddAtom返回一个字符串原子。
在Windows 95/98/Me:GlobalAddAtomW是支持的Unicode(MSLU)微软层。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
功能信息
最低DLL版本 kernel32.dll
在Winbase.h HeaderDeclared,头文件:winuser.h
import libraryKernel32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
atoms OverView,AddAtom,DeleteAtom,FindAtom,GetAtomName,GlobalDeleteAtom,GlobalFindAtom,GlobalGetAtomName,MAKEINTATOM
==英文原文==GlobalAddAtom Function
The GlobalAddAtom function adds a character string to the global atom table and returns a unique value (an atom) identifying the string.
Syntax
ATOM GlobalAddAtom( LPCTSTR lpString
);
Parameters
lpString
[in] Pointer to the null-terminated string to be added. The string can have a maximum size of 255 bytes. Strings that differ only in case are considered identical. The case of the first string of this name added to the table is preserved and returned by the GlobalGetAtomName function.
Alternatively, you can use an integer atom that has been converted using the MAKEINTATOM macro. See the Remarks for more information.
Return Value
If the function succeeds, the return value is the newly created atom.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
If the string already exists in the global atom table, the atom for the existing string is returned and the atom's reference count is incremented.
The string associated with the atom is not deleted from memory until its reference count is zero. For more information, see the GlobalDeleteAtom function.
Global atoms are not deleted automatically when the application terminates. For every call to the GlobalAddAtom function, there must be a corresponding call to the GlobalDeleteAtom function.
If the lpString parameter has the form "#1234", GlobalAddAtom returns an integer atom whose value is the 16-bit representation of the decimal number specified in the string (0x04D2, in this example). If the decimal value specified is 0x0000 or is greater than or equal to 0xC000, the return value is zero, indicating an error. If lpString was created by the MAKEINTATOM macro, the low-order word must be in the range 0x0001 through 0xBFFF. If the low-order word is not in this range, the function fails.
If lpString has any other form, GlobalAddAtom returns a string atom.
Windows 95/98/Me: GlobalAddAtomW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Function Information
Minimum DLL Versionkernel32.dll
HeaderDeclared in Winbase.h, include Windows.h
Import libraryKernel32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Atoms Overview , AddAtom , DeleteAtom , FindAtom , GetAtomName , GlobalDeleteAtom , GlobalFindAtom , GlobalGetAtomName , MAKEINTATOM
==原始网址==http://msdn.microsoft.com/en-us/library/ms649060(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:08