如何将应用程序窗口托管为属于另一个进程的窗口的子窗口? [英] How do I host an application window as a child of a window belonging to another process?

查看:302
本文介绍了如何将应用程序窗口托管为属于另一个进程的窗口的子窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将应用程序窗口从进程 A托管到进程 B的主窗口中,就像 A的窗口是MDI子窗口一样。在Windows中可以吗?还是有一些技巧可以让我假冒呢?

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?

顺便说一句,我想删除标题栏(或者更好的是,所有非客户资料)嵌入到 B的窗口中。我想必须通过调整窗口样式或窗口类来做到这一点,但是我绝不是Win32复杂性方面的专家。

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.

推荐答案

可以托管窗口。通过对其调用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).

这篇关于如何将应用程序窗口托管为属于另一个进程的窗口的子窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆