 <p>You can use <a href="http://msdn.microsoft.com/en-us/library/dd162499%28VS.85%29.aspx" rel="nofollow"><code>DrawTextEx()</code></a> with the <code>DT_CALCRECT</code> flag (thanks to Jonathan Potter for that addition). Then find the difference between <code>top</code> and <code>bottom</code> of the output RECT object.</p>