FindTextA

The FindTextA function displays the Find dialog box, from which the user can specify the text to search for.

BOOL FindTextA(
_In_ LPFINDTEXTA lpFindText
);

Parameters

Parameter Description
lpFindText A pointer to the FINDTEXTA structure that contains information about the requested find operation. This structure is used to initialize the Find dialog box and to receive information about the user's input.

Return Value

Value Description
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The FindTextA function creates and displays the Find dialog box.

To initialize the dialog box, the application uses the FINDTEXTA structure. The structure specifies the template to be used to create the dialog box, the handle to the owner window, the initial text to be searched, and other data. The structure can also specify a custom template for the dialog box.

When the user clicks the Find Next button, the function sets the charnext member of the FINDTEXTA structure to the position of the found text and returns TRUE. If the user clicks Cancel or closes the dialog box, the function returns FALSE.

Requirements

Description
Minimum supported client Windows 2000 Professional
Minimum supported server Windows 2000 Server
Header commdlg.h (include windows.h)
Library Use comdlg32.lib
DLL comdlg32.dll
Unicode and ANSI versions The FindTextA (ANSI) and FindTextW (Unicode) versions of this function are available. See Character sets for more information.

See Also

Note: This page is a reference for the Win32 API. For an implementation example, please refer to the official Microsoft documentation or relevant developer resources.