As John Simmons correctly put it, it's hard to help, so sorry if my advice won't work out.
There are two things:
#1: The problem is
frm.Topmost
. This works like "Always on top" and hides whatever is behind even if you activate that windows behind. Please try it first. If you really need
frm.Topmost = true;
, assign
frm.Topmost = false;
just for the time you show your dialog and assign it back to
true
when dialog is already closed.
#2: If it does not help, I would try the following:
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll", SetLastError=true)]
public static extern IntPtr SetActiveWindow(IntPtr hWnd);
I used the combination of the to do the trick. You need
hWnd
. Therefore, you could use a form instead of
MessageBox
(why not? one problem of
MessageBox
is improper activation in some exotic situation like this one). You can make your form acting like the message box you want, event better and use
MyForm.ShowDialog()
.
Will you please try and report back if it worked for you or not?
Thank you.