如何更改嵌入在MFC对话框中的CEdit对象的类名 [英] How can I change the class name of CEdit object embeded in a MFC dialog

查看:81
本文介绍了如何更改嵌入在MFC对话框中的CEdit对象的类名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,
我有一个MFC对话框,其中包含一个CEdit对象.默认情况下,如果使用Spy ++查询CEdit的类名,则为"Edit".我想将其名称更改为我的私人班级名称.
任何人有任何想法吗?

Dears,
I have a MFC dialog that contains a CEdit object inside. By default, if using Spy++ to query the class name of CEdit, it is "Edit". I wanna change its name to my private class name.
Does anyon have any idea?

推荐答案

您看到的类名("Edit")是编辑控件窗口的窗口类名.在Windows编程中,您看到的每个UI控件(编辑框,组合框,按钮等)基本上都是一个窗口.该窗口类名称与您的CEdit或您自己的CEdit派生类名称无关.您不能更改在SPY ++中看到的用于编辑控件的类名.它将始终是"EDIT".如果要更改它,则必须使用CreateWindow()函数创建自己的窗口,并处理所有WM_CHAR和WK_KEYDOWN消息,以使该窗口的行为类似于编辑控件.但这是出于您的目标.
what you see as class name ("Edit") is the window''s class name for edit control window. In windows programming every UI controls(edit box, combo box, button etc.) you see is basically a window. This window class name has no relation with your CEdit or your own CEdit derived class name. You can not change the class name you see in SPY++ for an edit control. It will always be "EDIT". If you want to change it, you have to create your own window using CreateWindow() function and handle all WM_CHAR, WK_KEYDOWN messages to make that window behave like an edit control. But that is out of your aim I guess.


这篇关于如何更改嵌入在MFC对话框中的CEdit对象的类名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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