You must Sign In to post a response.
  • Category: Windows

    Check application idle status

    Dear Friends.,

    already i find particular exe is running or not whether it is running just i need to check windows application / particular exe idle time in C# winforms

    string FileName = "notepad.exe";
    private bool ProgramIsRunning(string FullPath)
    {
    string FilePath = Path.GetDirectoryName(FullPath);
    string FileName = Path.GetFileNameWithoutExtension(FullPath).ToLower();
    bool isRunning = false;

    Process[] pList = Process.GetProcessesByName(FileName);
    if (pList.Length > 0)
    {
    isRunning = true;
    Idle(); /*here i need to check idel time
    }
    else
    {
    isRunning = false; label1.Text = "Application not running";
    }
    return isRunning;
    }
  • #765477
    you have to use one dll in the exe that is User32.dll namespace is using system.runtime.InteropServices and with a timer you can do it.
    SRI RAMA PHANI BHUSHAN KAMBHAMPATI


Sign In to post your comments