Win32: Getting LOGFONT from HFONT

Win32 Add comments

To convert a HFONT to a LOGFONT, use the GDI function GetObject(), as in:

  1. LOGFONT lf;
  2. int ret = GetObject(hfont, sizeof(lf), &lf);
  3. // Be sure to check the return value of GetObject

The code is trivial but the function took me forever to find.

One Response to “Win32: Getting LOGFONT from HFONT”

  1. Dave Says:

    THANK YOU. I was looking for that myself. :)

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in