SendMessage 从 Delphi 应用程序到 Java 应用程序 RICHEDIT50W 控件
有谁知道如何将文本从 Delphi 应用程序发送到 java 应用程序 RICHEDIT50W 控件?我已经尝试过这个,但它不起作用:
oPinWindowHandle := FindWindow(nil, 'My Caption');
oRichEditControl := FindWindowEx(oPinWindowHandle, 0, 'RICHEDIT50W', nil);
SendMessage(oRichEditControl, WM_SETTEXT, 0, LongInt(PChar(msg)));
oRichEditControl 和 oPinWindowHandle 都有一个有效的句柄。
编辑
SendMessage 工作正常。它返回 1。也许应用程序正在阻止消息甚至处理自己的消息。有什么方法可以找到应用程序接受哪些消息?
Does anyone know how to send a text from a Delphi app to a java app RICHEDIT50W control? I have tried this, but it does not work:
oPinWindowHandle := FindWindow(nil, 'My Caption');
oRichEditControl := FindWindowEx(oPinWindowHandle, 0, 'RICHEDIT50W', nil);
SendMessage(oRichEditControl, WM_SETTEXT, 0, LongInt(PChar(msg)));
Both oRichEditControl and oPinWindowHandle have a valid handle.
EDIT
SendMessage is working fine. It returns 1. Maybe the app is blocking messages ou even handle its own message. Is there any way to find which messages the app accepts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚发现该应用程序阻止了一些消息,然后我遇到了这个线程:
使用“SendMessage”发送应用程序击键
这对我绕过这个问题有很大帮助。
I just found out that the app was blocking some messages, and then I came across to this thread:
Sending an application keystrokes with “SendMessage”
Which helped me a lot to bypass the issue.