Key Combination to Start Magnifier

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Key Combination to Start Magnifier

04 May 2021, 05:41

Does anyone know why the following command to start Magnifier in Windows does not work when it is sent through Autohotkey?

Code: Select all

send {lwin down}{+}{lwin up}
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Key Combination to Start Magnifier

04 May 2021, 07:23

Code: Select all

F3::
SoundBeep, 1500
Run, %A_WinDir%\System32\Magnify.exe
Return
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Key Combination to Start Magnifier

05 May 2021, 11:13

mikeyww wrote:
04 May 2021, 07:23

Code: Select all

F3::
SoundBeep, 1500
Run, %A_WinDir%\System32\Magnify.exe
Return
When I run Magnifier directly through its .exe file in Autohotkey, the mouse buttons often stop working when the screen is magnified. This does not happen when Magnifier is run with the Win + + key combination by the user himself.

I have long ago noticed that certain programs behave differently when they are run through AutoHotkey. The system even assigns them separate icons on the taskbar if other instances of the same programs are running.

And when I close a program through AutoHotkey, its full-screen window size is not saved, so that when the program is launched the next time, its window size is different.

Do you know how to launch and close programs through AutoHotkey in such a way that they may work normally?
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Key Combination to Start Magnifier

05 May 2021, 11:28

I have not observed that issue. The method used to close a program might affect how a window handles or retains information about itself. Perhaps you have specific examples to share, and perhaps others have comments about this.
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Key Combination to Start Magnifier

06 May 2021, 06:34

Examples of different behavior of programs when they are launched and closed through AutoHotkey with the Run and Close commands:

When Microsoft Word is launched through AutoHotkey when opening a .docx file (e.g. Run C:\Temp\Example.docx), the file is opened as usual. But when I subsequently manually open another file while the previous file is still open in Microsoft Word, the new window for some reason displays the error message “Document Recovery.”
Image

When a .txt file is opened with AutoHotkey (e.g. Run C:\Temp\Example.txt), the system treats it as separate from other opened .txt files, assigning it a separate taskbar icon.

When I manually ran a .bat file with the instruction to shut down the system, it worked normally. But when I ran the same file through the Run command in Autohotkey, a certain Command Prompt message appeared and then disappeared before shutting down the system.

Another example is that when Magnifier is run with AutoHotkey rather than manually, the mouse buttons work at first but a short time later stop working when the screen is magnified.

When I close maximized Opera browser manually (such as by clicking on the "x" button), the maximized state of the window is saved, so that when the browser is launched the next time, it starts maximized. But when the browser's window is closed through AutoHotkey, the maximized state is not saved, so that when the browser is launched the next time, it starts with a smaller window.

It seems that AutoHotkey causes the system to treat differently the programs which are run and closed through AutoHotkey.
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Key Combination to Start Magnifier

06 May 2021, 06:39

Your description provides the feel of an admin or UAC issue at hand. Would have a look at the following guide.

https://www.autohotkey.com/docs/FAQ.htm#uac
User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Key Combination to Start Magnifier

06 May 2021, 07:45

Alexander2 wrote:
05 May 2021, 11:13
I have long ago noticed that certain programs behave differently when they are run through AutoHotkey. The system even assigns them separate icons on the taskbar if other instances of the same programs are running.
Whether or not it’s the issue with the magnifier program, the issue you are describing in general could be because you didn’t identify the working directory in the second parameter of the Run command. For the magnifier, it would be:

Code: Select all

Run, %A_WinDir%\System32\Magnify.exe, %A_WinDir%\System32
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Key Combination to Start Magnifier

07 May 2021, 09:32

mikeyww wrote:
06 May 2021, 06:39
Your description provides the feel of an admin or UAC issue at hand. Would have a look at the following guide.
https://www.autohotkey.com/docs/FAQ.htm#uac
UAC is disabled on my computer. And AutoHotkey is always run in the Administrator mode.
boiler wrote: Whether or not it’s the issue with the magnifier program, the issue you are describing in general could be because you didn’t identify the working directory in the second parameter of the Run command. For the magnifier, it would be:

Code: Select all

Run, %A_WinDir%\System32\Magnify.exe, %A_WinDir%\System32
I have tried using this command, but the mouse buttons still stop working inside certain programs when the screen is magnified. (For example, the mouse buttons stop working on Kaspersky Internet Security, although they work on the Desktop when the screen is magnified. This does not happen when Magnifier is launched manually rather than through AutoHotkey.)
User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Key Combination to Start Magnifier

07 May 2021, 09:38

I'm guessing it's not AutoHotkey that's the culprit. You would likely have the same result if you ran the file manually from File Explorer by double-clicking on it from its directory (typically C:\Windows\System32).
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Key Combination to Start Magnifier

07 May 2021, 11:17

Since you are running AHK in admin mode, try it without admin mode.
User avatar
jasc2v8
Posts: 59
Joined: 10 Dec 2020, 12:24
Contact:

Re: Key Combination to Start Magnifier

07 May 2021, 12:17

Instead of {+} try NumPadAdd

Code: Select all

~F3::
Send {LWin down}{NumpadAdd}{LWin up}
Return
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Key Combination to Start Magnifier

07 May 2021, 14:19

I'm guessing it's not AutoHotkey that's the culprit. You would likely have the same result if you ran the file manually from File Explorer by double-clicking on it from its directory (typically C:\Windows\System32).
When I run Magnifier manually, the mouse buttons always work when the screen is magnified.
Since you are running AHK in admin mode, try it without admin mode.
I need the Administrator mode because the script includes a command to close Task Manager, which requires the Administrator mode. But before I began using the script in this mode, I remember that programs had similarly behaved differently when run through AutoHotkey in the non-Administrator mode.
Instead of {+} try NumPadAdd
Thank you. The command Send {LWin down}{NumpadAdd}{LWin up} starts Magnifier normally, and the mouse buttons work now.
But I still want to understand why some programs behave differently when their .exe files are launched through AutoHotkey rather than manually.
On your computers, when you open a .docx file with the Run command and Microsoft Word is automatically launched to open the file, do you get the file recovery message when you subsequently manually open another .docx file while the previous .docx file is still open?
And when you close the maximized window of an Internet browser with the Close command, does the system remember the window's maximized state?
Last edited by Alexander2 on 07 May 2021, 14:32, edited 1 time in total.
User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Key Combination to Start Magnifier

07 May 2021, 14:22

Alexander2 wrote: When I run Magnifier manually, the mouse buttons always work when the screen is magnified.
Manually with the keyboard shortcut or manually by double-clicking the file in File Explorer like I described? (or both?)
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Key Combination to Start Magnifier

07 May 2021, 14:31

boiler wrote:
07 May 2021, 14:22
Alexander2 wrote: When I run Magnifier manually, the mouse buttons always work when the screen is magnified.
Manually with the keyboard shortcut or manually by double-clicking the file in File Explorer like I described? (or both?)
I have tested both methods, and in both instances, the mouse buttons work after magnification.
User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Key Combination to Start Magnifier

07 May 2021, 14:40

Alexander2 wrote: On your computers, when you open a .docx file with the Run command and Microsoft Word is automatically launched to open the file, do you get the file recovery message when you subsequently manually open another .docx file while the previous .docx file is still open?
I just tried this, and I did not get a file recovery message. I tried it both with:

Code: Select all

Run, myfilepath.docx
and:

Code: Select all

Run, winword.exe myfilepath.docx
...then manually opened another .docx file while the first file was still open and had no issue either time.
Alexander2
Posts: 348
Joined: 27 Apr 2019, 17:38

Re: Key Combination to Start Magnifier

08 May 2021, 08:53

I just tried this, and I did not get a file recovery message.
Then it seems that the system reacts differently to AutoHotkey only on my computer when the Run command is used in the case of Magnifier and Microsoft Word. Therefore, I will have to use the {lwin down}{numpadadd}{lwin up} command instead of "Run" to start Magnifier for it to work normally.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy and 183 guests