Sorry in advance for the title. I'm just - not - able to find the good terms to ask it.
With Winforms, I know it was possible with some P/Invoke and with Handles to recursively get visual informations from a program.
So, can I 'manually' recompose a screenshot from a WPF application by obtaining informations about the different Windows and children from this application?
That would be the equivalent of using several methods like this one:
static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect);
to obtain Windows Forms information.
[EDIT] Actually, I'm trying to hack myself. I'm remotely compiling applications on my server using the CodeDom.Compiler, and I'm curious if it's possible to receive a textual stream (XML or XAML) of what is happening in my app. (I plan on wiring my web application to the server with SignalR.)
What I can do if there's no way to reverse it cleanly:
I can add a method inside the app that will constantly (maybe every 1 second or on a screenshot XOR difference, though it's cpu intensive) check for all windows (controls) informations (ActualHeight/Width and absolute coordinates) and stream it to a socket.