question

JohannesBergman-1935 avatar image
0 Votes"
JohannesBergman-1935 asked JohannesBergman-1935 commented

Magnifier Control unable to magnify the taskbar start menu

I've modified the MagnifierSample from the Windows-classic-samples, turning it into a lens magnifier. However when I open the Start Menu by pressing the Start button my magnification lens window is pushed to the background and is unable to magnify the start menu. Is this by design or are we able to overcome this? I wish to build a magnifier doing this for accessibility features. The built-in Magnifier is able to overcome this as seen below:

Windows built-in magnifier:
14200-windows-magnifier.jpg

My modified sample:
14226-my-magnifier-2.jpg

I use...

 CreateWindowEx(WS_EX_TOPMOST | WS_EX_LAYERED | WS_EX_TRANSPARENT,
  WindowClassName, WindowTitle,
  RESTOREDWINDOWSTYLES,
  0, 0, hostWindowRect.right, hostWindowRect.bottom, NULL, NULL, hInst, NULL);

...to create the host window. And...

 SetWindowPos(hwndHost, HWND_TOPMOST, mousePoint.x - (int)(MAGFACTOR * width / 2), mousePoint.y - (int)(MAGFACTOR * height / 2), width, height,
  SWP_NOACTIVATE | SWP_NOSIZE);

...to reposition and reclaim topmost status.

However, the start menu appears immune to this and will always have topmost status no matter what. Seeing as the built-in magnifier is able to lens magnify the taskbar and start menu I hope it is possible to do as well. Does anyone know what needs to be done or if it is possible to do at all?

Thank you!

The full modified source code:
MagnifierSample.cpp


windows-api-generalwindows-api-ui
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Welcome to Microsoft Q&A! I am also able to reproduce this issue and looking into it. Any update will keep post here.

1 Vote 1 ·

Thank you!

And thank you for taking the time to look into this, much appreciated! :)

I look forward to hear back from you.

0 Votes 0 ·

1 Answer

FeiXue-MSFT avatar image
1 Vote"
FeiXue-MSFT answered JohannesBergman-1935 commented

We need to make it a Accessibility app by setting uiAcess=true in the manifest, sign the executable, and placing it in a secure location (e.g. Program Files) as described below:

  1. Set uiAccess=true in the manifest
    Set this option in Visual Studio by setting Linker | Manifest File | UAC Bypass UI Protection to Yes

  2. Sign the executable
    See https://docs.microsoft.com/en-us/previous-versions/bb756995(v=msdn.10)

  3. Place it in a secure location
    See https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-account-control-only-elevate-uiaccess-applications-that-are-installed-in-secure-locations


· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Great news, thank you for getting back to me with this so quickly! I will attempt this right now. However, your link in the 2nd returns a 404 unfortunately.

0 Votes 0 ·

I followed your steps and now it is working! Thank you very much.

0 Votes 0 ·
FeiXue-MSFT avatar image FeiXue-MSFT JohannesBergman-1935 ·

Thanks for confirming, the link was broken by the right parentheses. I am trying to fix the formatting issue however failed, as a workaround you can type it manually, and I will report this issue to Microsoft Q&A platform team internally.

1 Vote 1 ·
FeiXue-MSFT avatar image FeiXue-MSFT JohannesBergman-1935 ·

@JohannesBergman-1935 The broken link in the post was fixed, please chick it again.

1 Vote 1 ·

It works, thank you again for your support, I'm very happy with the quick response here! :)

0 Votes 0 ·