I think boiler means to ask whether
the bookkeeping program or
the script is running as administrator.
It is not necessary to run the script as administrator; but doing so is one possible workaround for the problem described below.
boiler wrote: ↑15 Jul 2021, 10:27
When you say made it run as administrator, do you mean AutoHotkey itself, or the script? To have an effect, you need to run the script as administrator, no matter what privileges AHK or the Windows user has.
That's a little confusing. What's the difference between AutoHotkey itself and the (AutoHotkey) script? What privileges does AHK have
when it's not running? If AHK isn't running, privileges are irrelevant. If AHK is launched by another process that was already running as administrator, AHK will inherit those privileges. What matters is that it has administrator privileges, not how it got them.
The problem boiler is alluding to is that if the target window's process is running at a higher
integrity level than the script's process, a security feature known as
User Interface Privilege Isolation will generally prevent the script's process from sending or intercepting keystrokes. In other words,
if the target process is running as administrator, a script which is not running as administrator generally cannot send keystrokes to it.
The exception, as noted in the FAQ (
How do I work around problems caused by User Account Control (UAC)?), is that "running with UI Access" allows the script process to circumvent these restrictions.
glupost4 wrote: ↑15 Jul 2021, 09:56
I'm using Remote Desktop (RDP)
Which system is running your script? I assume your bookkeeping program is running on the remote system, otherwise I can't imagine how your use of RDP is relevant.
If you have the RDP setting "Apply Windows key combinations" set to "On the remote computer" or "Only when using the full screen" (and you are using the full screen), the RDP client may install its own keyboard hook which takes precedence over any (previously installed) local hook. This prevents hotkeys from working if the script is running on the local computer. Possible solutions may include:
- Change the "Apply Windows key combinations" setting to "On this computer". This will, of course, also prevent Windows key combinations from being sent to the remote computer, so may not be ideal.
- "Reinstall" the keyboard hook after the RDP client window is activated (every time it is (re)activated, not just when it is launched), such as by suspending and unsuspending hotkeys or reloading the script.
- Run the script (or the relevant part of the script) on the remote computer instead of the local computer.