title: How to vertically center text in an edit control?
body: <p>Trying to vertically center/align the text in an edit control (Win32 API, pure C, no MFC) but with no luck. Tried solutions from other answers such as <a href="https://stackoverflow.com/questions/867207/how-can-we-vertically-align-text-in-edit-box">this one</a> or <a href="https://stackoverflow.com/questions/14303675/how-to-center-text-vertically-in-an-edit-control-in-pure-win32">this</a> and other quite old forums around, but no luck:</p>
  <p><a href="https://i.stack.imgur.com/5ro1A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5ro1A.png" alt="enter image description here" /></a></p>
  <p>I could reduce the height of the control, but this is just a workaround. I don't want to make it multi-line. Code to create the control:</p>
  <pre><code>CreateWindowW(L&quot;Edit&quot;, NULL,
      WS_CHILD | WS_VISIBLE | WS_BORDER,
      MulDiv(LOWORD(units),  50, 4), 0,
      MulDiv(LOWORD(units), 150, 4),
      MulDiv(HIWORD(units),  14, 8),
      hwnd, NULL, NULL, NULL);
  </code></pre>
  <p>Question: is there <em>really</em> no way to vertically align the text?</p>