New command or new ACTIVATE option request

#1
When a batch file needs to send keystrokes to a window, the only method
now available is to use the ACTIVATE command, followed by the KEYSTACK
command. However, if the batch file is executed by a background process, it
is very easy for a different window to be activated from the desktop, or by
another process, before KEYSTACK can deliver the keystrokes. To eliminate
this problem, I'd like to have available a single command that can both
ACTIVATE and deliver keystrokes. Whether this is a new command, or a new
option for the existing ACTIVATE command is irrelevant.
IIRC I had previously requested this feature, for like reasons.
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
10,326
94
#2
> When a batch file needs to send keystrokes to a window, the only method
> now available is to use the ACTIVATE command, followed by the KEYSTACK
> command. However, if the batch file is executed by a background
> process, it is very easy for a different window to be activated from
> the desktop, or by another process, before KEYSTACK can deliver the
> keystrokes. To eliminate this problem, I'd like to have available a
> single command that can both ACTIVATE and deliver keystrokes. Whether
> this is a new command, or a new
> option for the existing ACTIVATE command is irrelevant.
> IIRC I had previously requested this feature, for like reasons.
Why do you think the behavior would be any different if it was one command
instead of two?

Rex Conn
JP Software
 
#3
| ---Quote---
|| When a batch file needs to send keystrokes to a window, the only
|| method now available is to use the ACTIVATE command, followed by
|| the KEYSTACK command. However, if the batch file is executed by a
|| background process, it is very easy for a different window to be
|| activated from the desktop, or by another process, before KEYSTACK
|| can deliver the keystrokes. To eliminate this problem, I'd like to
|| have available a single command that can both ACTIVATE and deliver
|| keystrokes. Whether this is a new command, or a new
|| option for the existing ACTIVATE command is irrelevant.
|| IIRC I had previously requested this feature, for like reasons.
| ---End Quote---
| Why do you think the behavior would be any different if it was one
| command instead of two?

If the two tasks can be done in a single API call, definitely no opportunity
would arise to steal focus. Even if separate API calls are required, the
considerably less time between them would still reduce the probability that
the focus would be stolen.
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
10,326
94
#4
> | ---Quote---
> || When a batch file needs to send keystrokes to a window, the only
> || method now available is to use the ACTIVATE command, followed by
> || the KEYSTACK command. However, if the batch file is executed by a
> || background process, it is very easy for a different window to be
> || activated from the desktop, or by another process, before KEYSTACK
> || can deliver the keystrokes. To eliminate this problem, I'd like to
> || have available a single command that can both ACTIVATE and deliver
> || keystrokes. Whether this is a new command, or a new
> || option for the existing ACTIVATE command is irrelevant.
> || IIRC I had previously requested this feature, for like reasons.
> | ---End Quote---
> | Why do you think the behavior would be any different if it was one
> | command instead of two?
>
> If the two tasks can be done in a single API call, definitely no
> opportunity would arise to steal focus.
True, but for the lamentable fact that there is no API call to do that.
More like 50+ API calls, and there wouldn't be any measurable difference in
the time between them if it were one command versus two commands. And
KEYSTACK has to wait between each keystroke for the console to signal that
it's ready for another key, which is going to be 99% of the time spent.


> Even if separate API calls are required, the considerably less time
> between them would still reduce the probability that the focus would
> be stolen.
Nope -- see above.

Rex Conn
JP Software