Sendkeys类库 [英] Sendkeys Class Library

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

问题描述


对不起,我的英语不好
我不知道我需要C ++ sendkeys类库来使用我的C#项目
有人帮我吗?


im sorry for my bad english
i don''t know c++ i need (c++ sendkeys class library) to use my c# project
someone help me please ?

推荐答案

首先,如果使用键盘或鼠标输入模拟的不同过程并不严重,则集成". 这是一件坏事.您几乎无法使它可靠.不同的过程相互之间很好隔离.如果他们进行协作,则将通过使用适当的IPC(进程间通信)来专门设计这样做.

通常的方法是在单个过程中使用组件,.NET或其他类型的插件.

如果确实需要模拟输入,则需要使用P/Invoked原始Windows API SendInput.该API是低级仿真,因为它将模拟设备驱动程序发送的输入.

请参阅:
http://msdn.microsoft.com/zh-我们/library/windows/desktop/ms646310%28v=vs.85%29.aspx [ http://en.wikipedia.org/wiki/P/Invoke [ http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp [^ ].

有关P/Invoke的说明,另请参见此CodeProject文章:基本P/Invoke [ ^ ].

—SA
First of all, "integration" if different processes using keyboard or mouse input simulation is just not serious. This is a bad thing. You hardly can make it reliable. Different processes are well isolated from each other. If they collaborate, they are specially designed to do so via using of proper IPC (Inter-process communication).

A normal approach is having components, .NET or other kinds of plug-in used in a single process.

If you really need to simulate input, you need to use P/Invoked raw Windows API SendInput. This API is low-level simulation, as it would simulate input as it was send by the device drivers.

Please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^],
http://en.wikipedia.org/wiki/P/Invoke[^],
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp[^].

For explanation of P/Invoke, see also this CodeProject article: Essential P/Invoke[^].

—SA


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

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