Is there any way to list the Foreground apps (not processes) running on my computer? I tried using psutil but it shows me processes. But I just need to display visible apps.
Here is the code I used -
import psutil
for process in psutil.process_iter ():
Name = process.name () # Name of the process
ID = process.pid # ID of the process
print ("Process name =", Name ,",","Process ID =", ID)
this lists the services that are running too, not just the apps. I need the specific section that are noted by taskmanager as APPS. Look the image below
I tried using the code mentioned above but it didn't work