使用WMI捕获Keypress事件 [英] using WMI catch Keypress Event

查看:92
本文介绍了使用WMI捕获Keypress事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我想编写一个监视系统事件的程序,并且使用带有C#的WMI.
该程序监视以下类型的事件:
1)处理事件(创建,删除).
2)鼠标事件(移动,按键).
3)键盘事件(按键).
现在,我想在用户每次按下一个键以及每次他移动鼠标或按下一个键时引发事件.
使用WMI可以做到吗?
如果是这样,那又如何?
如果不是最好的方法是什么?

感谢

hi
I want to write a program that Watch system events and I`m using WMI with C#.
the program watch the following type of events:
1)process events(Creation,Deletion).
2)mouse events(Move,keypress).
3)keyboard events(Keypress).
now i want to raise and event every time user press a key and every time he move the mouse or press a key.
is that possible by using WMI?
if that so, then how ?
if not what is the best way?

thanks

推荐答案

您无法在WMI中执行此操作,这样做的效率非常低.

这是键盘和鼠标全局挂钩的内容. Google以"Keyboard Hook"和"Mouse Hook"为例.
You cannot do that in WMI and it would be very inefficient for it to do so.

This is the relm of Keyboard and Mouse global hooks. Google for "Keyboard Hook" and "Mouse Hook" for examples.


您很困惑.作为通用且可能的系统全局工具,您应该使用挂钩.从这里开始:
http://msdn.microsoft.com/en-us/library/ms644960 (v = vs.85).aspx [
You are confused. As a universal and possible system-global tool you should use the Hooks. Start from here:
http://msdn.microsoft.com/en-us/library/ms644960(v=vs.85).aspx[^].

In more simple and specialized cases just handling your windows application messages will solve the problems.

—SA


这篇关于使用WMI捕获Keypress事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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