Win32: Getting LOGFONT from HFONT

Win32 1 Comment »

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.

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