Windows' Magnifier blocks itself or sends unwanted clicks - or - how to control zooming with AHK?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
A Keymaker
Posts: 455
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Windows' Magnifier blocks itself or sends unwanted clicks - or - how to control zooming with AHK?

Post by A Keymaker » 30 Jul 2023, 05:00

I would like to control usage of a zooming program like Magnify.exe of Windows with my mouse


Based on this discussion viewtopic.php?t=38649 I came up with something like this

Code: Select all

~XButton1 & MButton:: Magnify("ZOOM OUT")   ; Backward Mouse Button + Middle Mouse Button
BlockInput ON
Sleep 555
BlockInput OFF
return

~XButton2 & MButton:: Magnify("ZOOM IN")   ; Forward Mouse Button + Middle Mouse Button
BlockInput ON
Sleep 555
BlockInput OFF
return

~XButton2 & XButton1:: Magnify("EXIT MAGNIFIER")   ; Forward Mouse Button + Backward Mouse Button
BlockInput ON
Sleep 555
BlockInput OFF
return

Magnify(mode)  {
   static WM_SYSCOMMAND := 0x112, SC_CLOSE := 0xF060
   hwnd := WinExist("ahk_class MagUIClass")

   if (mode = "EXIT MAGNIFIER")
      SendMessage, WM_SYSCOMMAND, SC_CLOSE,,, ahk_id %hwnd%

   else  {
      if !hwnd
         Run, magnify.exe
      else if (mode = "ZOOM IN")
         Send #=
      else
         Send #-
   }
}
The problem with it and also some other versions of it is that mouse buttons clicks are sent unwantedly instead of being ignored or that input from all buttons [except those hotkeyed ones] along with input from all keys gets blocked

This latter one happens also often when instead of such AHK script I use freeware X-Mouse Button Control: its ability to control zooming with its global Button Chording set for above buttons [which is forcing me me to look for an alternative to it in form of an AHK script]. So this would point out to the Microsoft's Magnifier itself being just a bad written program, right? So I have so far already tested out more than 5 other zooming programs- but unfortunately they all lacked desired be my functionality [of working in a full screen mode and having buttons / shortcuts for zooming steps]


Hence the question about approaching this issue: should I tackle Magnify.exe with the above script in hopes its blockade can be overcome; or alternatively it will stop executing sending FMB, BMB and MMB clicks when they are used in defined hotkey in this script? Or should I rather continue wasting time on looking for another zooming program in hopes that it will not block input, but which would also require from me of writing a proper script that will be able to control this other zooming software?


I am using Windows 10 Enterprise 20H2 x64
Last edited by A Keymaker on 30 Aug 2023, 05:47, edited 7 times in total.

gregster
Posts: 9096
Joined: 30 Sep 2013, 06:48

Re: Windows' Magnifier blocks itself or sends unwanted clicks - or - how to control zooming with AHK?

Post by gregster » 30 Jul 2023, 15:00

Haven't checked but I seem to remember that for manipulating Magnifier you'll need a script with elevated rights.

User avatar
A Keymaker
Posts: 455
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Re: Windows' Magnifier blocks itself or sends unwanted clicks - or - how to control zooming with AHK?

Post by A Keymaker » 06 Aug 2023, 06:12

I already run all of my AHK scripts as Administrator [due to numerous cascade of issues when trying to apply privileges to some of my scripts in the past]

User avatar
A Keymaker
Posts: 455
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Re: Windows' Magnifier blocks itself or sends unwanted clicks - or - how to control zooming with AHK?

Post by A Keymaker » 30 Aug 2023, 05:50

Does anyone have either an alternative zooming program which can work in a full screen mode and has buttons / shortcuts for zooming steps?

Or have an idea about how to rework my script so that mouse buttons clicks will not be sent unwantedly and / or my more or less whole input will not be stopped?

User avatar
A Keymaker
Posts: 455
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Re: Windows' Magnifier blocks itself or sends unwanted clicks - or - how to control zooming with AHK?

Post by A Keymaker » 22 Oct 2023, 08:41

A Keymaker wrote:
30 Aug 2023, 05:50
Does anyone have either an alternative zooming program
[...]
Or have an idea about how to rework my script
[...]
?

Well, can somebody speak up in these matters?

Post Reply

Return to “Ask for Help (v1)”