急求VC6.0下如何弹出设置字体的对话框,有代码最好
急求VC6.0下怎么弹出设置字体的对话框,有代码最好
VC6.0下可以弹出Word中设置字体的那个对话框么?如果不能,我想弹出一个对话框,可以设置字体、字体的大小和颜色就可以。求高手帮忙,有代码最好。新手分不多,求指导!!谢谢!!
------解决方案--------------------
VC6.0下可以弹出Word中设置字体的那个对话框么?如果不能,我想弹出一个对话框,可以设置字体、字体的大小和颜色就可以。求高手帮忙,有代码最好。新手分不多,求指导!!谢谢!!
VC
字体
------解决方案--------------------
BOOL ChooseFont( LPCHOOSEFONT lpcf );
HWND hwnd; // owner window
HDC hdc; // display device context of owner window
CHOOSEFONT cf; // common dialog box structure
static LOGFONT lf; // logical font structure
static DWORD rgbCurrent; // current text color
HFONT hfont, hfontPrev;
DWORD rgbPrev;
// Initialize CHOOSEFONT
ZeroMemory(&cf, sizeof(cf));
cf.lStructSize = sizeof (cf);
cf.hwndOwner = hwnd;
cf.lpLogFont = &lf;
cf.rgbColors = rgbCurrent;
cf.Flags = CF_SCREENFONTS
------解决方案--------------------
CF_EFFECTS;
if (ChooseFont(&cf)==TRUE) {
hfont = CreateFontIndirect(cf.lpLogFont);
hfontPrev = SelectObject(hdc, hfont);
rgbCurrent= cf.rgbColors;
rgbPrev = SetTextColor(hdc, rgbCurrent);
.
.
.
}