WM_PAINT、Java 和捕获隐藏窗口

发布于 2024-09-10 10:06:02 字数 1016 浏览 4 评论 0原文

首先声明一下,我是一名 Java 程序员,对 Windows API 几乎一无所知。所以请耐心听我说。

我的目标是使用Java来捕获隐藏的窗口。我的目标平台是Windows。我确实知道 Robot 类用于捕获屏幕的可见部分。经过一番浏览后,我发现了这三个链接,它们似乎是相关的:

JxCapture 的价格非常昂贵冯远的文章很复杂。我的问题是,论坛里的高手能否帮我找到一个合理的解决方案。 JxCapture 中建议的方法似乎并不太复杂。有什么提示吗?执行此操作的 Visual Basic 脚本或一些 C# 代码将是一个很好的起点。

我相信,当窗口隐藏时,如果我向它发送按键事件或鼠标按下事件,它将迫使它重新绘制自身,从而允许它自己被 java.awt.Robot 捕获。那是一种幻觉,而且行不通。

另一方面,JxCapture 线程中的消息来自 2006 年;难道Sun从那时起就包含了这样的功能而我只是不知道吗?

First a disclaimer, I'm a Java programmer and have almost no idea about the Windows API. So please bear with me.

My goal is to use Java to capture a hidden window. My target platform is Windows. I do understand that the Robot class is used for capuring the visible part of the screen. After some browsing, I came across these three links, which seem to be relevant:

JxCapture is as bloodily expensive as Feng Yuan article is complicated. My question is this, if the gurus in this forum can help me find a reasonable solution. The approach suggested in JxCapture does not seem to be overly complex. Any hints? A visual basic script or some C# code that does this would be a good starting point.

I was of the belief that when the window is hidden, if I send a keypress event or a mouse press event to it, it would force it to redraw itself and hence allow itself to be captured even by java.awt.Robot. That was an illusion and it doesn't work.

On the other hand, the message in the JxCapture thread is from the year 2006; could it be that Sun has included such a feature since then and I'm just not aware of it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文