Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>gettextextent()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GetTextExtent()
Return the width and height of a string using the current font
------------------------------------------------------------------------------

Syntax
GetTextExtent( <hDC>, <cText> )   -->   nValue

Arguments
<hDC> specifies the device context for a window.

<cText> is the string.

Returns
A numeric value containing both the width and height of the
string relative to the font currently selected in the
specified device context.

Description
This function returns a numeric value containing both the
width and height (in logical units) of the string relative to
the font currently selected in <hDC>.  The width can be
extracted by the C4W_LoWord() function, and the height can be
extracted by C4W_HiWord().

Example
? C4W_LoWord( GetTextExtent( hDC, cMyString ) )   // the width


See Also: DrawText() GetDC() TextOut()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson