Bertiaux
asked on
Capture hidden window
How to capture any hidden or partially visible window (SDI or MDI) from external process using its hWnd?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have tested WM_PRINT message with MS Powerpoint: I do not get client area just borders and scroll bars.
Do you have any idea?
Do you have any idea?
Yea, add some options to the lParam of the message.
PRF_CLIENT | PRF_NONCLIENT
Should get you the whole window.
corey
PRF_CLIENT | PRF_NONCLIENT
Should get you the whole window.
corey
ASKER
Even with these params, I just get nothing.
Is seems that some applications windows such as Powerpoint windows do not react to WM_Print.
The question seems to be the following : Is WM_Print acting on all kind of graphics or device?
Are there limitations?
Thanks
Is seems that some applications windows such as Powerpoint windows do not react to WM_Print.
The question seems to be the following : Is WM_Print acting on all kind of graphics or device?
Are there limitations?
Thanks
The window does need to support the WM_PRINT call in its procedure.
PowerPoint could have limitations on when it responds to these window (visible only, or in focus, or it has to convert the display it is using to printing using a special method).
PP is probably using a form of DirectDraw or Direct3D which is not performed directly on a device context but you could try adding child and other flags to the lParam to make sure.
corey
PowerPoint could have limitations on when it responds to these window (visible only, or in focus, or it has to convert the display it is using to printing using a special method).
PP is probably using a form of DirectDraw or Direct3D which is not performed directly on a device context but you could try adding child and other flags to the lParam to make sure.
corey
ASKER
If a form of DirectDraw or Direct3D is used, what would then be the solution?
We have tried with all the params, including the one related to child and we just get external frame.
We have tried with all the params, including the one related to child and we just get external frame.
The only way to get that image then would be to grab a copy of the front or back buffer in video memory using Direct3D.
corey
corey
Programmatically, you would use the http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/d3d/interfaces/IDirect3DDevice9/GetFrontBufferData.asp ["IDirect3DDevice9::GetFro ntBufferDa ta Method"] call to get the best image. Don't do this many times in a row as it requires a copy and can be slow.
corey
corey
ASKER
Thanks for the info,
We shall try and keep you posted.
We shall try and keep you posted.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/prntspol_6qpj.asp
But won't work with win95/98/xp