Partager via


ChooseFont (function) (Windows Embedded CE 6.0)

1/6/2010

This function creates a Font dialog box that enables the user to choose attributes for a logical font. These attributes include a typeface name; a style, such as bold, italic, or regular; a point size; effects, such as underline, strikeout, and text color; and a script or character set.

Syntax

BOOL APIENTRY ChooseFont(
  LPCHOOSEFONT lpcf
);

Parameters

  • lpcf
    [in, out] Pointer to a CHOOSEFONT (structure) that contains information used to initialize the dialog box. When ChooseFont returns, this structure contains information about the font that the user selected.

Return Value

A nonzero value indicates that the user chose the OK button of the dialog box. When ChooseFont returns, the members of the CHOOSEFONT structure indicate the selections that the user made in the Font dialog box.

Zero indicates that the user canceled or closed the Font dialog box or that an error occurred. To get extended error information, call the CommDlgExtendedError function.

Remarks

You can provide a CFHookProc hook procedure for a Font dialog box. The hook procedure can process messages sent to the dialog box. To enable a hook procedure, set CF_ENABLEHOOK in the Flags member of the CHOOSEFONT structure and specify the address of the hook procedure in the lpfnHook member.

In Windows Embedded CE, the hook procedure can send the WM_CHOOSEFONT_GETLOGFONT message to the dialog box to retrieve the current values of the dialog box.

Requirements

Header commdlg.h
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

Common Dialog Boxes Functions
CFHookProc
CommDlgExtendedError
WM_CHOOSEFONT_GETLOGFONT
CHOOSEFONT (structure)

Other Resources

LOGFONT