title: Can one use SetWindowLongPtr + GWLP_USERDATA to store data (not pointer)
body: <p>I know one can use SetWindowLongPtr + GWLP_USERDATA to store a pointer which points to some data.
  But could one store the data directly, for example "a handle", "a bool, an "int" or other larger data.</p>
  
  <p>From <a href="http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms644898%28v=vs.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms644898%28v=vs.85%29.aspx</a>, it says:</p>
  
  <p><em>Sets new extra information that is private to the application, such as handles or pointers.</em></p>
  
  <p>, so I guess to store a handle is OK. I also used this method to store an RGB value without problem.
  But I don't know if this is a good idea to do things like this. And can we store other data which is large (for example, a structure)?</p>
  
  <p>p.s: The motivation of this question is: When I create a dialog window, I want to store data for each of its controls. Of course I can use static variables in the window procedure and pass pointer (to them) to SetWindowLongPtr function. But this is not "perfect" in theory, because when the dialog window is closed, I don't need these data anymore. Of course, in practice, the data I need to use is very small, and I should not care about the usage of memory. But I still like to know if there is a better way.</p>