Using C++ Magnification API (MagSetWindowTransform) shows both zoomed and normal window simultaneously
I am trying to implement a feature similar to the Windows Magnifier using the Windows Magnification API in C++.
I am using MagSetWindowTransform to apply zoom (scaling) on a magnifier window. The magnification itself works, but I am facing an unexpected issue when zooming in.
Issue Description
When I apply a transform using MagSetWindowTransform:
The zoomed (magnified) content is displayed correctly
At the same time, the original 100% (non-zoomed) content is also visible
As a result, it looks like two windows are rendered:
One zoomed window
One normal-sized window
This is not the expected behavior. I want behavior similar to Windows Magnifier, where only the magnified content is visible, not both.
What I Expect
Only a single magnified view should be displayed
The original (non-magnified) content should not appear simultaneously
The magnifier window should fully replace the normal view when zoomed
What I Am Currently Doing
Creating a magnifier window using CreateWindow
Initializing Magnification API with MagInitialize
Applying scaling using MAGTRANSFORM and MagSetWindowTransform
Using a host window + magnifier child window
Despite this, the unscaled content is still visible behind or alongside the magnified content.
Questions
Is this dual rendering (zoomed + normal) expected behavior with MagSetWindowTransform?
Am I missing a required window style, clipping, or redraw setting to suppress the normal content?
Do I need to:
Hide or invalidate the host window?
Use MagSetWindowSource differently?
Apply specific extended window styles (WS_EX_LAYERED, WS_EX_TRANSPARENT, etc.)?
How does Windows Magnifier internally avoid showing the original unscaled content?
Is there a recommended architecture (fullscreen magnifier vs windowed magnifier) to avoid this issue?
Environment
Language: C++
API: Windows Magnification API
OS: Windows 10 / Windows 11
Magnification method: MagSetWindowTransform
Any guidance, sample code, or explanation of the correct window/magnifier setup would be greatly appreciated.