Partager via


ChooseFont (function)

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/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.

Requirements

Header commdlg.h
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Common Dialog Boxes Functions
CFHookProc
CommDlgExtendedError
CHOOSEFONT (structure)

Other Resources

LOGFONT