CFontDialog( LPLOGFONT lplfInitial = NULL, DWORD dwFlags = CF_EFFECTS | CF_SCREENFONTS, CDC* pdcPrinter = NULL, CWnd* pParentWnd = NULL );
Parameters
lplfInitial
A pointer to a LOGFONT data structure that allows you to set some of the font’s characteristics.
dwFlags
Specifies one or more choose-font flags. One or more preset values can be combined using the bitwise OR operator. If you modify the m_cf.Flags structure member, be sure to use a bitwise OR operator in your changes to keep the default behavior intact. For details on each of these flags, see the description of the CHOOSEFONT structure in the Win32 SDK documentation.
pdcPrinter
A pointer to a printer-device context. If supplied, this parameter points to a printer-device context for the printer on which the fonts are to be selected.
pParentWnd
A pointer to the font dialog box’s parent or owner window.
Remarks
Constructs a CFontDialog object. Note that the constructor automatically fills in the members of the CHOOSEFONT structure. You should only change these if you want a font dialog different than the default.
Example
// Show the font dialog with all the default settings.
CFontDialog dlg;
dlg.DoModal();
// Show the font dialog with 12 point "Times New Roman" as the
// selected font.
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
CClientDC dc(this);
lf.lfHeight = -MulDiv(12, dc.GetDeviceCaps(LOGPIXELSY), 72);
strcpy(lf.lfFaceName, "Times New Roman");
CFontDialog dlg(&lf);
dlg.DoModal();
CFontDialog Overview | Class Members | Hierarchy Chart
See Also CFontDialog::DoModal