ReplaceText
The ReplaceText
function creates a system-defined modeless dialog box that lets the user
specify a string to search for and a replacement string, as well as options to
control the find and replace operations.
HWND ReplaceText(
LPFINDREPLACE lpfr |
// pointer to
structure with initialization data |
); |
|
Parameters
lpfr
Pointer to a FINDREPLACE
Return Values
If the function
succeeds, the return value is the window handle to the dialog box. You can use
the window handle to communicate with the dialog box or close it.
If the
function fails, the return value is NULL. To get extended error information,
call the CommDlgExtendedError
CDERR_FINDRESFAILURE |
CDERR_MEMLOCKFAILURE |
CDERR_INITIALIZATION |
CDERR_NOHINSTANCE |
CDERR_LOADRESFAILURE |
CDERR_NOHOOK |
CDERR_LOADSTRFAILURE |
CDERR_NOTEMPLATE |
CDERR_LOCKRESFAILURE |
CDERR_STRUCTSIZE |
CDERR_MEMALLOCFAILURE |
FRERR_BUFFERLENGTHZERO |
Remarks
The ReplaceText
function does not perform a text replacement operation. Instead, the dialog box
sends FINDMSGSTRING
Before
calling ReplaceText, you must call the RegisterWindowMessage
If you create
a Replace dialog box, you must also use the IsDialogMessage function in the main
message loop of your application to ensure that the dialog box correctly
processes keyboard input, such as the TAB and ESC keys. The IsDialogMessage function returns a
value that indicates whether the Replace dialog box processed the message.
You can
provide an FRHookProc
See Also