I’d like to know if it is possible to identify which process is responsible for creating/managing a window in Mac OS X.
For example, when multiple instances of an application are started, how can I get the process ID (PID) corresponding to one specific window? Or if there is a modal dialog window without a title, how can I get the PID of its owner?
I know in Windows it is possible using the Sysinternals Suite tool that provides a way to search for a library that is running with some data.
I’m looking for a mechanism similar to the one that appears in this blogpost.
In this case, using Sysinternals Suite (and Process Explorer), they found which DLL/program was using the webcam by searching for a DLL or substring (in this case, using the physical name of the device).
So is there any mechanism or program, or do you have any idea about how to search for something similar for Mac OS X? How I can identify which process has launched a window?
ps -p $(xprop | grep PID | awk -F= '{print $2}')
, if there existed anxprop
-like thing for macOS.