Capturing another window

  • Thread starter Thread starter Ryan Gregg
  • Start date Start date
R

Ryan Gregg

I've got an application (WinForms) with an MDI parent form and several MDI
child forms, which all run maximized in the parent. This program needs to
integrate in with another program that we have no control over. What I'd
like to be able to do is capture another window (one from this other app)
and have it appear as an MDI child window in the C# application I've
written.

First, is this even possible? Maybe not exactly this, but something that
would at least achieve a similar appearance?

Second, does anyone know how I can go about doing this?

Thanks a lot.

Ryan Gregg
 
* "Ryan Gregg said:
I've got an application (WinForms) with an MDI parent form and several MDI
child forms, which all run maximized in the parent. This program needs to
integrate in with another program that we have no control over. What I'd
like to be able to do is capture another window (one from this other app)
and have it appear as an MDI child window in the C# application I've
written.

First, is this even possible? Maybe not exactly this, but something that
would at least achieve a similar appearance?

Basically, that's not supported and not possible. The easiest way is to
use 'SetPatent' via p/invoke (Google will show more info) to reparent
the other window. You can get the other process using
'System.Diagnostics.Process.GetProcesses' and get the handle to the
window by taking the 'MainWindowHandle' property value of the 'Process'
object of the other process.
 
Back
Top