如何将应用程序窗口托管为属于另一个进程的窗口的子窗口?
我想将一个应用程序窗口从进程“A”托管到进程“B”的主窗口中,就像“A”的窗口是 MDI 子窗口一样。 这在 Windows 中可能吗? 还是有一些技巧可以让我伪造这个?
顺便说一句,当“A”窗口嵌入到“B”窗口中时,我想删除“A”窗口的标题栏(或者更好的是,所有非客户端内容)。 我认为这必须通过调整窗口样式或窗口类来实现,但我绝不是这些 Win32 错综复杂的问题的专家。
I would like to host an application window from a process "A" into the main window of a process "B", just as if "A"'s window were a MDI child window. Is this possible in Windows? Or are there some tricks which would allow me to fake this?
By the way, I'd like to remove the title bar (or better yet, all the non-client stuff) of "A"'s window when it is embedded into "B"'s window. I suppose that this must be possible by tweaking the window styles or window classes, but I am by no means an expert in these Win32 intricacies.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以托管 Window。 通过调用 SetParent 函数来更改 A 的父级 HWND。 要更改窗口样式,您需要使用 GetWindowLong/SetWindowLong 对来更改要更改的属性。
如果这是第三方应用程序(即不是您的),那么您可能会遇到麻烦,特别是如果窗口使用其窗口进行任何主题或任何自定义操作(例如,更改拖动区域等) )。
It's possible to host the Window. Change A's parent HWND by calling the SetParent function against it. To change the window styles, you need to use the GetWindowLong/SetWindowLong pair to change the attributes that you want to muck with.
If this is a third-party application (ie, not yours), then you're probably in for a rough ride, particularly if the window does any theming or anything custom with its window (for example, changes to the drag area, etc).