At my operating system course in a project we have to get process status. We are coding with c.
Example output:
Process No Process Id Program Name Status Handle Count
1 5780 notepad.exe ACTIVE 1
How can i get status and handle count?
Get a process handle using
OpenProcesswithPROCESS_QUERY_INFORMATIONas the desired access (or use a handle previously obtained, possibly fromCreateProcess), then try to get its termination status usingGetExitCodeProcess. If it returnsSTILL_ACTIVE, the process has not terminated yet, otherwise it has. Don’t forget to close the handle usingCloseHandle