I have a VB6 application (please dont let that put you off replying because
the code is all Win32 API) which takes screenshots of gaming windows - some
OpenGL - some DirectX9.
The code for screenshotting is fairly standard bitblt code and works fine on
Windows 2000 and Windows XP but not reliably on Vista32 or Vista64. This is
how we're using CAPTUREBLT to attempt to make the capture:
R = BitBlt(hDCMemory, 0, 0, WidthSrc, HeightSrc, hDCSrc, _
LeftSrc, TopSrc, vbSrcCopy Or CAPTUREBLT)
CAPTUREBLT is defined as follows:
Public Const CAPTUREBLT As Long = &H40000000 ' Include layered windows
I've since implemented DwmEnableComposition to turn off Aero when the
Library can be loaded and the entry point found - this also works correctly -
with a Vista notification being displayed regarding Vista Basic and
application compatibility - Aero is then turned off (if it was on) and
restored when the process exits.
My question is - should I stop using the CAPTUREBLT flag once i've turned
Aero off?
And i'm also querying in general to see if anyone else is still having
problems in this area.
Thanks in advance.
Crispin.
That said, why do you need to disable desktop composition before
you capture the screen ? Screen capture is painfully expensive with
desktop composition on, for reasons discussed many times,
but, it's still a correct screen capture.
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Cris" <Cr...@discussions.microsoft.com> wrote in message
news:6A5835FA-D55E-46D7...@microsoft.com...
And thanks for clarifying the impact (or rather non impact) of desktop
composition switching on BitBlt.
Bear in mind that im capturing a full screen gaming window, and not the
desktop in this particular application. The gaming window will be either a
DirectX9 surface, or OpenGL.
A number of my user base also had positive results by turning off Aero
manually, launching the application, then the game, and letting the
application take the screenshots.
I suppose though, regardless of desktop composition - my underlying problem
remains the same -
I seem unable to capture this window on Vista32 or Vista64 using BitBlt -
either with, or without the CAPTUREBLT flag, where the same codebase
functions as expected on Windows 2000, and Windows XP32, and Windows XP64.
"Ivan Brugiolo [MSFT]" wrote:
> CAPTUREBLT must be added to include sprites in the screen capthttp://msdn.microsoft.com/wn3/aspx/postui.aspx?mid=bfd0d6e9-a3ec-4293-8e24-361231c46635&guid=&sloc=en-us&dg=microsoft.public.win32.programmer.gdi&base=http://msdn.microsoft.com/newsgroups/default.aspx&bclr=ececec&fclr=000000&sxml=http://msdn.microsoft.com/newsgroups/site.xml&stgxml=http://msdn.microsoft.com/newsgroups/settings.xml&sdgloc=en-US&tt=2ure.
If your path to screen in Vista goes through DirectX redirection, then
the compositor can run a render-pass and copy the content to
a system-memory bitmap that will be given to GDI.
When there are full screen hardware render target,
or, when certain applications that locks the primary in Vista,
then Desktop Composition silently turns off till the application terminates,
and, there is no DirectX redirection in that case.
In the other cases, it dipends if the front buffer of the
application is somewhat shared with the primary surface usade by GDI.
I don't think you can have a single code-base for all the cases across all
OS-es,
and, the problem you are seeing is not influenced by the CAPTUREBLT flag,
since that flag only influences layered windows.
--
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Cris" <Cr...@discussions.microsoft.com> wrote in message
news:10194A74-9696-46D8...@microsoft.com...