SendKeysTo

Sends keystrokes to a "parent-windowname".

Syntax:

SendKeysTo(parent-windowname, sendkey string [,delay])

Parameters:

(s) parent-windowname the initial part of, or an entire parent window name.

(s) sendkey string string of regular and /or special characters.

(f) delay [optional] number of seconds to delay between keystrokes sent to the currently active or targeted window.

Returns:

(i) always 0.

 

Use this function to send keystrokes to a particular window. This function is similar to SendKey, but the correct "parent-windowname" will be activated before sending any keys in lieu of using WinActivate. Consequently, a previous WinActivate command will be overridden by this function. See the SendKey function for a description of the "sendkey string". There is no way to emulate the number pad with SendKey or SendKeysTo.

The optional "delay" parameter can be a floating point number to indicate partial second values.  When the parameter is used in a call, the value overrides any keystroke timing value set using IntControl 35 for the duration of the function call.  If the “sendkey string” parameter contains only one key value, the delay will occur after the keystroke is sent to the keyboard driver, but before the function returns.

Note: "parent-windowname" is the initial part of a window name, and may be a complete window name. It is case-sensitive. You should specify enough characters so that "windowname" matches only one existing window. If it matches more than one window, the most recently accessed window which it matches will be used.

The function IgnoreInput may be used to block user input during a sendkey operation.

 

Example:


Run("notepad.exe","")
SendKeysTo("~Notepad", "aBcDeF")

See Also:

SendKey, SendKeysChild, SendMenusTo, SnapShot, IgnoreInput, WinActivate, IntControl 35, IntControl 43, SysParamInfo 4107