VC枚举系统所有字体
来源:互联网 发布:开元知海e读 编辑:程序博客网 时间:2024/05/18 02:30
LOGFONT lf;
lf.lfCharSet = DEFAULT_CHARSET; // Initialize the LOGFONT structure
strcpy(lf.lfFaceName,"");
CClientDC dc (this);
//Enumerate the font families
::EnumFontFamiliesEx((HDC) dc,&lf,
(FONTENUMPROC) EnumFontFamProc,(LPARAM) this,0);
//枚举函数
int CALLBACK EnumFontFamProc(LPENUMLOGFONT lpelf,LPNEWTEXTMETRIC lpntm,DWORD nFontType,long lparam)
{
// Create a pointer to the dialog window
CDay7Dlg* pWnd = (CDay7Dlg*) lparam;
// add the font name to the list box
pWnd ->m_ctlFontList.AddString(lpelf ->elfLogFont.lfFaceName);
// Return 1 to continue font enumeration
return 1;
}
lf.lfCharSet = DEFAULT_CHARSET; // Initialize the LOGFONT structure
strcpy(lf.lfFaceName,"");
CClientDC dc (this);
//Enumerate the font families
::EnumFontFamiliesEx((HDC) dc,&lf,
(FONTENUMPROC) EnumFontFamProc,(LPARAM) this,0);
//枚举函数
int CALLBACK EnumFontFamProc(LPENUMLOGFONT lpelf,LPNEWTEXTMETRIC lpntm,DWORD nFontType,long lparam)
{
// Create a pointer to the dialog window
CDay7Dlg* pWnd = (CDay7Dlg*) lparam;
// add the font name to the list box
pWnd ->m_ctlFontList.AddString(lpelf ->elfLogFont.lfFaceName);
// Return 1 to continue font enumeration
return 1;
}
其中m_ctlFontList是一个列表控件变量 原帖链接:点击打开链接
对于CALLBACK 函数使用方法如下:
头文件定义:
1
static
int
CALLBACK EnumFontFamProc(LPENUMLOGFONT lpelf,LPNEWTEXTMETRIC lpntm,
DWORD
nFontType,
long
lparam);
cpp文件中:
1
2
3
int
_stdcall XXX::EnumFontFamProc(LPENUMLOGFONT lpelf,LPNEWTEXTMETRIC lpntm,
DWORD
nFontType,
long
lparam)
{
}
0 0
- VC枚举系统所有字体
- VC 快速枚举系统所有字体。
- VC 快速枚举系统所有字体
- 枚举系统字体
- 枚举系统字体
- 枚举获得系统字体
- 获得系统所有字体
- 打印系统所有字体
- VC 重启、关闭机、枚举系统字体和获取程序图标
- iOS 开发,枚举所有字体的代码
- 打印出系统所有字体
- 枚举系统进程VC代码
- VC枚举本地所有的打印机
- vc枚举所有可用的端口号
- 枚举系统字体的COMBOX例子
- iOS系统字体大全,iOS系统中所有的字体
- VC 得到系统所有打印机
- How to enumerate the system fonts in the combobox control using VC++ - 用VC++如何在ComboBox控件中枚举系统字体
- hdu4707 Pet
- Android深入浅出自定义控件(一)
- php抓取网页上的指定内容
- modelsim编译vivado ip报错error protect region
- MySQL中多列索引
- VC枚举系统所有字体
- linux搭建svn
- EventBus 3
- 给dnf添加代理
- Colorful 动态换肤开源库
- 综述 - 【Dr.Elephant源码分析系列文章-1】
- Caffe代码与架构介绍
- vector
- 无法定位序数385 于动态链接库 licurl.dll