Programmatically, how does this application detect that a program is ready for input

前端 未结 3 812
清歌不尽
清歌不尽 2021-01-20 22:51

I need to build a small C# application which measures start up times for a definable application. I have found this free tool:

http://www.passmark.com/products/appti

3条回答
  •  清酒与你
    2021-01-20 23:11

    System.Diagnostics has a method called Process.WaitForInputIdle() which will check if a process is idle.

    Note: This will only work for programs with some sort of interface though (and a message loop).

    MSDN for WaitForInoutIdle()

    Check this previous question for a good example to get your started - all you'd need to do is add the idle method, and hook up the target process:

    Also check this for some good suggestions on how to actually check if the target application has an interface. You will probably not need this though, since you are likely working with known applications.

提交回复
热议问题