Spy++ comes with paid version of MS Visual Studio as
utility that gives you a graphical view of the system’s processes, threads, windows, and window messages.
and it's not only utility on Win32 that offers this feature, but I use it as popular example.
It lists all UI elements of all running applications, and user can use "Find Tool" to locate UI element of interest and get response dialog with versatile information about that object, like UI control name, text contents, and many other data of potential interest to a programmer.
I'm interested in similar GTK application which can at least return GTK UI element (widget) name and extracted text contents of that element of arbitrary running process.
I couldn't find anything related using Google