zoukankan      html  css  js  c++  java
  • VC:CFindReplaceDialog(非模态对话框、IsWindow()、m_fr、GetFindString())

    1、新建:

           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,"字符串","改变字符串");

                  pdlg->ShowWindow(SW_SHOW);

           }

    2、消息映射:

           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、输出信息

                  CString message="";

                  if(pdlg->FindNext())

                  {

                  message+="查找下一个、\n\r";

                  }

                  message+="查找内容:";

                  message+=pdlg->GetFindString();

                  message+="\n\r";

                  message+="替换内容:";

                  message+=pdlg->GetReplaceString();

                  message+="\n\r";

                  AfxMessageBox(message);

                  return 0;

  • 相关阅读:
    一个靠谱的技术方案文档是怎样的
    代码可复用性问题兼谈团队协作
    碎碎念五四
    碎碎念五五
    cmd命令查看本机的端口占用情况
    JS字符串里字符串嵌套和转义字符
    cef内嵌浏览器提示clodop未安装或未启动
    ADD_PRINT_IMAGE直接输出图片URL方式
    lodop缩放图片到完全适合纸张
    部署Kubernetes Cluster
  • 原文地址:https://www.cnblogs.com/shenchao/p/2737749.html
Copyright © 2011-2022 走看看