5

我在 C# .NET 中编写了一个全局键盘挂钩程序,它就像一个键盘日志,它将结果写入一个文件。但是我使用了另一个程序,它支持在同一台计算机上输入越南语-它还使用全局挂钩将设置的键盘修复为越南语字符-它影响了我的程序!

示例:当我在没有我的程序的情况下输入以下内容:“xin chao2, to6i la2 mot65 nguoi72 Viet65 Nam”时,它会在我输入每个字符后再次修复:xin chào, tôi là một người Việt Nam。

但是当我使用我的全局钩子时,我会在文件中收到结果:

xin chao2[Back]
[Back]
[Packet]
[Packet]
[Escape]
 toi6[Back]
[Back]
[Packet]
[Packet]
[Escape]
 la2[Back]
[Packet]
[Escape]
 nguoi7[Back]
[Back]
[Back]
[Packet]
[Packet]
[Packet]
[Escape]
2[Back]
[Back]
[Packet]
[Packet]
[Escape]
Viet6[Back]
[Back]
[Packet]
[Packet]
[Escape]
5[Back]
[Back]
[Packet]
[Packet]
[Escape]
 Nam 

那么,我该如何解决这个错误,排除程序支持类型越南语的影响而不删除或禁用它,或者接受它的影响但导致文件看起来像在没有我的程序的情况下输入?

对不起,如果您对我的英语有任何不适!

4

1 回答 1

0

Assuming I understand your question correctly, you are trying to create another hook that will also hook the characters after they have been fixed to use vietnamese characters? It's a bit of a hacky solution, but you could try opening up the vietnamese program which is creating the hook in a debugger, find the function that is doing the hooking, and hook the return value of that function.

Check out windows detours http://research.microsoft.com/en-us/projects/detours/

and if you're doing .NET there's easy hook http://easyhook.codeplex.com/

here's a tutorial on creating hooks in C++ and detours http://gamerztools.net/foros/showthread.php?933-C-Tutorial-Hooking-Functions-using-Detours

Hopefully that should point you in the right direction!

于 2012-11-19T08:11:34.487 回答