Do not want Form to display over other application windows

Posted by Cat on Stack Overflow See other posts from Stack Overflow or by Cat
Published on 2010-05-08T23:37:10Z Indexed on 2010/05/08 23:48 UTC
Read the original article Hit count: 145

Filed under:
|
|

I am displaying a Form from one process by passing the Show method a window handle from another process. I only want this new Form to display above the passed Form, like a MessageBox.

However, this newly launched Form appears above other application windows, despite:

  • Setting Process.WindowStyle.Hidden to the Form-displaying process
  • Overriding the ShowWithoutActivation and CreateParams properties of the Form.
  • Making sure Form.TopMost is not true

I have checked that the window handle is valid from the second process. Focus is not stolen, however.

Process A:
Pass (Form) window handle to a new Process B via the command line

Process B:
Display a new Form using Form.Show(anotherProcessWindowHandle)

© Stack Overflow or respective owner

Related posts about .NET

Related posts about focus