|
From: Marc H. <ma...@e-...> - 2002-10-01 13:24:29
|
Hi,
I had a similar problem using the common font dialog in VB. As far as I can
remember you have to specify a type of font to list using one of the flags
otherwise Windows doesn't know which fonts to enumerate.
CF_WYSIWYG, CF_PRINTERFONTS or CF_TTONLY
_____________________________
Marc Heiligers
-----Original Message-----
From: Vlada Djurovic [mailto:dj...@im...]
Sent: 01 October 2002 12:57 PM
To: DevC++ help
Subject: [Dev-C++] fonts
Hi.
I have a strange problem: I want to use ChooseFont API function to display
font selection dialog. I wrote a procedure, compiled, but when I start the
application and press choose font from the menu, I get the message: "There
are no fonts instaled. Open Fonts folder in Control Panel to install
fonts.". Of course, fonts are installed. I have Windows 2000 and DevCpp
4.9.5.0. Can anyone tell me what could cause this? Here is the code I wrote
to display font dialog:
case WM_COMMAND:
switch(LOWORD(wParam))
{
case ID_FORMAT_FONT:
{
CHOOSEFONT chFont;
chFont.lStructSize=sizeof(CHOOSEFONT);
chFont.hwndOwner=hwnd;
chFont.lpLogFont=&lFont;
chFont.iPointSize=1;
chFont.Flags=CF_INITTOLOGFONTSTRUCT|CF_EFFECTS;
chFont.rgbColors=RGB(0,0,0);
chFont.nFontType=REGULAR_FONTTYPE;
if(!ChooseFont(&chFont))
MessageBox(hwnd,"Error in font
dialog","Error",MB_OK|MB_ICONSTOP);
}
break;
}
|