WM_PAINT、Java 和捕获隐藏窗口
首先声明一下,我是一名 Java 程序员,对 Windows API 几乎一无所知。所以请耐心听我说。
我的目标是使用Java来捕获隐藏的窗口。我的目标平台是Windows。我确实知道 Robot
类用于捕获屏幕的可见部分。经过一番浏览后,我发现了这三个链接,它们似乎是相关的:
- http://www .support.teamdev.com/thread/1930
- http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.ui/2006-02/msg00204.html
- http://www.fengyuan.com/article/wmprint.html
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:
- http://www.support.teamdev.com/thread/1930
- http://www.tech-archive.net/Archive/Development/microsoft.public.win32.programmer.ui/2006-02/msg00204.html
- http://www.fengyuan.com/article/wmprint.html
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论