Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam)
  2. {
  3. if(nCode < 0)//Do not process the message
  4. return CallNextHookEx(msg_hook,nCode,wParam,lParam);
  5.  
  6. LPMSG m=(LPMSG)lParam;
  7.  
  8. if(m->message == WM_PASTE)
  9. {
  10. OutputString("Paste detected!n");
  11. }
  12. if(m->message == WM_PASTE)
  13. {
  14. OutputString("Paste detected!n");
  15. }
  16.  
  17.  
  18. return CallNextHookEx(msg_hook,nCode,wParam,lParam);
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25. //DLL_ATTACH:
  26. ...
  27. if(strstr(ProcName, LOADERNAME))
  28. {
  29. InitCommonControls();
  30.  
  31. if(!(msg_hook=SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc, hinstDLL, 0)))
  32. {
  33. ErrorExit(TEXT("SetWindowsHookEx"));
  34. //MessageBox(0, "WH_GETMESSAGE", 0, 0);
  35. //return -1;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement