Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6242097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:53:32+00:00 2026-05-24T11:53:32+00:00

I am looking for a program that measures system idle time on Windows. I

  • 0

I am looking for a program that measures system idle time on Windows. I have found many codes that do this. For example,

http://www.codeproject.com/KB/cs/GetIdleTimeWithCS.aspx

However, I also want to take into account user watching movies, videos, etc. That time no input is given, but still the system is not idle.

Is there anyway to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:53:33+00:00Added an answer on May 24, 2026 at 11:53 am

    This function detects if a process is running in fullscreen in forground, and returns name of the process if found so:

        [DllImport("user32.dll")]
        static extern IntPtr GetForegroundWindow();
    
        [DllImport("user32.dll", SetLastError = true)]
        static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
    
        [DllImport("user32.dll")]
        private static extern Int32 GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
    
        [DllImport("user32.dll")]
        private static extern bool
        GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);
    
        private struct POINTAPI
        {
            public int x;
            public int y;
        }
    
        private struct RECT
        {
            public int left;
            public int top;
            public int right;
            public int bottom;
        }
    
        private struct WINDOWPLACEMENT
        {
            public int length;
            public int flags;
            public int showCmd;
            public POINTAPI ptMinPosition;
            public POINTAPI ptMaxPosition;
            public RECT rcNormalPosition;
        }
    
        public string FullscreenProcess()
        {
            IntPtr foreWindow = GetForegroundWindow();
    
            // get the placement
            WINDOWPLACEMENT forePlacement = new WINDOWPLACEMENT();
            forePlacement.length = Marshal.SizeOf(forePlacement);
            GetWindowPlacement(foreWindow, ref forePlacement);
    
            if (forePlacement.rcNormalPosition.top == 0 && forePlacement.rcNormalPosition.left == 0 && forePlacement.rcNormalPosition.right == Screen.PrimaryScreen.Bounds.Width && forePlacement.rcNormalPosition.bottom == Screen.PrimaryScreen.Bounds.Height)
            {
                uint processID;
                GetWindowThreadProcessId(foreWindow, out processID);
                Process proc = Process.GetProcessById((int)processID);
    
                return proc.ProcessName;
            }
        return null;
        }
    

    After this, we just need to match the returned process name with a set of popular media players or other processes.

    Limitation is that we have assumed user plays in fullscreen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that returns something like this: status: playing artURL: http://beta.grooveshark.com/static/amazonart/m3510922.jpg estimateDuration:
I have a search program that will be looking at a database from a
I am looking for a method to monitor a running program that I have
I'm looking for recommendations for a good program for 32-bit Windows Vista that will
this is something that i don't want to program, but i was looking for
I am looking for a means to kill a Windows exe program that, when
I'm looking at this program that reads input lines and then sorts them, from
I have a Java program that does some String matching. I'm looking for anything
I have been looking at Reflection.Emit recently. I wrote a simple program that generates
I have a Windows C++ program that is doing something like: FILE* pf =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.