是否有可能从自定义控件(自​​定义控件)获取文本,例如:vs2008 [英] Is that possible getting texts from custom control (custom control) ex : vs2008

查看:82
本文介绍了是否有可能从自定义控件(自​​定义控件)获取文本,例如:vs2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从vs2008或vs其他版本中获取文本.
为了进行测试,我使用了spy ++,并获得了记事本的句柄值.
将WM_GETTEXT发送给它,我可以获得正确的文本.
但是将其用于类名为"vsTextEditPane"的vs2008的文本面板中
什么也没返回. WM_GETTEXTLENGTH也返回零.
我注意到"vsTextEditPane"控件是自定义控件,WM_和EM_是
只是为了正常控制.
我在此站点找到了获取它的方法,但我听不懂.
http://www.gwmicro.com/mediawiki/index.php/Accessing_Text_in_a_Custom_Control
我的语言是c#

请帮忙.

I have tried get texts from vs2008 or vs other versions.
For test, I used spy++ and got the notepad''s handle values.
Sending WM_GETTEXT to it, I could get correct texts.
but using it to vs2008''s text panels of which class name is "vsTextEditPane"
returned nothing. WM_GETTEXTLENGTH also returned zero.
I noticed "vsTextEditPane" control is custom control and WM_ and EM_ is
just for normal control.
I found the way getting it in this site but I can''t understand it.
http://www.gwmicro.com/mediawiki/index.php/Accessing_Text_in_a_Custom_Control
my lang is c#

Please help.

推荐答案

如果它仍来自标准控件,则它是一个自定义控件的事实应该是不相关的.如果不是,如果选择自己的方法来编写文本,那么我想您会发现任何问题,因为它将被编写为不响应这些消息.

您发现的示例似乎在即时模式下使用VBscript.它可能并不会真正转换为您在Visual Studio之外以任何语言运行的代码.您想做什么?
The fact that it''s a custom control should be irrelevant, if it''s still derived from a standard control. If it''s not, if it''s choosing it''s own method to write text, then I''d imagine you''d have trouble finding anything, as it will be written to not respond to these messages.

The example you found, seems to be using VBscript, in immediate mode. It probably doesn''t really translate to you running code outside of visual studio, in any language. What are you trying to do ?


这篇关于是否有可能从自定义控件(自​​定义控件)获取文本,例如:vs2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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