title: How to set button control's position to be exactly in the middle of the window in Win32 API
body: <p>I am currently a noob for Win32 API and learning it. I want to learn how can we set the position of a button control to be exactly in the middle of the main window.</p>
  <p>I am just creating a simple button like this in the <code>WM_CREATE</code> message of the <code>WndProc</code> function :-</p>
  <pre><code>HWND hBtn;
  
  hBtn = CreateWindow
  (
      L&quot;Button&quot;, L&quot;Hello&quot;,
      WS_VISIBLE | WS_CHILD,
      0, 0, 125, 50,
      hWnd, NULL, NULL, NULL
  );
  </code></pre>
  <p>Note that <code>hBtn</code> is globally defined.</p>
  <p>I am just subclassing the button control to get the hand cursor while hovering it. Its pretty simple.</p>
  <pre><code>SetWindowSubclass (hBtn, ButtonSubclass, NULL, NULL);
  </code></pre>
  <p>At last I just want the button to be exactly in the middle of the screen when the window is resized.</p>