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: =93There are no fonts instaled. Open Fonts folder in Control
Panel to install fonts.=94. 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:
=20
case WM_COMMAND:
switch(LOWORD(wParam))
{
case ID_FORMAT_FONT:
{
CHOOSEFONT chFont;
chFont.lStructSize=3Dsizeof(CHOOSEFONT);
chFont.hwndOwner=3Dhwnd;
chFont.lpLogFont=3D&lFont;
chFont.iPointSize=3D1;
chFont.Flags=3DCF_INITTOLOGFONTSTRUCT|CF_EFFECTS;
chFont.rgbColors=3DRGB(0,0,0);
chFont.nFontType=3DREGULAR_FONTTYPE;
if(!ChooseFont(&chFont))
MessageBox(hwnd,"Error in font
dialog","Error",MB_OK|MB_ICONSTOP);
}
break;
}
|