On macOS¶
Download pid_for_moved_window.py .
Make it executable (in a shell):
Execute it (in a shell) and move the desired window a little bit on the screen (within 3 seconds):
Example execution and output:
myuser@mycomputer somefolder % ./list_moved_window.py
Move target window (within 3 seconds)...
Moved window belongs to process with ID (PID): 94464
Process information ('ps -p 94464'):
PID TTY TIME CMD
94464 ?? 8:06.88 /System/Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor
On Unix¶
It is possible to discover which process a window belongs to by using the xprop
command line tool (which is part of the Debian package x11-utils
).
Execute the following command in a shell:
Click on the window whose process should be identified. (If the desired window is not visible, use
Alt+Tab
to bring it to the foreground.) The above command should then output the process ID, for example:923
To output the parent process ID (PPID), process ID (PID) and the complete command used for executing a process, the following command can be used (in the same way):
Example output:
854 2101 /usr/lib/firefox/firefox https://www.froglogic.com
On Windows¶
It is possible to discover which process a window belongs to by using the Process Explorer tool.
Start Process Explorer:
Drag and drop the "Find Windows's Process" symbol onto the window whose process should be identified:
After the drop, Process Explorer selects the process that the window belongs to:
Double click (or right click and choose
Properties
from context menu) the respective process to show its more of its details: