CFindReplaceDialog::GetFindString
會從您的回呼函式之這個函式會擷取預設字串尋找。
CString GetFindString( ) const;
傳回值
要尋找的預設字串。
範例
LRESULT CMyRichEditView::OnFindReplace(WPARAM wparam, LPARAM lparam)
{
UNREFERENCED_PARAMETER(wparam);
CFindReplaceDialog *pDlg = CFindReplaceDialog::GetNotifier(lparam);
if( NULL != pDlg )
{
// Use pDlg as a pointer to the existing FindReplace dlg to
// call CFindReplaceDialog member functions
if(pDlg->IsTerminating())
{
CString csFindString;
CString csReplaceString;
csFindString = pDlg->GetFindString();
csReplaceString = pDlg->GetReplaceString();
VERIFY(AfxGetApp()->WriteProfileString( AfxGetApp()->m_pszAppName,
_T("FindString"), csFindString));
VERIFY(AfxGetApp()->WriteProfileString(AfxGetApp()->m_pszAppName,
_T("ReplaceString"), csReplaceString));
VERIFY(pDlg->DestroyWindow());
}
}
return 0;
}
需求
Header: afxdlgs.h