CFindReplaceDialog Class
Allows you to implement standard string Find/Replace dialog boxes in your application.
class CFindReplaceDialog : public CCommonDialog
Members
Public Constructors
Name |
Description |
---|---|
Call this function to construct a CFindReplaceDialog object. |
Public Methods
Name |
Description |
---|---|
Creates and displays a CFindReplaceDialog dialog box. |
|
Call this function to determine whether the user wants to find the next occurrence of the find string. |
|
Call this function to retrieve the current find string. |
|
Call this function to retrieve the FINDREPLACE structure in your registered message handler. |
|
Call this function to retrieve the current replace string. |
|
Call this function to determine whether the dialog box is terminating. |
|
Call this function to determine whether the user wants to match the case of the find string exactly. |
|
Call this function to determine whether the user wants to match entire words only. |
|
Call this function to determine whether the user wants all occurrences of the string to be replaced. |
|
Call this function to determine whether the user wants the current word to be replaced. |
|
Call this function to determine whether the user wants the search to proceed in a downward direction. |
Public Data Members
Name |
Description |
---|---|
A structure used to customize a CFindReplaceDialog object. |
Remarks
Unlike the other Windows common dialog boxes, CFindReplaceDialog objects are modeless, allowing users to interact with other windows while they are on screen. There are two kinds of CFindReplaceDialog objects: Find dialog boxes and Find/Replace dialog boxes. Although the dialog boxes allow the user to input search and search/replace strings, they do not perform any of the searching or replacing functions. You must add these to the application.
To construct a CFindReplaceDialog object, use the provided constructor (which has no arguments). Since this is a modeless dialog box, allocate the object on the heap using the new operator, rather than on the stack.
Once a CFindReplaceDialog object has been constructed, you must call the Create member function to create and display the dialog box.
Use the m_fr structure to initialize the dialog box before calling Create. The m_fr structure is of type FINDREPLACE. For more information on this structure, see the Windows SDK.
In order for the parent window to be notified of find/replace requests, you must use the Windows RegisterWindowMessage function and use the ON_REGISTERED_MESSAGE message-map macro in your frame window that handles this registered message.
You can determine whether the user has decided to terminate the dialog box with the IsTerminating member function.
CFindReplaceDialog relies on the COMMDLG.DLL file that ships with Windows versions 3.1 and later.
To customize the dialog box, derive a class from CFindReplaceDialog, provide a custom dialog template, and add a message map to process the notification messages from the extended controls. Any unprocessed messages should be passed to the base class.
Customizing the hook function is not required.
For more information on using CFindReplaceDialog, see Common Dialog Classes.
Inheritance Hierarchy
CFindReplaceDialog
Requirements
Header: afxdlgs.h