0

现在我有一个名为“TargetForm”的带有 MenuStrip 的 WinFormApp,它通过调用 API 函数 SetParent 嵌入到另一个名为“HostForm”的 WinFormApp 中。但是我发现 MenuStrip 停止运行,无论我如何点击它

似乎 TargetForm 的 MenuStrip 在 HostForm 托管时没有意识到鼠标已被单击。

我正在使用 SPY++ 监视 TargetForm 上的 Windows 消息,并发现当我单击菜单时引发了 WM_PARENTNOTIFY

我可以将 Windows 消息 WM_PARENTNOTIFY 从 HostForm 发布到 MenuStrip 吗?

4

1 回答 1

0

I would put the contents of the main form of the embedded app into a WinForms User Control (put it into a separate project), and embed the user control into both applications.

于 2012-06-07T16:48:26.743 回答