title: How is XGetWindowProperty() and XListProperties() related for a particular window-ID
body: <p>A "PropertyNotify" Events is generated by xServer for a Window say with id var "win". Now i call xlib function <code>XGetWindowProperty()</code> and <code>XListProperties()</code> for same win-id as given below </p>
  
  <pre><code>    int getProp(Atom atom, Window win, unsigned long *nitems_ret, 
                  unsigned char **prop_return, Atom *type_ret, int *format_ret)
      {
          Atom type;
          int format;
          unsigned long bytes_after_ret;
  
          if (!type_ret)
              type_ret=&amp;type;
  
          if (!format_ret)
              format_ret=&amp;format;
  
  
          XGetWindowProperty(m_display, win, atom, 0, 65536, 0, 
                             AnyPropertyType, type_ret, format_ret, 
                             nitems_ret, &amp;bytes_after_ret, prop_return);
  
            // printing the content of variable "prop_return" suppose it's not empty 
                                                                 -----------------(1)
  
         int nprops = 0;
         Atom *prorList = XListProperties(m_display, win, &amp;nprops);
  
           // printing content of var "prorList"  ------------------------(2)
  
     };
  </code></pre>
  
  <p>now comparing the output of (1) and (2), so should the output of (1) be contained in (2) or not. Please give reason to validate the answer. As i understood reading from net that about <code>XGetWindowProperty()</code> that it returns the required property type from the property of given window-id and other supplements. Here for checking i just pass the argument <code>AnyPropertyType</code>.</p>
  
  <p>Now i also call the function <code>XListProperties()</code> to list all the Atom attribute of given win-id and print them to compare with output of <code>XGetWindowProperty()</code> (consider the output is not <code>NULL</code>) but what i find that there is no match b/w them. Now my question is from where did those properties appear in  <code>XGetWindowProperty()</code> or fault lies in my understanding. Please explain these functions and difference in their atom attributes. And also it would be really helpful if someone can recommend good xlib book or link to website for better understanding. </p>
  
  <p>Thanks,</p>