Is it possible to show a WinForms modal form over another process’s main window?
For example my WinForms application consists of one form which is modal over another process’s main window with PID x.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can show it as a dialog, like so:
You pass the current
IWin32Windoworformyou want to be the owner, so if you’re calling it from say a button click on the parent form, just pass throughthis.You want to be able to get the
IWin32Windowfor another process, which is possible, but I don’t know if showing a form as a modal over that is.This is how it would work, if it was possible, however, it doesn’t seem to work for me.
This link may shed a bit more information on the subject: How can I make a child process window to appear modal in my process?