Discussion:
find the System.Windows.Window object for a given process
(too old to reply)
Jay Meerdink
2010-07-12 12:41:04 UTC
Permalink
If my WinForms app uses System.Diagnostics.Process to fire up another
app such as Notepad, is there a System.Windows.Window object that
corresponds to that instance of Notepad?
Peter Duniho
2010-07-12 16:43:52 UTC
Permalink
Post by Jay Meerdink
If my WinForms app uses System.Diagnostics.Process to fire up another
app such as Notepad, is there a System.Windows.Window object that
corresponds to that instance of Notepad?
No, there is not. At best, there is only a System.Windows.Window object
for windows that are found in WPF applications, and even those objects
are available only within the process that is using them.

From outside a process, without debugging, the only thing that can be
observed are the unmanaged window handles (HWNDs) associated with the
process, that the Windows OS uses to manage the GUI of, and to
communicate with, the process.

Pete

Loading...