Advertisement
HITOA

SANS LOGGER

May 24th, 2020
1,586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <fstream>
  4. #include <stdio.h>
  5. #include <string>
  6. #include <mmsystem.h>
  7. #include "resource.h"
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.     unsigned char key;
  14.  
  15.     unsigned char word[4] {'S','A','N','S'};
  16.     int i = 0;
  17.  
  18.     while (TRUE) {
  19.         Sleep(10);
  20.         for (key=8; key<=190;key++) {
  21.             if (GetAsyncKeyState(key) == -32767) {
  22.                 if (key != word[i]) {
  23.                     i=-1;
  24.                 }
  25.                 i++;
  26.             }
  27.         }
  28.         if (i==4) {
  29.             PlaySound(MAKEINTRESOURCE(SANS_THEME), NULL, SND_RESOURCE);
  30.             i=0;
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement