Re: GetTextExtentPoint32 problem

Tech-Archive recommends: Fix windows errors by optimizing your registry



I don't use the dialog DC for anything else than calling
GetTextExtentPoint32.
So I don't know which font is has selected.

Are you using the same font in the HDC as used by the dialog?
James

--
Microsoft MVP - Windows SDK
www.catch22.net
Free Win32 Source and Tutorials


"DR" <dr1234@xxxxxxxxx> wrote in message
news:%23xGe4prRGHA.2156@xxxxxxxxxxxxxxxxxxxxxxx
I use GetTextExtentPoint32 to get the width of a text on a dialog. First I
call GetDC(hDlg) and then GetTextExtentPoint32 with the dialog DC. But the
returned value is incorrect. It is larger than the actual width of the
text on the dialog.

thanks





.



Relevant Pages

  • Re: GetTextExtent not observing font
    ... Is m_font.GetFontHandle() returning a valid font handle? ... What is SelectObject returning? ... All I can add is that GetTextExtentPoint32 does work properly. ... Gary Chanson (Windows SDK MVP) ...
    (microsoft.public.win32.programmer.gdi)
  • Re: GetTextExtentPoint32 problem
    ... Microsoft MVP - Windows SDK ... Free Win32 Source and Tutorials ... I call GetDCand then GetTextExtentPoint32 with the dialog DC. ...
    (microsoft.public.vc.language)
  • Re: How to get dialog size?
    ... display size, default font, display card, display driver, phase of the ... angular relationship of Mars and Jupiter. ... What matters is not the default font, ... (because you can get a hdc and use GetTextMetrics and GetTextExtentPoint32) ...
    (microsoft.public.vc.mfc)
  • Re: How can I get a N x N Bitmap by using the font size?
    ... Create the font using the CreateFontAPI call, which will allow you to specify a height in pixels and select that into a DC before ... specific height _and_ width then you'll need to create one font object, query the size using GetTextExtentPoint32() and use that as ... will give you a more accurate ratio here) - you can get the current average character size for the currently selected font using ...
    (microsoft.public.win32.programmer.gdi)
  • Re: GetTextExtentPoint32 and Font
    ... Randy Birch ... "Peter Plumber" wrote in message ... I found GetTextExtentPoint32, that might do that. ... : But: How can I Select the Font that is used for GetTextExtentPoint32? ...
    (microsoft.public.vb.general.discussion)