What is the “atom” data type?

前端 未结 4 793
星月不相逢
星月不相逢 2021-02-01 16:57

I have encountered the ATOM type in the Win32api and also in the Acrobat API there is ASAtom.

As far as I can tell, atoms are keys for a hash table usually

4条回答
  •  耶瑟儿~
    2021-02-01 17:38

    The RegisterClass / RegistrClassEx functions (and a few others) return an ATOM data type.

    The ATOM uniquely identifies the class being registered, but if the function fails it returns zero, so you can test if the function has failed like this

    ATOM a=0;
    .
    .
    a = RegisterClassEx(your_window);
    if (0==a)
      {
        //code for function failed
      }
    

提交回复
热议问题