Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. //Credits to : cardoow  (for key list)
  2. #include <Windows.h>
  3. #include <iostream>
  4. #include <fstream>
  5. #include "keys.h"
  6.  
  7. using namespace std;
  8.  
  9. char key;
  10.  
  11. void file() {
  12.  
  13.  ifstream myReadFile;
  14.  myReadFile.open("C:\\Hotkey.txt");
  15.  char output;
  16.  if (myReadFile.is_open()) {
  17.     myReadFile >> output;
  18.     key = output;
  19. }
  20. myReadFile.close();
  21. }
  22.  
  23. DWORD WINAPI Hotkeys(LPVOID)
  24. {
  25.     file();
  26.     while (1)
  27.     {
  28.         if(GetAsyncKeyState(key)&1)
  29.             MessageBox( 0, "Freee!", "FREE",  0);
  30.         Sleep(200);
  31.     }
  32.     return 0;
  33. }
  34.  
  35. BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
  36. {
  37.     if(dwReason == DLL_PROCESS_ATTACH)
  38.     {
  39.         CreateThread(0,0,Hotkeys,0,0,0);
  40.     }
  41.  
  42.     return TRUE;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement