简体   繁体   中英

Another global hook affects to my global hook

I wrote a global keyboard hook program in C# .NET act like a keylog, it writes results to a file. But i used another program, which supports for type Vietnamese language in same computer- it also uses global hook to fix set keyboards to Vietnamese characters- it affect to my program!

Example: when i type following: "xin chao2, to6i la2 mot65 nguoi72 Viet65 Nam" without my program, it will fix again after each character i typed to: xin chào, tôi là một người Việt Nam.

But when i use my global hook, i receive result in file:

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 

So, how do i fix this error, exclude effect of program support type Vietnamese without remove or disable it, or accept effect from it but results in file look like when type without my program?

Sorry if you have any uncomfortableness about my English!

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM