Advertisement
NinoSkopac

Untitled

May 7th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <windows.h>
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6.     unsigned int counter=0;
  7.     FILE* myfile = fopen("example.txt","wb");
  8.     while(true)
  9.     {
  10.         if(GetAsyncKeyState(VK_CONTROL))
  11.         {
  12.             freopen("example.txt","ab",myfile);
  13.             counter++;
  14.             fprintf(myfile,"Escape : %d",counter);
  15.             printf("Button pressed !\n");
  16.         }
  17.       Sleep(100);
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement