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

  • SEARCH
  • Home
  • 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 6635425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:03:09+00:00 2026-05-25T23:03:09+00:00

How can I get information from a process that it is UI(User Interface) process

  • 0

How can I get information from a process that it is UI(User Interface) process or non-ui?

With UI process I mean, Finder, Dock, System UI server, or any other mac application which has UI interface and it is used by Window Server.

I want to determine this information from ProcessID.

I am using mac os x.

  • 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-25T23:03:10+00:00Added an answer on May 25, 2026 at 11:03 pm

    There is no way to determine based purely on the PID number what a specific process is. The reason for this: Process IDs are assigned (somewhat) sequentially from PID=1 on startup, and startup can be different for different systems. The process ID will also be reassigned if, for example, Finder or Dock crashes and has to be restarted.

    If you can run a terminal command with a specific pid that you have, though, do this:

    ps -p <pid> -o ucomm=
    

    You’ll get the filename of the process, which you can check against a list of ones you know are UI processes. For example, here is the output of certain ps commands on my system for my current login session:

    > ps -p 110 -o ucomm=
    Dock
    
    > ps -p 112 -o ucomm=
    Finder
    

    And the following command will give you a list of processes in order of process ID, with only the name:

    > ps -ax -o pid=,ucomm=
       1 launchd
      10 kextd
      11 DirectoryService
         ...
    

    EDIT: You may be able to do what you ask, though it is convoluted. This answer mentions:

    The function CGWindowListCopyWindowInfo() from CGWindow.h will return an array of dictionaries, one for each window that matches the criteria you set, including ones in other applications. It only lets you filter by windows above a given window, windows below a given window and ‘onscreen’ windows, but the dictionary returned includes a process ID for the owning app which you can use to match up window to app.

    If you can obtain all the CGWindows and their respective pids, then you will know the pids of all UI applications without needing to run ps at all.

    Rahul has implemented the following code for this approach, which he requested I add to my answer:

    CFArrayRef UiProcesses()
    {
        CFArrayRef  orderedwindows = CGWindowListCopyWindowInfo(kCGWindowListOptionAll, kCGNullWindowID);
        CFIndex count = CFArrayGetCount (orderedwindows);
        CFMutableArrayRef uiProcess = CFArrayCreateMutable (kCFAllocatorDefault , count,  &kCFTypeArrayCallBacks);
        for (CFIndex i = 0; i < count; i++)
        {
            if (orderedwindows)
            {
                CFDictionaryRef windowsdescription = (CFDictionaryRef)CFArrayGetValueAtIndex(orderedwindows, i);
                CFNumberRef windowownerpid  = (CFNumberRef)CFDictionaryGetValue (windowsdescription, CFSTR("kCGWindowOwnerPID"));
                CFArrayAppendValue (uiProcess, windowownerpid);
    
            }
        }
        return uiProcess;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i get the information that the server is being connected to the
How can we get Exif information from UIImage selected from UIImagePickerController? I had done
I'd be much obliged for information regarding how can I get the System Identification
I'm using QWINSTA.EXE to get the session/user list from a terminal server on our
I can't seem to get Fabric to play nice with backgrounding a process that
I'm trying to get a process name from its pid. User is running as
Can i get all the events and other informations from android device default calendar
In ASP.NET MVC, I can get information on unit testing for routes and custom
Is there a way in which I can get some information about the mounts
I'm detecting the insertion of memory cards (removable media). Can I get information about

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.