Hello, I was advised in the past here to take advantage of Windows Vista Magnification API to get the area of the desktop obscured by a given window when on Windows Vista with DWM composition turned on. It is indeed possible for magnification control to filter out unwanted windows easily by using MagSetWindowFilterList() API. However I need that filtered area for further processing and I am unable to "get it back" from magnification control. (I cannot simply use the control itself within my application for certain reasons). I have tried the following so far: - getting the window/client DC of magnification control and BitBlting from it. But this returns dead frame created during control's creation not the current content of the window. - sending WM_PRINT/WM_PRINTCLIENT or using PrintWindow() API. None of these is implemented for Vista magnification control - attemtped to hook WM_PAINT message for both magnifier control or its child "Hardware Magnifier" of MilMagnifierHwnd class but to no avail. I've also attempted to provide my own MagImageScalingCallback routine, but it doesn't seem to work the way I'd expected it to. So the question is: Is there a way to redirect the "magnified" output from magnification control to an internal buffer so I could read and process it as I see fit before displaying it within my window? Thank you, -- Grzegorz Wróbel 677265676F727940346E6575726F6E732E636F6D
Grzegorz Wróbel wrote: > Hello, > > I was advised in the past here to take advantage of Windows Vista > Magnification API to get the area of the desktop obscured by a given > window when on Windows Vista with DWM composition turned on. > > It is indeed possible for magnification control to filter out unwanted > windows easily by using MagSetWindowFilterList() API. However I need > that filtered area for further processing and I am unable to "get it > back" from magnification control. (I cannot simply use the control > itself within my application for certain reasons). > > > I have tried the following so far: > > - getting the window/client DC of magnification control and BitBlting > from it. But this returns dead frame created during control's creation > not the current content of the window. > > - sending WM_PRINT/WM_PRINTCLIENT or using PrintWindow() API. None of > these is implemented for Vista magnification control > > - attemtped to hook WM_PAINT message for both magnifier control or its > child "Hardware Magnifier" of MilMagnifierHwnd class but to no avail. > > I've also attempted to provide my own MagImageScalingCallback routine, > but it doesn't seem to work the way I'd expected it to. > > > So the question is: Is there a way to redirect the "magnified" output > from magnification control to an internal buffer so I could read and > process it as I see fit before displaying it within my window? Does it create a child window in the window you give it? Maybe you can bitblt from that? -- Dean Earley (dean.earley@icode.co.uk) i-Catcher Development Team iCode Systems
Dean Earley wrote: > >> >> So the question is: Is there a way to redirect the "magnified" output >> from magnification control to an internal buffer so I could read and >> process it as I see fit before displaying it within my window? > > Does it create a child window in the window you give it? Yes, magnification control has one child window named "Hardware Magnifier" (MilMagnifierHwnd class). > Maybe you can bitblt from that? > Unfortunately the effect of using BitBlt() with DC obtained from that child is the same as in case of DC of magnification control itself: "dead frame" showing what was on the screen before magnification window was created, not the actual content of the magnification window or its child. -- Grzegorz Wróbel 677265676F727940346E6575726F6E732E636F6D
Grzegorz Wróbel wrote: > Hello, > > I was advised in the past here to take advantage of Windows Vista > Magnification API to get the area of the desktop obscured by a given > window when on Windows Vista with DWM composition turned on. > > It is indeed possible for magnification control to filter out unwanted > windows easily by using MagSetWindowFilterList() API. However I need > that filtered area for further processing and I am unable to "get it > back" from magnification control. (I cannot simply use the control > itself within my application for certain reasons). > > > I have tried the following so far: > > - getting the window/client DC of magnification control and BitBlting > from it. But this returns dead frame created during control's creation > not the current content of the window. > > - sending WM_PRINT/WM_PRINTCLIENT or using PrintWindow() API. None of > these is implemented for Vista magnification control > > - attemtped to hook WM_PAINT message for both magnifier control or its > child "Hardware Magnifier" of MilMagnifierHwnd class but to no avail. > Playing around with DWM APIs I could find that Vista itself can do what I want (DwmRegisterThumbnail(), DwmUpdateThumbnailProperties()...), but again I am not able to get to the bits of the client area of such thumbnail window. It is completely encapsulated I can only modify/access the content of such windows using their limited set of existing DWM APIs, which in practice allows only simple scaling. Looks like MS programmers created Desktop Window Manager that is good only for themselves, there is no door in for independent software developers. So at this point I can only try to bug their support to get me WM_PRINT/WM_PRINTCLIENT/PrintWindow() implemented (at least for their own controls) or get myself "Doesn't work with Windows Vista" logo designed. -- Grzegorz Wróbel 677265676F727940346E6575726F6E732E636F6D