title: hInstance in CreateWindow
body: <p>I use <code>CreateWindow</code> to create the main window. <code>hInstance</code> in <code>WNDCLASSEX</code> specifies the instance under which the class is registered. So I need <code>hInstance</code> in <code>CreateWindow</code> function to find it.</p>
  
  <p>I use <code>CreateWindow</code> to create a button. No user-defined <code>WNDCLASSEX</code> now. The BUTTON's <code>WNDCLASSEX</code> is global. But I still need to pass an <code>hInstance</code> to the function? Why and what is the right value to pass?</p>
  
  <p>In Microsoft's example it's <code>(HINSTANCE)GetWindowLong(hMainWnd, GWL_HINSTANCE)</code>, but I have no idea of what it is.</p>
  
  <p>Please also tell me if I had anything wrong.</p>
  
  <p>Thanks.</p>