将文字插入写字板 [英] Insert text into Wordpad

查看:74
本文介绍了将文字插入写字板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写将文本插入到写字板的打开实例中的C#代码吗?谢谢.

解决方案

回到老式的Windows编程并使用SendKeys类-看到输出实际在何处总是非常令人兴奋.


您想编写将文本插入打开的写字板实例的C#代码吗?从您为帖子选择的主题来看,这完全超出了您的范围.您应该购买一本基本的傻瓜型" C#书籍并仔细阅读,然后在掌握一些基本编程技巧后继续学习.即使这样,如果我做对的话,也只能通过不可靠或不推荐的黑客手段来完成任务.

正如baconbutty所说,您将需要使用user32库中的方法.但是,我也想这对您来说有点高级,尽管google的一点帮助也可以做到.

您必须首先找到窗口的句柄,然后使用SendKeys将文本发送给它.可以做到,但是您必须做一些研究(google).既然我不知道该怎么做,而且做研究也无济于事,所以这取决于您.

在此处查看列表: API调用列表(USER32.DLL) [ 解决方案

Go back to old-fashioned windows programming and use the SendKeys class - it''s always very exciting to see where the output actually ends up.


You want to write C# code that inserts text into an open instance of wordpad ? Judging from the subject you chose for your post, I''d say that this is completely beyond you. You should buy a basic ''for dummies'' C# book and work through it, then move on when you have some basic programing skills. Even then, the task, if I get it right, can only be done via hacks that are not reliable, or recommended. Why would you want to do such a thing ?


As baconbutty said, you''ll need to use the methods within the user32 library. But, I would also guess that this is a bit advanced for you, though a little help in google can do it.

You''d have to first find the handle for the window, then use SendKeys to send the text to it. It can be done, but you''ll have to do some research (google). Since I don''t know straight off the top of my head how to do that, and since doing the research won''t help me in anyway, it''s up to you to do it.

Look at the list here:
API calls list (USER32.DLL)[^]


这篇关于将文字插入写字板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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