typedef struct { /* fr */
DWORD lStructSize;
HWND hwndOwner;
HANDLE hInstance;
DWORD Flags;
LPSTR lpstrFindWhat;
LPSTR lpstrReplaceWith;
WORD wFindWhatLen;
WORD wReplaceWithLen;
DWORD lCustData;
LPFRHOOKPROC lpfnHook;
LPSTR lpTemplateName;
} FINDREPLACE;
The FINDREPLACE structure contains information that the system uses to initialize the system-defined find and replace dialog boxes. After the user dismisses the dialog box, the system returns information about the user-specified find or replace parameters in this structure.
lStructSize
Specifies the length of the structure (in bytes).
hwndOwner
Identifies the window that owns the dialog box. This member can be any valid window handle, but it must not be NULL.
hInstance
Identifies a data block that contains a dialog template specified by the lpstrTemplateName member. This member is only used if the Flags member specifies the FR_ENABLETEMPLATE flag; otherwise, this member is ignored.
Flags
Specifies the dialog-box initialization flags. This member may be a combination of the following values:
Value | Meaning |
FR_DIALOGTERM | Indicates the dialog box is terminating. The window handle returned by the FindText or ReplaceText function is not valid if with flag bit set. |
FR_DOWN | Determines the direction of searches through a document. If the flag is set, the search direction is down; if the flag is clear, the search direction is up. Initially, this flag specifies the state of the up/down checkbox; after the user closes the dialog, this flag specifies the user's selection. |
FR_ENABLEHOOK | Enables the hook function specified in the lpfnHook member of this structure. This flag is only used to initialize the dialog. |
FR_ENABLETEMPLATE | Causes the system to create the dialog box using the dialog template identified by the hInstance and lpTemplateName members. This flag is only used to initialize the dialog. |
FR_ENABLETEMPLATEHANDLE | Indicates that the hInstance member identifies a data block that contains a pre-loaded dialog template. The system ignores the lpTemplateName member if this flag is specified. |
FR_FINDNEXT | Indicates that the application should search for the next occurrence of the string specified by the lpstrFindWhat member. |
FR_MATCHCASE | Set for case sensitive searches. |
FR_NOMATCHCASE | Disables the “Match Case” checkbox. This flag is only used to initialize the dialog. |
FR_NOUPDOWN | Disables the direction radio buttons. This flag is only used to initialize the dialog. |
FR_NOWHOLEWORD | Disables the “Whole Word” checkbox. This flag is only used to initialize the dialog. |
FR_REPLACE | Indicates that the application should replace the current occurrence of the string specified in the lpstrFindWhat member with the string specified in the lpstrReplaceWith member. |
FR_REPLACEALL | Indicates that the application should replace all occurrences of the string specified in the lpstrFindWhat member with the string specified in the lpstrReplaceWith member. |
FR_SHOWHELP | Causes the dialog box to show the Help push button. The hwndOwner must not be NULL if this option is specified. |
FR_WHOLEWORD | Checks the 'Whole Word' checkbox. Only whole words that match the search string will be considered. |
lpstrFindWhat
Specifies the string to search for. If there is a string specified when the dialog starts, the dialog will initialize the “Find What:” text control with this string. If the FR_FINDNEXT flag is set when the dialog starts, the application should search for an occurrence of this string (using the FR_DOWN, FR_WHOLEWORD, and FR_MATCHCASE flags to further define the direction and type of search). The application must allocate a buffer for the string. This buffer should be at least 80 characters long.
lpstrReplaceWith
Specifies the replacement string for replace operations. The FindText function ignores this member.
wFindWhatLen
Specifies the length in bytes of the buffer at which the lpstrFindWhat member points.
wReplaceWithLen
Specifies the length in bytes of the buffer at which the lpstrReplaceWith member points.
lCustData
Specifies application-defined data that the system passes to the hook function identified by the lpfnHook member. The system passes the data in the lParam field of the WM_INITDIALOG message.
lpfnHook
Points to a hook function that processes messages intended for the dialog box. An application must specify the FR_ENABLEHOOK function in the Flags member to enable the function; otherwise, the system ignores this structure member. The hook function should return FALSE to pass a message on to the standard dialog procedure, or TRUE to discard the message.
lpstrTemplateName
Points to a null-terminated string that names the dialog box template resource to be substituted for the standard dialog template. An application can use the MAKEINTRESOURCE macro for numbered dialog resources. This member is only used if the Flags member specifies the FR_ENABLETEMPLATE flag; otherwise, this member is ignored.
FindText, ReplaceText