Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Mar 28th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // PostMessage.cpp : This file contains the 'main' function. Program execution begins and ends there.
  2. //
  3.  
  4. # include <iostream>
  5. # include <Windows.h>
  6. # include <synchapi.h>
  7.  
  8. int SendADown(int threadId) {
  9.     std::cout << "Send 'a' Down";
  10.  
  11.     // Copied params from spy++
  12.     WPARAM wParam = 0x41;
  13.     LPARAM lParam = 0x001E0001;
  14.  
  15.     return PostThreadMessage(threadId, WM_KEYDOWN, wParam, lParam);
  16. }
  17.  
  18. int SendAUp(int threadId) {
  19.     std::cout << "Send 'a' Up";
  20.  
  21.     // Copied params from spy++
  22.     WPARAM wParam = 0x41;
  23.     LPARAM lParam = 0xC01E0001;
  24.  
  25.     return PostThreadMessage(threadId, WM_KEYUP, wParam, lParam);
  26. }
  27.  
  28. int main()
  29. {
  30.     const int THREAD_ID = 15224;
  31.  
  32.     SendADown(THREAD_ID);
  33.     Sleep(3000);
  34.     SendAUp(THREAD_ID);
  35.     std::cout << "Hello World!\n";
  36.    
  37.     return 0;
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top