Pausing some ahk scripts processes may result into cursor lagging heavily

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
-_+
Posts: 70
Joined: 06 Dec 2014, 12:43

Pausing some ahk scripts processes may result into cursor lagging heavily

14 Mar 2016, 09:22

[Moderator's note: Topic moved from Bug Reports.]

STR:
1. Run this script:

Code: Select all

MButton:: ; here could be any mouse button.
msgbox a
return
2. freeze this script's process in the task manager (you will need an advanced one).

Expected Result:
Moving the cursor works as fine as it usually did: the cursor follows the physical mouse's moves without any delay, continuously.

Actual Result:
The cursor follows the physical mouse's moves with noticeable delays (~0.5sec), discretely.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Pausing some ahk scripts processes may result into cursor lagging heavily

14 Mar 2016, 13:14

Yeah.
When AutoHotkey or any program, that installs an Mouse Hook, will interrupt Windows chain of working on Mouse Input and install parts of it's own code.
Stopping AutoHotkey probably results in a timeout when Windows tries to call the Code since it is "paused".

At this point it might either be a bug in Windows, AutoHotkey or your "advanced taskmanager".
It's most likely that your pausing feature is very quirky and I wouldn't use it since it could affect your system very strongly.
Recommends AHK Studio
-_+
Posts: 70
Joined: 06 Dec 2014, 12:43

Re: Pausing some ahk scripts processes may result into cursor lagging heavily

14 Mar 2016, 15:37

You are right that it might be how windows reacts to freezing processes that have installed mouse hooks, but it definitely has nothing to do with the task manager itself (I may use ahk script to freeze another script's process).
Well, I'm okay with that, if nothing can be done from the AHK side (I don't know, so I reported that unwanted behavior).
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Pausing some ahk scripts processes may result into cursor lagging heavily

14 Mar 2016, 19:48

This is completely expected behaviour, not a bug.

AutoHotkey can't respond to you suspending it to work around the problem, because AutoHotkey's process is suspended. :facepalm:

Process suspension is done using either the undocumented NtSuspendProcess function or SuspendThread, which is "primarily designed for use by debuggers". If it causes problems, you have only yourself to blame.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], joedf, OrangeCat, scriptor2016, supplementfacts and 138 guests