Retrieves a handle to a control in the specified dialog box.

功能:获得 指定对话框上面 某个控件的句柄

C++

Copy
HWND WINAPI GetDlgItem(
_In_opt_  HWND hDlg,
_In_      int nIDDlgItem
);

Parameters

参数

hDlg [in, optional]

Type: HWND

A handle to the dialog box that contains the control.

第一个参数:(控件所在的)对话框的句柄

nIDDlgItem [in]

Type: int

The identifier of the control to be retrieved.

第二个参数:需要检索的控件的ID号

Return value

返回值

Type: HWND

If the function succeeds, the return value is the window handle of the specified control.

如果函数执行成功,函数的返回值为指定控件的窗口句柄。

If the function fails, the return value is NULL, indicating an invalid dialog box handle or a nonexistent control. To get extended error information, call GetLastError.

如果函数执行失败,返回值为NULL,表示无效的对话框句柄(即第一个参数值不对)或者控件不存在。若需要获得详细的错误信息,请调用函数GetLastError.

Remarks

备注

You can use the GetDlgItem function with any parent-child window pair, not just with dialog boxes. As long as the hDlg parameter specifies a parent window and the child window has a unique identifier (as specified by the hMenu parameter in the CreateWindow or CreateWindowEx function that created the child window), GetDlgItem returns a valid handle to the child window.

你不仅可以在对话框中使用GetDlgItem函数,也可以在 parent-child window pair(亲子窗口对?窗口中的窗口 )中使用此函数。只要hDlg参数(第一个参数)指定了父窗口,且子窗口有唯一的ID号(此子窗口通常是通过函数CreateWindow 或 CreateWindowEx而创建的,而此窗口的ID号通常也就是上述两个函数中的参数hMenu)(理解得对不?)。

Examples

For an example, see Initializing a Dialog Box.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

GetDlgItem function相关推荐

  1. 创建一个Scalar-valued Function函数来实现LastIndexOf

    昨天有帮助网友解决的个字符串截取的问题,<截取字符串中最后一个中文词语(MS SQL)>http://www.cnblogs.com/insus/p/7883606.html 虽然实现了, ...

  2. php function集合

    /*更新商品的某个字段*/ function update_goods($goods_id, $field, $value) {if ($goods_id){/* 清除缓存 */clear_cache ...

  3. 函数指针amp;绑定: boost::functoin/std::function/bind

    see link: https://isocpp.org/wiki/faq/pointers-to-members function vs template: http://stackoverflow ...

  4. class function或class procedure是什么意思

    类函数\类过程.   它们是直接操作在类上面(没有实例化的对象) 下面是Delphi    Help    的描述            A class method is a method (oth ...

  5. Cost Function

    首先本人一直有一个疑问缠绕了我很久,就是吴恩达老师所讲的机器学习课程里边的逻辑回归这点,使用的是交叉熵损失函数,但是在进行求导推导时,google了很多的课件以及教程都是直接使用的,这个问题困扰了很久 ...

  6. error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. 的解决方法

    vs2013编译出错信息:错误    1    error C4996: 'fopen': This function or variable may be unsafe. Consider usin ...

  7. c++11 function

    是代指返回值为void型的函数指针. function 最大的功能是表达匿名函数,特别是 [] 里面捕捉了当前上下文变量的匿名函数 类模版 std::function是一种通用.多态的函数封装.std ...

  8. 避开移入移出事件内部div干扰事件,e是function(e)的e

    // 避开移入移出事件内部div干扰事件 // e是function(e)的elet element = e.toElement || e.relatedTarget;if (element.clas ...

  9. Vue子组件调用父组件方法并传参的5种方式:$emit触发、传入子组件function、访问父组件$parent.function、用inject关联父组件provide的方法、用window.fun

    如需了解老子怎么控制儿子的,传送门:https://s-z-q.blog.csdn.net/article/details/119922715 子组件child.vue <template> ...

最新文章

  1. 我为什么辞去了热爱的 AI 工作?
  2. 大话移动开发之QT-Quick
  3. java (三)面向对象编程
  4. 自动驾驶小车循迹 图像二值化方法
  5. C++学习之路—继承与派生(四)拓展与总结
  6. 二叉树相关知识及求深度的代码实现
  7. DIV+CSS_1_样式表的分类
  8. 【报告分享】2021年人工智能安全风险及治理研究报告.pdf(附下载链接)
  9. Matlab光滑曲线多项式拟合与样条曲线拟合的两个案例
  10. 一个完整的数据分析、挖掘流程详细介绍
  11. 视频教程-C++ 编写WebService服务实战-C/C++
  12. zmap扫描mysql_zmap/masscan 快速扫描网络
  13. python投影Himawari-8数据
  14. 桌面图标无故变成白色
  15. CSDN公式插入——关于对数
  16. ccf---导弹防御系统
  17. python constants_Python constants.SUCCESS属性代码示例
  18. 自定义配置文件 /etc/httpd/conf.d
  19. 5.22 对图层应用多个相同的图层样式(新) [原创Ps教程]
  20. 02-表格基本格式以及各个标签的属性、boder/cellpadding/cellspacing的区分、th标签、caption标签

热门文章

  1. java 设置mime type,java获取文件的mime type
  2. DataGridView合并单元格(横向合并)
  3. 通用模块用于静态电流测量
  4. Morecoin区块链专场:DeFi 和 CeFi 的发展与未来
  5. excel的countif函数常见错误
  6. mysql5.7官网直译锁操作优化--并发添加,元数据锁,外部闭锁
  7. oracle parameter文件
  8. 吊炸天!IntelliJ IDEA居然支持视频聊天了~速来尝鲜!网友:这尼玛有点牛逼哇!...
  9. 是谁在争夺中国开源运动的主导权?
  10. 【论文】Concurrent Segmentation and Object Detection CNNs for Aircraft Detection and Identification