循环查询对话框上所有控件的RECT

翻译|其它|编辑:郝浩|2005-12-21 09:07:00.000|阅读 1489 次

概述:

# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>


一个对话框有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.
 


标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com


为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP