質問

I have an instance of an application running on a Citrix server. I was recently tasked with writing a plugin for that piece of software, and for reasons to do with how software is deployed where I work, the plugin actually just executes another piece of software sitting on a remote server that actually does the work and waits for that process to end (this is hidden from the user).

Occasionally this external software has to display a message with a message box. In order to make sure that it came up on top of the application, I used the user32 messagebox method with that application's handle.

[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern MessageBoxResult MessageBox(IntPtr hWnd, String text, String caption, int options);

public static MessageBoxResult ShowMessageBox(IntPtr windowHandle, string text, string caption, MessageBoxOptions options)
{
  return MessageBox(windowHandle, text, caption, (int)options);
}

That works great when the application is being run on a local machine, but when it is being run through Citrix, the message box no longer shows up on top. Does anyone have any ideas how to make the Citrix version behave like the local version?

役に立ちましたか?

解決

I worked around the issue by setting the topmost flag on the messagebox. This isn't exactly what I wanted, but it was better than having the messagebox not show up on top initially.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top