Advertisement
Guest User

bfxKeySend

a guest
May 18th, 2010
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5. void msgProc();
  6. UINT_PTR tmr;
  7. UINT_PTR tenx;
  8. bool modus = false;
  9. void CALLBACK tmrCall(HWND hwnd,UINT uMsg, UINT_PTR idEvent,DWORD dwTime )
  10. {
  11.     if(idEvent == tmr)
  12.     {
  13.         if(!modus)keybd_event(VK_UP,0x1c,0,0);
  14.         else keybd_event(VK_DOWN,0x1c,0,0);
  15.     }
  16.     else if(idEvent == tenx)modus = (!modus) ? (true) : (false);
  17. }
  18. int main(int argc, char* argv[])
  19. {
  20.     cout << "Wird ausgefuehrt..."<<endl;
  21.     tmr = SetTimer(NULL,0,1,(TIMERPROC) tmrCall);
  22.     tenx = SetTimer(NULL,0,600000,(TIMERPROC) tmrCall);
  23.     msgProc();
  24.     return 0;
  25. }
  26.  
  27. void msgProc()
  28. {
  29.     MSG msg;
  30.     BOOL ret;
  31.     while (ret=GetMessage(&msg,NULL,FALSE,FALSE))
  32.     {
  33.         if (ret != -1)DispatchMessage(&msg);
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement