#define STRICT /* This is required so that our callback is properly prototyped. */
//---------------------------------------------------------------------
int CALLBACK EnumFontFamiliesProc(const LOGFONT *lpelf,const TEXTMETRIC *lpntm, unsigned long FontType,LPARAM lParam)
{
/* The parameter lParam is defined as the address of the font combo box
used in the program to store the list of font names. */
TComboBox *ExtFontComboBox = reinterpret_cast(lParam);
/* Read the Win32 documentation for a description of the other parameters
but all we need here is the name of the font. */
ExtFontComboBox->Items->Add(AnsiString(lpelf->lfFaceName));
return true;
}
//---------------------------------------------------------------------------
/* fill combo box with the fonts. */
EnumFontFamilies(Canvas->Handle,NULL,EnumFontFamiliesProc,reinterpret_cast(FontComboBox));