How do I check for PROGRAM idle time, as opposed to SYSTEM idle time?

前端 未结 3 2240
慢半拍i
慢半拍i 2021-02-20 02:11

I have a program that occasionally needs to scan some directories recursively (an improvement for this part of the program is in the pipeline, but won\'t be ready for a while).

3条回答
  •  无人及你
    2021-02-20 02:33

    What you need is a separate thread that will be resumed when the system is idle or paused when there is activity. A simple way to do this is to place a Timer Component and check if the system is idle and thread is suspended or not use ResumeThread ,SuspendThread

    Look here

    http://pastebin.com/8X9Sg42H i crafted something for your situation enjoy

提交回复
热议问题