The ChooseFont function creates a Font common dialog box that enables the user to choose attributes for a logical font. These attributes include a typeface name, style (bold, italic, or regular), point size, effects (underline, strikeout, and text color), and a script (or character set).
BOOL ChooseFont(
LPCHOOSEFONT lpcf |
// pointer to structure with initialization data |
); |
If the user clicks the OK button of the dialog box, the return value is nonzero. The members of the CHOOSEFONT structure indicate the user’s selections.
If the user cancels or closes the Font dialog box or an error occurs, the return value is zero. To get extended error information, call the CommDlgExtendedError function, which can return one of the following values:
CDERR_FINDRESFAILURE |
CDERR_NOHINSTANCE |
CDERR_INITIALIZATION |
CDERR_NOHOOK |
CDERR_LOCKRESFAILURE |
CDERR_NOTEMPLATE |
CDERR_LOADRESFAILURE |
CDERR_STRUCTSIZE |
CDERR_LOADSTRFAILURE |
CFERR_MAXLESSTHANMIN |
CDERR_MEMALLOCFAILURE |
CFERR_NOFONTS |
CDERR_MEMLOCKFAILURE |
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 the CF_ENABLEHOOK flag 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, WM_CHOOSEFONT_SETFLAGS, and WM_CHOOSEFONT_SETLOGFONT messages to the dialog box to get and set the current values and flags of the dialog box.
CFHookProc, CHOOSEFONT, CommDlgExtendedError, LOGFONT, WM_CHOOSEFONT_GETLOGFONT, WM_CHOOSEFONT_SETFLAGS, WM_CHOOSEFONT_SETLOGFONT
file: /Techref/os/win/api/win32/func/src/f05_11.htm, 4KB, , updated: 2000/4/7 11:19, local time: 2024/12/27 05:01,
3.22.79.165:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/techref/os/win/api/win32/func/src/f05_11.htm"> ChooseFont</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.