I tried to create an application in c++ that sets a low level keyboard hook and each time the user presses a key it will write a char of a string I made.
Can someone explain how can I change the user input without using the keybd_event function but changing the key itself before the OS interprets it.
I tried something with ths MSG and changing the wparam but it didn't work. If someone can show me a code example it will be better
答案 0 :(得分:2)
有人可以解释如何在不使用keybd_event函数的情况下更改用户输入,但在操作系统解释之前更改密钥本身。
你做不到。您必须拒绝钥匙,然后使用getRandomUser
或keybd_event()
发布您自己的钥匙。请务必检查SendInput()
字段是否启用了KBDLLHOOKSTRUCT::flags
或LLKHF_INJECTED
标记,这样您就不会拒绝自己的模拟密钥。
我尝试了一些MSG并更改了wparam,但它没有工作
LLKHF_LOWER_IL_INJECTED
结构不与MSG
挂钩一起使用。