MLM_SETFONT
This message sets a font.
Syntax
param1 PFATTRS pFattrs; /* Font attribute structure. */ param2 ULONG ulReserved; /* Reserved value, should be 0. */
Parameters
- pFattrs (PFATTRS) - input
- Font attribute structure.
- NULL: The system font is set.
- Other: The specified font is set.
- ulReserved (ULONG) - input
- Reserved value, should be 0.
Returns
- rc (BOOL) - return
- Success indicator.
- TRUE: The font was successfully set.
- FALSE: An error occurred.
Remarks
For any PFATTRS, this message sets the display to use the appropriate font. If NULL, the system font is used. The screen is updated appropriately. This can cause an overflow, see MLN_OVERFLOW.
When setting an outline font, it is necessary to ensure that the FATTRS structure contains the correct maximum baseline extent and average character width for the desired point size and that the font use is marked as FATTR_FONTUSE_ TRANSFORMABLE.
Baseline extent and character width are calculated by multiplying the desired point size by the current display device font resolution (CAPS_VERTICAL_FONT_RES and CAPS_HORIZONTAL_FONT_RES; see DevQueryCaps) and dividing by 72, the number of points in an inch.
Default Processing
The default window procedure takes no action on this message, other than to set rc to FALSE.
Examples
This example retrieves the current font information, changes it to italic, and sets it using the MLM_SETFONT message.
FATTRS fat; fat.usRecordLength = sizeof(FATTRS); WinSendMsg(hwndMle, MLM_QUERYFONT, (MPARAM) &fat, (MPARAM) 0L); fat.fsSelection = FATTR_SEL_ITALIC; WinSendMsg(hwndMle, MLM_SETFONT, (MPARAM) &fat, (MPARAM) 0);