Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Declined New command or new ACTIVATE option request

May
3,515
5
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
 
> 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
 
| ---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
 
> | ---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
 
Is there any method to prevent stealing of the focus from the window which
is supposed to receive emulated keystrokes from KEYSTACK?
 

Similar threads

Back
Top