1. New:
If (pdlg! = NULL &: IsWindow (pdlg-> m_hWnd ))
Pdlg-> ShowWindow (SW_SHOW );
Else
{
Pdlg = new CFindReplaceDialog ();
Pdlg-> m_fr.Flags = pdlg-> m_fr.Flags | FR_MATCHCASE | FR_WHOLEWORD;
}
If (! : IsWindow (pdlg-> m_hWnd ))
{
Pdlg-> Create (FALSE, "string", "change string ");
Pdlg-> ShowWindow (SW_SHOW );
}
2. Message ing:
1)
// {AFX_MSG (CDialogDlg)
Afx_msg long OnFindReplace (WPARAM wParam, LPARAM lParam );
//} AFX_MSG
DECLARE_MESSAGE_MAP ()
2)
BEGIN_MESSAGE_MAP (CDialogDlg, CDialog)
// {AFX_MSG_MAP (CDialogDlg)
ON_REGISTERED_MESSAGE (WM_FINDREPLACE, OnFindReplace)
//} AFX_MSG_MAP
//
END_MESSAGE_MAP ()
3. Output Information
CString message = "";
If (pdlg-> FindNext ())
{
Message + = "Find Next, \ n \ r ";
}
Message + = "search content :";
Message + = pdlg-> GetFindString ();
Message + = "\ n \ r ";
Message + = "replace content :";
Message + = pdlg-> GetReplaceString ();
Message + = "\ n \ r ";
AfxMessageBox (message );
Return 0;