从键盘挂钩C#获取进程名称

时间:2019-11-24 07:37:43

标签: c# .net process keyboard hook

我正在尝试创建一个用于教育目的的按键记录器:

Process Init - . 14044 MLogger
Encountered : No process is associated with this object.
Q 2019-11-27 1:23:34 AM
Encountered : No process is associated with this object.
B 2019-11-27 1:23:35 AM
Encountered : No process is associated with this object.
A 2019-11-27 1:23:36 AM
Encountered : No process is associated with this object.
K 2019-11-27 1:23:36 AM
Encountered : No process is associated with this object.
S 2019-11-27 1:23:36 AM
Encountered : No process is associated with this object.
L 2019-11-27 1:23:36 AM

运行此命令时,将得到如下输出:

procc = curProcess;

所以我的问题是我得到 Process Init-。 procc中的14044 LoggerT 和控制台编写。现在的问题是我无法从其他方法打印进程名称,因为K notepad P npp S chrome 是静态的,因此所有其他静态方法都应该访问它,但是它给了我错误。

那这里到底出了什么问题?

我的目标是获取与键盘中断相关的进程/应用程序。

Ex:

{{1}}

0 个答案:

没有答案