CFontDialog::GetCurrentFont

void GetCurrentFont( LPLOGFONT lplf );

Parameters

lplf

A pointer to a LOGFONT structure.

Remarks

Call this function to assign the characteristics of the currently selected font to the members of a LOGFONT structure. Other CFontDialog member functions are provided to access individual characteristics of the current font.

If this function is called during a call to DoModal, it returns the current selection at the time (what the user sees or has changed in the dialog). If this function is called after a call to DoModal (only if DoModal returns IDOK), it returns what the user actually selected.

Example

// Get the characteristics of the currently selected font, if any.
CFontDialog dlg;
if (dlg.DoModal() == IDOK)
{
   LOGFONT lf;
   dlg.GetCurrentFont(&lf);
   TRACE("Face name of the selected font = %s\n", lf.lfFaceName);
}

CFontDialog OverviewClass MembersHierarchy Chart

See Also   CFontDialog::GetFaceName, CFontDialog::GetStyleName