Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- void msgProc();
- UINT_PTR tmr;
- UINT_PTR tenx;
- bool modus = false;
- void CALLBACK tmrCall(HWND hwnd,UINT uMsg, UINT_PTR idEvent,DWORD dwTime )
- {
- if(idEvent == tmr)
- {
- if(!modus)keybd_event(VK_UP,0x1c,0,0);
- else keybd_event(VK_DOWN,0x1c,0,0);
- }
- else if(idEvent == tenx)modus = (!modus) ? (true) : (false);
- }
- int main(int argc, char* argv[])
- {
- cout << "Wird ausgefuehrt..."<<endl;
- tmr = SetTimer(NULL,0,1,(TIMERPROC) tmrCall);
- tenx = SetTimer(NULL,0,600000,(TIMERPROC) tmrCall);
- msgProc();
- return 0;
- }
- void msgProc()
- {
- MSG msg;
- BOOL ret;
- while (ret=GetMessage(&msg,NULL,FALSE,FALSE))
- {
- if (ret != -1)DispatchMessage(&msg);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement