Show / Hide Table of Contents

Method wnd.ChildFast(+ 1 overload)


Overload

Finds a direct child control by name and/or class name and returns its handle as wnd.

public wnd ChildFast(string name, string cn, wnd wAfter = default)
Parameters
name  (string)

Name. Full, case-insensitive. Wildcard etc not supported. null means "can be any". "" means "no name". Must include the invisible '&' characters that are used to underline keyboard shortcuts with the Alt key.

cn  (string)

Class name. Full, case-insensitive. Wildcard etc not supported. null means "can be any". Cannot be "".

wAfter  (wnd)

If used, starts searching from the next control in the Z order.

Returns
wnd

Returns default(wnd) if not found. See also: wnd.Is0. Supports lastError.

Remarks

Calls API FindWindowEx. Faster than wnd.Child, which uses API EnumChildWindows. Can be used only when you know full name and/or class name. Finds hidden controls too. Finds only direct children, not other descendants.


Overload(top)

Finds a direct child control by its id and returns its handle as wnd.

public wnd ChildFast(int id)
Parameters
id  (int)

Control id.

Returns
wnd

Returns default(wnd) if not found. See also: wnd.Is0. Supports lastError.

Remarks

Calls API GetDlgItem. Faster than wnd.Child, which uses API EnumChildWindows. Finds only direct children, not other descendants. Finds hidden controls too. Not all controls have a useful id. If control id is not unique or is different in each window instance, this function is not useful.