开发者

WM_PAINT, Java and capturing hidden windows

开发者 https://www.devze.com 2023-01-07 11:56 出处:网络
First a disclaimer, I\'m a Java programmer and have almost no idea about the Windows API. So please bear with me.

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 t开发者_如何学JAVAhe 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消