If I have the handle of a window, say hWnd, I can get the handle to its font type, say hFont, like this:
HFONT hFont = SendMessage(hWnd, WM_GETFONT, NULL, NULL);
After this point, how do I obtain a LOGFONT structure (which contains many features of the font), from this HFONT handle?
My purpose is not to create a font from scratch by calling CreateFont(). I want to read font properties into a LOGFONT structure, then arbitrarily modify it, and finally update the font by calling the CreateFontIndirect() function and passing the modified LOGFONT object to it.
How do I do this?
You are looking for GetObject.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With