GlobalAddAtom

Syntax

ATOM GlobalAddAtom(lpString)

This function adds the character string pointed to by the lpString parameter to the atom table and creates a new global atom that uniquely identifies the string. A global atom is an atom that is available to all applications. The atom can be used in a subsequent GlobalGetAtomName function to retrieve the string from the atom table.

The GlobalAddAtom function stores no more than one copy of a given string in the atom table. If the string is already in the table, the function returns the existing atom value and increases the string's reference count by one. The string's reference count is a number that specifies the number of times GlobalAddAtom has been called for a particular string.

Parameter Type/Description  

lpString LPSTR Points to the character string to be added to the table. The string must be a null-terminated character string.  

Return Value

The return value identifies the newly created atom if the function is successful. Otherwise, it is NULL.

Comments

The atom values returned by GlobalAddAtom are within the range 0xC000 to 0xFFFF.