Chinaunix首页 | 论坛 | 博客
  • 博客访问: 14490645
  • 博文数量: 5645
  • 博客积分: 9880
  • 博客等级: 中将
  • 技术积分: 68081
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-28 13:35
文章分类

全部博文(5645)

文章存档

2008年(5645)

我的朋友

分类:

2008-04-28 20:52:10

下载本文示例代码
  一个对话框有N个控件,怎样循环获得它们的RECT区域?假设控件的ID未知,N亦未知?我所知道的有GETDLGITEM(ID〕,但必须知道ID,可无法循环?   用API函数Enum   ChildWindows The EnumChildWindows function enumerates the child windows that belong to the specified parent window by passing the handle of each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE. BOOL EnumChildWindows( HWND hWndParent, // handle to parent window WNDENUMPROC lpEnumFunc, // pointer to callback function LPARAM lParam // application-defined value ); Parameters hWndParent Identifies the parent window whose child windows are to be enumerated. lpEnumFunc Points to an application-defined callback function. For more information about the callback function, see the EnumChildProc callback function. lParam Specifies a 32-bit, application-defined value to be passed to the callback function. Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.   一个对话框有N个控件,怎样循环获得它们的RECT区域?假设控件的ID未知,N亦未知?我所知道的有GETDLGITEM(ID〕,但必须知道ID,可无法循环?   用API函数Enum   ChildWindows The EnumChildWindows function enumerates the child windows that belong to the specified parent window by passing the handle of each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE. BOOL EnumChildWindows( HWND hWndParent, // handle to parent window WNDENUMPROC lpEnumFunc, // pointer to callback function LPARAM lParam // application-defined value ); Parameters hWndParent Identifies the parent window whose child windows are to be enumerated. lpEnumFunc Points to an application-defined callback function. For more information about the callback function, see the EnumChildProc callback function. lParam Specifies a 32-bit, application-defined value to be passed to the callback function. Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. 下载本文示例代码


循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT循环查询对话框上所有控件的RECT
阅读(79) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~