FindAtom

2.x

  ATOM FindAtom(lpszString)    
  LPCSTR lpszString; /* address of string to find */

The FindAtom function searches the local atom table for the specified character string and retrieves the atom associated with that string.

Parameters

lpszString

Points to the null-terminated character string to search for.

Return Value

The return value identifies the atom associated with the given string if the function is successful. Otherwise (if the string is not in the table), the return value is zero.

Example

The following example uses the FindAtom function to retrieve the atom for the string “This is an atom”:

ATOM at;
char szMsg[80];

if ((at = FindAtom("This is an atom")) == 0)
    MessageBox(hwnd, "could not find atom",
        "FindAtom", MB_ICONEXCLAMATION);
else {
    wsprintf(szMsg, "atom = %u", at);
    MessageBox(hwnd, szMsg, "FindAtom", MB_OK);
}

See Also

AddAtom, DeleteAtom