Windows GUI控件ID是如何创建的? [英] How are Windows GUI control ids created?

查看:138
本文介绍了Windows GUI控件ID是如何创建的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows中,将为每个控件(如每个对话框,窗口,文本框和复选框等)提供控件ID。

In Windows, for each and every control like (for every dialog, window, textbox and checkbox etc) a control id will be given.

该控件ID是如何创建的? Windows中的两个应用程序可以具有相同的控件ID吗?有什么方法可以手动设置Windows控件ID?

How is this control id created? Can two applications in Windows can have same control ids? Is there any way to manually set Windows control ids?

推荐答案

控件ID是传递给<$ c的参数之一。 $ c> CreateWindow 函数。如果控件是从对话框模板创建的,则对话框管理器将从对话框模板获取控件ID。两个控件具有相同的ID是很常见的。例如,大多数取消按钮将具有控件ID IDCANCEL

The control ID is one of the parameters passed to the CreateWindow function. If the control was created from a dialog template, then the dialog manager gets the control ID from the dialog template. It is quite common for two controls to have the same ID. For example, most Cancel buttons will have the control ID IDCANCEL.

这篇关于Windows GUI控件ID是如何创建的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆