Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about time-tracking

Read more about time-tracking

python (65.2k questions)

javascript (44.3k questions)

reactjs (22.7k questions)

java (20.8k questions)

c# (17.4k questions)

html (16.3k questions)

r (13.7k questions)

android (13k questions)

Questions - time-tracking

Get process ID of the foreground window

I'm trying to build a time tracker in Python, that records the screen time of applications I'm using. Approach that I use to get the PID of foreground window works fine most of the time: import psutil...
test-img

CodeApex

python

pywin32

psutil

time-tracking

Votes: 0

Answers: 1

Latest Answer

Found the problem. Sometimes GetForegroundWindow thinks that the foreground window is System Idle Process, then GetWindowThreadProcessId returns a list of to PIDs corresponding to that process - [0 (a...
test-img

CodeApex

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved