如何克隆窗口 [英] How to clone a window

查看:175
本文介绍了如何克隆窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到一种复制和克隆系统窗口的解决方案,例如,如果我在Firefox中打开我的文档"或"www.google.com",我想创建另一个具有相同内容的寡妇,
我打开我的文档" = 2我的文档"窗口
感谢您的帮助.

I need to find a solution to copy and clone a system window, for example, if i open "My documents" or "www.google.com" in Firefox, i want to dcreate another widnows with the same content,
I open "my documents" = 2 "My documents" windows
Thanks for your help

推荐答案

您可以使用DWM轻松显示内容,但是交互可能会更加困难.您必须将从输入设备获得的所有事件转发到源窗口.

http://msdn.microsoft.com/en-us/library/aa969540 (v = vs.85).aspx [
You can use the DWM to rather easely display the contents, interacting could prove more difficult though. You would have to forward all events you get from input devices to your source window.

http://msdn.microsoft.com/en-us/library/aa969540(v=vs.85).aspx[^]
I beleave there is an article about this here on the Code Project too, I just can''t seem to find it right now.


严格来说,这绝对是不可能的.如果这是另一个应用程序和进程的窗口,则您无权访问该进程的代码和数据-它们是孤立的;以及其他进程行为的详细信息会影响每个窗口的行为.

您可以递归收集某个应用程序主窗口的所有子窗口,对于每个子窗口,请复制其文本,位置,大小和样式.因此,您可以大致模拟源窗口的窗口结构;但这几乎是您可以做的.您甚至可以检索每个窗口函数,但它无济于事,因为每个函数都可以在自己的进程的上下文中运行,而不是在您自己的进程中运行.

—SA
Strictly speaking, this is absolutely impossible. If this is a window from another application and process, you don''t have access to the code and data of that process — they are isolated; and the details of the other process''s behavior affect the behavior of each window.

You can recursively collect all child windows of some application''s main window, for each one, copy it''s text, location, size and styles. So, you can roughly mimic the windows structure of source window; but this is pretty much you can do. You can even retrieve a window function of each, but it cannot help you, as each of such functions can run in the context of its own process, not in yours.

—SA


这篇关于如何克隆窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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