Windows XP - drawing on hidden/inactive/out of desktop window
Im developing a program that need to take snapshot from main application window and write it to jpeg file, when window is on the desktop center its all ok:
but when part of it is moved out of desktop area as here:
im receiving that:
i have this problem on windows xp(win 7 works fine, didnt check on vista), as you ma guess i would like to receive same snapshot as on the screen 1, even if windows is moved out of desktop area, thanks for help
But i think that code works just fine
I have even downloaded some screenshot programs but none of them except ashampoo screen capture doesn't had option to capture user-defined window, i found only "full destktop, foreground window, user-snipped area", and ashampoo havent't captured full window too...only the part that was visible on the desktop
Its rather look like windows xp just don't paint on that part of window and my question is : is there a way to force it to paint on that area?
i have tried with WM_PAINT/WM_PRINT message etc. but nothing worked for me, GetPixel is returnig 255,255,255 values for invisible part of window
Re: Windows XP - drawing on hidden/inactive/out of desktop window
For starting purpose, you can have a look at this article: Easy Screen Capture Using MFC/ATL.
It provides an easier way than GDI+, by extending CImage class which uses GDI+ itself.
It has a lightweight implementation but can be easily improved, e.g. by adding a method that capures an arbitrary window, other than the foreground one. Or, you can let it as it is, and bring to front the desired window from your application before capture.
However, it does not resolve the OP problem. But probably, you have made a false assumption: capturing a window partially out-of-screen works on Windows 7 and doesn't work on XP. Most possible, you have set multi-monitor display on one system, while the other one has set only primary display monitor. So, if a part of a window falls in another monitor area, then no problem. Otherwise, that's it... Windows doesn't paint outside the (virtual) display area.
One alternative solution is to use PrintWindow function. It allows "capturing" covered and off-screen windows but loses layered and desktop composition (aero) effects.
Last edited by ovidiucucu; September 13th, 2012 at 03:08 AM.