Script stops working when certain program is Active

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ali80
Posts: 4
Joined: 23 Jul 2017, 02:04

Script stops working when certain program is Active

23 Jul 2017, 02:26

Hi All,
well I have been scripting (although as a noob) for a while.
Today I've seen a strange behavior, whenever pdf-xchange viewer is ACTIVE the script stops working and for example if I am remapping predefined windows shortcut keys, they return to their default value, if I minimize the program (pdf-xchange viewer) everything works normal again.
And in my script there is no mention of such program.
I've reduced the script to the line below :D , and changed the shortcut from #p which is a predefined windows 10 shortcut to #b the problem still persists.

Code: Select all

#b:: MsgBox, msg
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Script stops working when certain program is Active

23 Jul 2017, 03:44

Hi.
Windows Key + b is predefined by Windows operating system for selecting the first icon in the notification area. (Source: Wikipedia)
However AHK normaly should override this.
I'm using most time the RAlt key when I want to define any hotkey with AHK.
Try it with RAlt key like RAlt & b to prevent potential intricacies.
Sorry, but another possible solution is unknown for me.
Einfach nur ein toller Typ. :mrgreen:
ali80
Posts: 4
Joined: 23 Jul 2017, 02:04

Re: Script stops working when certain program is Active

23 Jul 2017, 05:23

divanebaba wrote:Hi.
Windows Key + b is predefined by Windows operating system for selecting the first icon in the notification area. (Source: Wikipedia)
However AHK normaly should override this.
I'm using most time the RAlt key when I want to define any hotkey with AHK.
Try it with RAlt key like RAlt & b to prevent potential intricacies.
Sorry, but another possible solution is unknown for me.
I think the program mentioned (pdfXChange) is causing the problem. I went with your recommendation and changed the winkey to alt, still no luck,
works everywhere except when pdfXChange is active
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Script stops working when certain program is Active

23 Jul 2017, 08:15

?
How do I work around problems caused by User Account Control (UAC)?

User Account Control (UAC) is a common cause of problems, especially when moving from Windows XP/Vista/7 to Vista/7/8/10. Although it is present in Windows Vista and later, it is enabled by default on new systems or new installs, and it is more difficult to disable on Windows 8 and later.

By default, UAC protects "elevated" programs (that is, programs which are running as admin) from being automated by non-elevated programs, since that would allow them to bypass security restrictions. Hotkeys are also blocked, so for instance, a non-elevated program cannot spy on input intended for an elevated program.

UAC may also prevent SendPlay and BlockInput from working.

Common workarounds are as follows:

Enable the Add 'Run with UI Access' to context menus option in AutoHotkey Setup. This option can be enabled or disabled without reinstalling AutoHotkey by re-running AutoHotkey Setup from the Start menu. Once it is enabled, launch your script file by right-clicking it and selecting Run with UI Access, or use a command line like "AutoHotkeyU32_UIA.exe" "Your script.ahk" (but include full paths).
Run the script as administrator. Note that this also causes any programs launched by the script to run as administrator, and may require the user to accept an approval prompt when launching the script.
Disable the local security policy "Run all administrators in Admin Approval Mode" (not recommended).
Disable UAC completely. This is not recommended, and is not feasible on Windows 8 or later.
https://autohotkey.com/docs/FAQ.htm#uac
ali80
Posts: 4
Joined: 23 Jul 2017, 02:04

Re: Script stops working when certain program is Active

24 Jul 2017, 03:25

I don't know what happened but the problem seems to be fixed by itself for now!
everything is working fine with the original #p key.
anything I tried failed and nothing worked. then it was suddenly fixed by itself! maybe I closed and reopened pdf-XChange but I can't be sure what fixed the issue and I can't recreate the problem.
thanks everyone for their recommendations, if the problem returns or got any additional info I'll let you know.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bobak and 301 guests