FINDMSGSTRING

A Find or Replace dialog box sends the FINDMSGSTRING registered message to the window procedure of its owner window when the user clicks the Find Next, Replace, or Replace All button, or closes the dialog box.

MessageID = RegisterWindowMessage(FINDMSGSTRING);
wParam = 0;
lpfr = (LPFINDREPLACE) lParam; 
 

Parameters

lpfr
Pointer to a FINDREPLACE structure. The members of this structure contain the latest user input, including the string to search for, the replacement string (if any) and the search-and-replacement options.

Return Values

No return value.

Remarks

You must specify the FINDMSGSTRING constant in a call to the RegisterWindowMessage function to get the identifier for the message sent by the dialog box.

When you create the dialog box, use the hwndOwner member of the FINDREPLACE structure to identify the window to receive FINDMSGSTRING messages.

The Flags member of the FINDREPLACE structure includes one of the following flags to indicate the event that caused the message:

Flag Meaning
FR_DIALOGTERM The dialog box is closing. After the owner window processes this message, the handle of the dialog box is no longer valid.
FR_FINDNEXT The user clicked the Find Next button in a Find or Replace dialog box. The lpstrFindWhat member specifies the string to search for.
FR_REPLACE The user clicked the Replace button in a Replace dialog box. The lpstrFindWhat member specifies the string to replace and the lpstrReplaceWith member specifies the replacement string.
FR_REPLACEALL The user clicked the Replace All button in a Replace dialog box. The lpstrFindWhat member specifies the string to replace and the lpstrReplaceWith member specifies the replacement string.

For a Find Next or Replace All message, the Flags member can include any combination of the following flags to indicate the search options:

Flag Meaning
FR_DOWN If set, the Down button of the direction radio buttons is selected indicating that user wants to search from the current location to the end of the document. If FR_DOWN is not set, the Up button is selected so the user wants to search to the beginning of the document.
FR_MATCHCASE If set, the Match Case check box is checked indicating that the user wants the search to be case-sensitive. If FR_MATCHCASE is not set, the check box is unchecked so the search should be case-insensitive.
FR_WHOLEWORD If set, the Match Whole Word Only check box is checked indicating that the user wants to search only for whole words that match the search string. If FR_WHOLEWORD is not set, the check box is unchecked so you should also search for word fragments that match the search string.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in commdlg.h.
  Unicode: Defined as Unicode and ANSI messages.

See Also

Common Dialog Box Library Overview, Common Dialog Box Messages, FINDREPLACE, RegisterWindowMessage