VB.Net中的SendMessage [英] SendMessage in VB.Net

查看:169
本文介绍了VB.Net中的SendMessage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我真的失去了它。我似乎无法绕过

SendMessage函数/方法。我想要做的是将文本/数据

发送到我知道

vb.net应用程序中的句柄的窗口实例。有人可以给我一个很好的代码示例

我需要使用下面的示例数据来创建处理这个代码。


Windows hwnd = 0xB0484

String text =" NM * 14 * ACCTNO * MMDDYY"

我一直在本地和在线帮助中查看它和

在网上搜索全部,我没有得到它。要么我不是b / b
理解它还是遗漏了什么。我现在真的很好

只需要一个好的代码示例。我试图从文本

文件中提取数据并将其以字符串形式发送到另一个应用程序,而无需调用

焦点到窗口。这样我可以在

这个其他程序上运行一批交易。

哦和另外一点信息我正在使用MS VB 2005 Express Edition作为

我的编码环境。

Ok, I am really losing it. I cannot seem to wrap my head around the
SendMessage function/method. What I am trying to do is send text/data
to an instance of a window that I know the handle of from within a
vb.net application. Can someone give me a decent example of the code
I
would need to create to process this using the sample data below.

Windows hwnd = 0xB0484
String text = "NM*14*ACCTNO*MMDDYY"
I have been looking at it both in the local and online help and
searching the web all over and I am not getting it. Either I am not
understanding it right or am missing something. I really right now
just need a good code example. I am trying to pull data from a text
file and send it in strings to another application w/o having to call
focus to the window. This way I can run a batch of transactions on
this other program.
Oh and one other bit of info I am using MS VB 2005 Express Edition as
my coding environment.

推荐答案

5月18日下午12:38,Necromis< tflem ... @ pscufs.comwrote:
On May 18, 12:38 pm, Necromis <tflem...@pscufs.comwrote:

好​​的,我真的失去了它。我似乎无法绕过

SendMessage函数/方法。我想要做的是将文本/数据

发送到我知道

vb.net应用程序中的句柄的窗口实例。有人可以给我一个很好的代码示例

我需要使用下面的示例数据来创建处理这个代码。


Windows hwnd = 0xB0484

String text =" NM * 14 * ACCTNO * MMDDYY"


我一直在看当地和在线帮助和

搜索网络全部,我没有得到它。要么我不是b / b
理解它还是遗漏了什么。我现在真的很好

只需要一个好的代码示例。我试图从文本

文件中提取数据并将其以字符串形式发送到另一个应用程序,而无需调用

焦点到窗口。这样我可以在

这个其他程序上运行一批交易。


哦和另外一点信息我正在使用MS VB 2005 Express Edition作为

我的编码环境。
Ok, I am really losing it. I cannot seem to wrap my head around the
SendMessage function/method. What I am trying to do is send text/data
to an instance of a window that I know the handle of from within a
vb.net application. Can someone give me a decent example of the code
I
would need to create to process this using the sample data below.

Windows hwnd = 0xB0484
String text = "NM*14*ACCTNO*MMDDYY"

I have been looking at it both in the local and online help and
searching the web all over and I am not getting it. Either I am not
understanding it right or am missing something. I really right now
just need a good code example. I am trying to pull data from a text
file and send it in strings to another application w/o having to call
focus to the window. This way I can run a batch of transactions on
this other program.

Oh and one other bit of info I am using MS VB 2005 Express Edition as
my coding environment.



我不认为您可以使用SendMessage API发送字符串

消息。该函数只接受消息的整数值和

lparam和wparam。


谢谢,


Seth Rowe

I don''t think your can use the SendMessage API to send string
messages. The function only accepts integer values for the message and
lparam and wparam.

Thanks,

Seth Rowe



>好的,我真的失去了它。我似乎无法绕过
SendMessage函数/方法。我想要做的是将文本/数据发送到一个窗口的实例,我知道一个
vb.net应用程序中的句柄。
>Ok, I am really losing it. I cannot seem to wrap my head around the
SendMessage function/method. What I am trying to do is send text/data
to an instance of a window that I know the handle of from within a
vb.net application.



目标是什么样的窗口?如果它是标准的Windows控件

那么WM_SETTEXT消息可能是您想要的消息。

Mattias


-

Mattias Sj?gren [C#MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com

请回复到新闻组。

What kind of window is the target? If it''s a standard Windows control
then the WM_SETTEXT message is probably the one you want.
Mattias

--
Mattias Sj?gren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.



>我不认为您可以使用SendMessage API发送字符串
消息。该函数只接受消息的整数值和
lparam和wparam。
>I don''t think your can use the SendMessage API to send string
messages. The function only accepts integer values for the message and
lparam and wparam.



lparam和wparam都可以是任何指针大小的值,包括

字符串指针等。你实际应该作为参数传递什么

取决于消息。

Mattias


-

Mattias Sj?gren [C#MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com

请回复到新闻组。

Both lparam and wparam can be any pointer-sized value, including
string pointers etc. What you actually should pass as arguments
depends on the message.
Mattias

--
Mattias Sj?gren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


这篇关于VB.Net中的SendMessage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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