Tsk is a CLI task lister that includes PIDs, process names, hWnds and window titles. The listing can be limited by supplying a substring of the process name or window title. Here is the usage:
TSK.exe: TaSK Lister|Switcher [CLD rev.2021-03-27]
Usage
-----
TSK [sub$tring]
List running tasks: all tasks [tasks with process_names|window_titles matching sub$tring]
TSK /SW window_title(sub$tring)|PID|hWnd
Switch focus to window with matching window_title(sub$tring)|PID|hWnd
TSK /?|/H
Show this Help
And here's the code (compiled executable is HERE):
#Region ;**** Direct