本文介绍了将文本粘贴到外部应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想制作一个ac#应用程序,以检测活动窗口并检测是否在其中放置了文本框(显然,此文本框应该是窗体的焦点控件),然后将某些文本粘贴到该窗口中文本框.
注意:我们要在其中粘贴文本的应用程序不是我们的c#应用程序,也不是网页. b>


我想要的只是一些想法建议关于如何实现此目标...
预先感谢.

Hi,,
I want to make a c# app that detects the active window and detects if a textbox is placed in it (Obviously this textbox should be the focused control of the form), and then pastes a certain text into this textbox.
NOTE: The application we are going to paste text in it is NOT our c# application AND is not a web page.


All I want is some ideas or suggestions on how this could be made...
Thanks in advance.

推荐答案

   <pre lang="midl">int iHandle = NativeWin32.FindWindow(null, txtTitle.Text);
NativeWin32.SetForegroundWindow(iHandle);





请参阅上面的代码块,如何激活第三方应用程序窗口.然后发送TAB键以聚焦所需的文本框.选择文本并复制到剪贴板,然后激活c#应用程序将其粘贴到所需的位置. (选择和复制您也可以使用发送键来完成).

此解决方案不能100%地帮助您,但您会有所想法的..

谢谢&问候
Rajesh B





see the above code block how to active the window of third party application. then send the TAB keys to focus the text box which you want. select the text and copy to clip board, then activate your c# application paste it where you want. (selection and copy also you can done with SEND KEYS).

This solution will not help you 100%, but you will get an idea ..

Thanks & Regards
Rajesh B




这篇关于将文本粘贴到外部应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 06:13
查看更多