GlobalAddAtomExW function (winbase.h)

Adds a character string to the global atom table and returns a unique value (an atom) identifying the string.

Syntax

ATOM GlobalAddAtomExW(
  [in, optional] LPCWSTR lpString,
  [in]           DWORD   Flags
);

Parameters

[in, optional] lpString

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.

[in] Flags

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

Note

The winbase.h header defines GlobalAddAtomEx 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
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

GlobalAddAtom