鱼C论坛

 找回密码
 立即注册
查看: 2575|回复: 2

关于MSDN的查看问题

[复制链接]
发表于 2011-10-23 22:35:02 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 Mr.C 于 2011-10-23 22:46 编辑

我尽量把问题描述简单点,希望老鸟帮我指点一下。

BOOL ChooseFont(  LPCHOOSEFONT pcf );

这个函数功能是调用“字体选择器” 参数是CHOOSEFONT结构体,以下是MSDN的描述。

Parameters
    lpcf  
    [in/out] Pointer to a CHOOSEFONT structure that contains......


问题是这样:[in / out]表示该参数某些值需要程序赋值,其他参数作为输出存放空间。


但是我如何知道哪几个函数是in 哪几个是out

有些函数,如上面提到的ChooseFont 在函数说明时标出[in/out]
但像CHOOSEFONT这类的结构体成员,MSDN中没有进行标识。

更要命的,如果该in的成员没in  调用ChooseFont不报错,也没响应。

有没有老手说明一下。
冰天雪地,光上身坐电脑前等答案,睡觉。




小甲鱼最新课程 -> https://ilovefishc.com
发表于 2011-10-24 13:13:45 | 显示全部楼层
本帖最后由 yipwing 于 2011-10-24 13:29 编辑

这个函数,俺还没用过。。。以下是MSDN 网页版的。。
RemarksYou can provide a CFHookProc hook procedure for a Font dialog box. The hook procedure can process messages sent to the dialog box. To enable a hook procedure, set theCF_ENABLEHOOK flag in the Flags member of the CHOOSEFONT structure and specify the address of the hook procedure in the lpfnHook member.
The hook procedure can send the WM_CHOOSEFONT_GETLOGFONT, WM_CHOOSEFONT_SETFLAGS, and WM_CHOOSEFONT_SETLOGFONT messages to the dialog box to get and set the current values and flags of the dialog box.
以下是MSDN的例子:

  1. HWND hwnd;                // owner window
  2. HDC hdc;                  // display device context of owner window

  3. CHOOSEFONT cf;            // common dialog box structure
  4. static LOGFONT lf;        // logical font structure
  5. static DWORD rgbCurrent;  // current text color
  6. HFONT hfont, hfontPrev;
  7. DWORD rgbPrev;

  8. // Initialize CHOOSEFONT
  9. ZeroMemory(&cf, sizeof(cf));
  10. cf.lStructSize = sizeof (cf);
  11. cf.hwndOwner = hwnd;
  12. cf.lpLogFont = &lf;
  13. cf.rgbColors = rgbCurrent;
  14. cf.Flags = CF_SCREENFONTS | CF_EFFECTS;

  15. if (ChooseFont(&cf)==TRUE)
  16. {
  17.     hfont = CreateFontIndirect(cf.lpLogFont);
  18.     hfontPrev = SelectObject(hdc, hfont);
  19.     rgbCurrent= cf.rgbColors;
  20.     rgbPrev = SetTextColor(hdc, rgbCurrent);
  21. .
  22. .
  23. .
  24. }
复制代码


其实注意看remarks 里面的解释很充分了。。
小甲鱼最新课程 -> https://ilovefishc.com
发表于 2011-10-24 13:55:01 | 显示全部楼层
大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了大家好新手来了
小甲鱼最新课程 -> https://ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-11-9 01:16

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表