设为首页 加入收藏

TOP

对话方块(七十二)
2010-12-30 21:13:56 来源: 作者: 【 】 浏览:40845
Tags:对话 方块
-----------------------------------------
POPFONT.C -- Popup Editor Font Functions
------------------------------------------------------*/

#include <windows.h>
#include <commdlg.h>

static LOGFONT logfont ;
static HFONT hFont ;

BOOL PopFontChooseFont (HWND hwnd)
{
CHOOSEFONT cf ;
cf.lStructSize = sizeof (CHOOSEFONT) ;
cf.hwndOwner = hwnd ;
cf.hDC = NULL ;
cf.lpLogFont = &logfont ;
cf.iPointSize = 0 ;
cf.Flags = CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS | CF_EFFECTS ;
cf.rgbColors = 0 ;
cf.lCustData = 0 ;
cf.lpfnHook = NULL ;
cf.lpTemplateName = NULL ;
cf.hInstance = NULL ;
cf.lpszStyle = NULL ;
cf.nFontType = 0 ; // Returned from ChooseFont
cf.nSizeMin = 0 ;
cf.nSizeMax = 0 ;

return ChooseFont (&cf) ;
}

void PopFontInitialize (HWND hwndEdit)
{
GetObject (GetStockObject (SYSTEM_FONT), sizeof (LOGFONT),
(PTSTR) &logfont) ;
hFont = CreateFontIndirect (&logfont) ;
SendMessage (hwndEdit, WM_SETFONT, (WPARAM) hFont, 0) ;
}

void PopFontSetFont (HWND hwndEdit)
{
HFONT hFontNew ;
RECT rect ;

hFontNew = CreateFontIndirect (&logfont) ;
S
首页 上一页 69 70 71 72 73 74 75 下一页 尾页 72/82/82
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇剪贴簿 下一篇功能表及其他资源

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: