Compartilhar via


ChooseFont (function) (Windows CE 5.0)

Send Feedback

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 Values

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.

The hook procedure can send the WM_CHOOSEFONT_GETLOGFONT message to the dialog box to retrieve the current values of the dialog box.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Commdlg.h.

See Also

Common Dialog Boxes Functions | CFHookProc | CommDlgExtendedError | WM_CHOOSEFONT_GETLOGFONT | CHOOSEFONT (structure) | LOGFONT

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.