Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PrintWindow() API does NOT get an image for Windows created by Java?

843798Apr 28 2007 — edited May 27 2007
Hi
WinXP added the PrintWindow() API that allows one application to take an image copy of another app's window, even if the window is off-screen or obscured, ie beyond the scope of a simple BitBlt. (PrintWindow seems to be a cross-process "extension" of the WM_PRINT message).

But PrintWindow doesn't seem to work when I "point" it at any Java-based apps. That is, for a few java-based apps (including the Java Control Panel) running on XP, the return from PrintWindow includes the non-client area, but the client area is just blackness (not a render of what would be displayed) - the apps do flicker and seem to redraw on the screen instead. Note, I'm not looking for help in using PrintWindow() in a Java app - rather this is perhaps a problem with Java responding to windows painting messages.

I've tried JRE 1.5.0_07-b03 and 1.6.0_01.

Is this a bug in the Java implementation? I'm a bit surprised I can't find any reference to it. Is there a work around?

For a source-code (C++) example of PrintWindow in a small app see http://www.codeguru.com/cpp/g-m/gdi/capturingimages/article.php/c11231
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 24 2007
Added on Apr 28 2007
2 comments
780 views