User Invoked Process and System Invoked Process

checkingrandom 226 Reputation points
2022-04-28T05:00:52.687+00:00

During our machine Run we can find some process get started by the system in Task Manager.

For example, Sometimes automatically Microsoft Edge gets started in the background and we can see in Task Manager.

So is there any Windows API to find whether a process is started by User or by system....?
I mean windows API to differentiate Foreground windows and background windows

Windows development | Windows API - Win32
{count} votes

Accepted answer
  1. Xiaopo Yang - MSFT 12,731 Reputation points Microsoft External Staff
    2022-04-28T07:12:41.11+00:00

    According the document sample Finding the Owner of a File Object in C++, You can use GetSecurityInfo and and LookupAccountSid function to retrieve the process owner.
    Or you can determine the SID type like the answer.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2022-04-28T06:34:15.813+00:00

    I mean windows API to differentiate Foreground windows and background windows

    A Background process in Task Manager is just a process without visible window
    (you can see How does Task Manager categorize processes as App, Background Process, or Windows Process?)

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.