GlobalDeleteAtom function (winbase.h)

Decrements the reference count of a global string atom. If the atom's reference count reaches zero, GlobalDeleteAtom removes the string associated with the atom from the global atom table.


ATOM GlobalDeleteAtom(
  [in] ATOM nAtom


[in] nAtom

Type: ATOM

The atom and character string to be deleted.

Return value

Type: ATOM

The function always returns (ATOM) 0.

To determine whether the function has failed, call SetLastError with ERROR_SUCCESS before calling GlobalDeleteAtom, then call GetLastError. If the last error code is still ERROR_SUCCESS, GlobalDeleteAtom has succeeded.


A string atom's reference count specifies the number of times the string has been added to the atom table. The GlobalAddAtom function increments the reference count of a string that already exists in the global atom table each time it is called.

Each call to GlobalAddAtom should have a corresponding call to GlobalDeleteAtom. Do not call GlobalDeleteAtom more times than you call GlobalAddAtom, or you may delete the atom while other clients are using it. Applications using Dynamic Data Exchange (DDE) should follow the rules on global atom management to prevent leaks and premature deletion.

GlobalDeleteAtom has no effect on an integer atom (an atom whose value is in the range 0x0001 to 0xBFFF). The function always returns zero for an integer atom.


For an example, see Initiating a Conversation.


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