Cicode Programming Reference > Cicode Function Categories > Window Functions Introduction > WndFind

WndFind

Gets the Windows handle of any window of any application, so that the window can be manipulated. The window handle is not the same as the CitectSCADA window number and cannot be used with functions that expect the CitectSCADA window number (the Win... functions).

The window title (caption) needs to be an exact match of the window name (including any blank spaces) for this function to find the window. You should therefore check that the other application does not change the title of the window during execution.

Be aware that if the title banner of a CitectSCADA window is set with the CitectSCADA parameter [Page] WinTitle, you should not specify justification (for example, use {TITLE,32,N}). If justification is not disabled (that is the N is omitted), you need to pass the full title of the window (including leading and trailing blanks) to this function.

Syntax

WndFind(sTitle)

sTitle

The title (caption) of the window.

Return Value

The window handle. Be aware that this is not the same as a CitectSCADA window number returned from the WinNumber() function.

Related Functions

WinNew

Example

hWndExcel=WndFind("Microsoft Excel - Book1");
! Gets the Windows number of the window titled "Microsoft Excel - Book1"

See Also

Window Functions