object.FindWindow( [ClassName] [,WindowName] [,SearchChildren] [,hWndFrom] )
- Optional. A String that specifies the class name of the window.
- Optional. A Variant that specifies the title or ID of the window or control.
- Optional. A Boolean that specifies whether child windows are searched.
- Optional. An OLE_HANDLE that specifies the handle of the window to begin the search from.
ClassName is a string specifying the class name of the window you want to find. If omitted, windows will be matched based on the WindowName argument. You can use a tool such as Spy++ (included with Microsoft Visual Studio) to determine the class name of a particular window [Optional].
WindowName is a variant specifying the title or ID of the window you want to find. When searching for controls, always use the ID. If you do not include this argument, the window handle of the first window found of class ClassName will be returned. You can use a tool such as Spy++ (included with Microsoft Visual Studio) to determine the title or ID of a particular window or ID of a particular control [Optional].
SearchChildren is a boolean that specifies whether to seach for child windows. The default value is False. When searching for windows, siblings are searched first. When SearchChildren is True, and there is no match within sibling windows, each sibling's children are recursively searched [Optional].
hWndFrom is an OLE_HANDLE that specifies a window to start the search from. If omitted, the search starts at the desktop [Optional].