| | |
How to capture the system idle time in c/c++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
There are probably a number of ways to solve that. The solution I took was to create another listener thread. The main program thread sends a message to this listerner thread every keyboard and mouse event. The listner thread waiks up from Sleep() every minute and checks its input queue. If nothing then it knows there has been no keyboard or mouse activity during the last minute and can take appropriate actions.
You might also use SetTimer() and and capture WM_TIMER events. The os will call a function of your choice after the specified amount of time has elapsed. The main program could have a counter that increments each time a keyboard or mouse event occurs, then the timer function just checks that counter -- if counter is zero then there were no events.
You might also use SetTimer() and and capture WM_TIMER events. The os will call a function of your choice after the specified amount of time has elapsed. The main program could have a counter that increments each time a keyboard or mouse event occurs, then the timer function just checks that counter -- if counter is zero then there were no events.
> Please help me. It's urgent....
http://www.catb.org/~esr/faqs/smart-...ns.html#urgent
http://www.daniweb.com/techtalkforums/thread29300.html
Dredging up long dead threads with pointless "me too" queries won't buy you much sympathy either.
http://www.catb.org/~esr/faqs/smart-...ns.html#urgent
http://www.daniweb.com/techtalkforums/thread29300.html
Dredging up long dead threads with pointless "me too" queries won't buy you much sympathy either.
![]() |
Similar Threads
- how to capture the system idle time using java (Java)
- how to capture the system idle time using c/c++ (C++)
- "System Idle Process" (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: borland c++ 5.2
- Next Thread: I need help urgently on Arrays and functions
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll download dynamiccharacterarray email encryption error file format forms fstream function functions game givemetehcodez graph homeworkhelp iamthwee ifstream input int java lib library lines list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sorting spoonfeeding string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






