.NET (C#): Getting child windows when you only have a process handle or PID?

Posted by shea241 on Stack Overflow See other posts from Stack Overflow or by shea241
Published on 2008-09-17T01:54:52Z Indexed on 2010/12/27 0:54 UTC
Read the original article Hit count: 109

Filed under:
|
|
|

Kind of a special case problem:

  • I start a process with System.Diagnostics.Process.Start(..)
  • The process opens a splash screen -- this splash screen becomes the main window.
  • The splash screen closes and the 'real' UI is shown. The main window (splash screen) is now invalid.
  • I still have the Process object, and I can query its handle, module, etc. But the main window handle is now invalid.

I need to get the process's UI (or UI handle) at this point. Assume I cannot change the behavior of the process to make this any easier (or saner).

I have looked around online but I'll admit I didn't look for more than an hour. Seemed like it should be somewhat trivial :-(

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET