SendKeysChild

Sends keystrokes to the active child window.

Syntax:

SendKeysChild(main-windowname, child windowname, sendkey string [,delay])

Parameters:

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

(s) child-windowname the initial part of, or an entire child 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 child window. This function is similar to SendKey, but the desired parent and child windows will be activated before sending any keys in lieu of using WinActiveChild. Consequently, a previous WinActiveChild command will be overridden by this function. See the SendKey function for a description of the "sendkey string".

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: "main-windowname" and "child-windowname" are the initial parts of their respective window names, and may be complete window names. They are case-sensitive. You should specify enough characters so that the window names will match only one existing window of its type. If a windowname 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:


; Start Windows File Manager - the hard way
; This code activates Program Manager, then
; activates the "Main" child window. Sending an
; "f" should (hopefully) activate the File Manager
; icon. The Enter key (abbreviated as ~ ) runs it.
SendKeysChild("Program Manager", "Main", "f~")

See Also:

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