GlobalGetAtomNameA function (winbase.h)

Retrieves a copy of the character string associated with the specified global atom.

Syntax

UINT GlobalGetAtomNameA(
  [in]  ATOM  nAtom,
  [out] LPSTR lpBuffer,
  [in]  int   nSize
);

Parameters

[in] nAtom

Type: ATOM

The global atom associated with the character string to be retrieved.

[out] lpBuffer

Type: LPTSTR

The buffer for the character string.

[in] nSize

Type: int

The size, in characters, of the buffer.

Return value

Type: UINT

If the function succeeds, the return value is the length of the string copied to the buffer, in characters, not including the terminating null character.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The string returned for an integer atom (an atom whose value is in the range 0x0001 to 0xBFFF) is a null-terminated string in which the first character is a pound sign (#) and the remaining characters represent the unsigned integer atom value.

Security Considerations

Using this function incorrectly might compromise the security of your program. Incorrect use of this function includes not correctly specifying the size of the lpBuffer parameter. Also, note that a global atom is accessible by anyone; thus, privacy and the integrity of its contents is not assured.

Note

The winbase.h header defines GlobalGetAtomName as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

AddAtom

DeleteAtom

FindAtom

GlobalAddAtom

GlobalDeleteAtom

GlobalFindAtom

MAKEINTATOM

Reference