Defines the font used in the edit control portion.
C
HFONT WINAPI SftBox_GetEditCtlFont(HWND hwndCtl); void WINAPI SftBox_SetEditCtlFont(HWND hwndCtl, HFONT hFont, BOOL fRedraw);
C++
HFONT CSftBox::GetEditCtlFont() const; void CSftBox::SetEditCtlFont(HFONT hFont, BOOL fRedraw);
hwndCtl
The window handle of the combo box control.
hFont
The font used in the edit control portion.
fRedraw
Set to TRUE to redraw the combo box immediately, otherwise set to FALSE.
GetEditCtlFont returns the font used in the edit control portion.
The GetEditCtlFont and SetEditCtlFont functions define the font used in the edit control portion of a simple or dropdown combo box.
The WM_SETFONT message, sent to the combo box, defines the font for all portions of the combo box, including the edit control portion. SetEditCtlFont can be used after sending the WM_SETFONT message to use a different font in the edit control portion only. If a WM_SETFONT message is sent to the combo box later, it replaces the font defined using SetEditCtlFont. When the combo box control is created, all portions use the DEFAULT_GUI_FONT stock font.
The height of the edit control portion, and with it the height of a dropdown combo box, depends on the font used. When the font is changed, the layout of the combo box is recalculated.
The font is not copied by the combo box. The font handle must remain valid as long as it is used by the combo box. The application is responsible for deleting the font once it is no longer used.
See Also C/C++ API | Categories | Notifications