Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include "util.h"
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9. LRESULT CALLBACK NewKeyboard(int code, WPARAM wParam, LPARAM lParam)
  10. {
  11. KBDLLHOOKSTRUCT *lol = (KBDLLHOOKSTRUCT*)lParam;
  12. if(code < 0)
  13. CallNextHookEx(hhk, code, wParam, lParam);
  14.  
  15.  
  16.  
  17. if (wParam == WM_KEYDOWN)
  18. if (vkcodetounicode(lParam))
  19. return 1;
  20.  
  21.  
  22.  
  23. return 0;
  24. }
  25.  
  26. DWORD vkcodetounicode(LPARAM lParam)
  27. {
  28.  
  29. KBDLLHOOKSTRUCT *lol = (KBDLLHOOKSTRUCT*)lParam;
  30.  
  31. INPUT test;
  32. ZeroMemory(&test, sizeof(test));
  33. test.type = INPUT_KEYBOARD;
  34. test.ki.dwFlags = KEYEVENTF_UNICODE;
  35.  
  36. for (int i = 0; i < 26; i++)
  37. {
  38.  
  39.  
  40. if (lol->vkCode == 0x41 + i)
  41. {
  42. test.ki.wScan = 0xFF41 + i;
  43.  
  44.  
  45. SendInput(1, &test, sizeof(test));
  46. return 1;
  47. }
  48. }
  49.  
  50.  
  51. return 0;
  52.  
  53.  
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement